# no live upstreams while connecting to upstream

- **ID:** `nginx/no-live-upstreams-while-connecting-to-upstream`
- **Domain:** nginx
- **Category:** network_error
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

All upstream servers in the upstream block are marked as down or have failed health checks, leaving no available targets.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| nginx 1.24.0 | active | — | — |
| nginx 1.22.1 | active | — | — |
| nginx 1.26.0 | active | — | — |

## Workarounds

1. **Check upstream server health and restart them: systemctl restart myapp. Also verify health_check settings in nginx.conf and ensure backup servers are defined: server backup1.example.com backup;** (90% success)
   ```
   Check upstream server health and restart them: systemctl restart myapp. Also verify health_check settings in nginx.conf and ensure backup servers are defined: server backup1.example.com backup;
   ```
2. **Temporarily mark a server as up with max_fails=0 fail_timeout=0 in the upstream block: server 10.0.0.1:8080 max_fails=0 fail_timeout=0;** (85% success)
   ```
   Temporarily mark a server as up with max_fails=0 fail_timeout=0 in the upstream block: server 10.0.0.1:8080 max_fails=0 fail_timeout=0;
   ```

## Dead Ends

- **Increase worker_connections to 10240** — This error is about upstream availability, not connection limits. Increasing worker_connections cannot revive dead upstream servers. (95% fail)
- **Set proxy_next_upstream to always retry** — proxy_next_upstream only works if there is at least one live upstream. If all are dead, retry logic is useless. (85% fail)
