599 Network Connect Timeout Error

Failed TCP connections to the upstream server before the connect timeout expires are signaled by some proxies with 599 Network Connect Timeout Error.

Usage

The 599 Network Connect Timeout Error status code is an informal convention indicating the proxy was unable to establish a TCP connection to the upstream server within the allowed timeout. Unlike 598 Network Read Timeout Error, where the connection succeeds but the read times out, a 599 means the connection itself was never established.

This status code is not defined in any RFC or formal specification. Some proxy implementations and custom middleware adopt the code to provide more granular timeout reporting to downstream clients.

Tornado's client-side 599

The most common place developers meet a 599 today is not on the wire at all. The HTTP client in the Python Tornado framework raises an HTTPError with code 599 when no HTTP response was received, for example on a connect or request timeout. The code exists only inside the client process. No server sent it, and the response attribute of the error carries the partial result when one exists. Retry logic in Tornado applications treats 599 as a network failure, not as a status returned by the upstream.

from tornado.httpclient import HTTPClient, HTTPError

try:
    HTTPClient().fetch("https://api.example.re/status", request_timeout=5)
except HTTPError as e:
    if e.code == 599:
        print("no response received", e)

Example

A proxy attempts to connect to an upstream server. The TCP connection does not complete within the proxy's connect timeout window.

Request

GET /api/status HTTP/1.1
Host: www.example.re
Accept: application/json

Response

HTTP/1.1 599 Network Connect Timeout Error
Date: Mon, 02 Mar 2026 11:20:00 GMT
Content-Type: text/plain

Network connect timeout while attempting to
reach upstream server

How to fix

The fix depends on the proxy software generating the 599 response. Unlike 598 Network Read Timeout Error, the TCP connection itself never completed.

Verify the upstream is listening. Confirm the upstream server process is running and bound to the expected port. Run ss -tlnp or netstat -tlnp on the upstream host to check active listeners. A stopped service or a wrong port binding on a reachable host produces an immediate connection refusal rather than a timeout, so a 599 usually means the SYN packets are being dropped silently somewhere on the path, or the host itself is down.

Tune the proxy connect timeout. In Nginx, adjust proxy_connect_timeout (default 60 seconds):

location /api/ {
    proxy_pass http://upstream;
    proxy_connect_timeout 10s;
}

In HAProxy, the equivalent is timeout connect. Keep the connect timeout short (5-15 seconds) since TCP handshakes complete in milliseconds on a healthy network. A long connect timeout masks underlying connectivity problems.

Check firewall and routing. Ensure no firewall rules between the proxy and upstream silently drop SYN packets. Run traceroute or mtr between the two hosts to identify routing failures or packet loss. If the proxy and upstream are in different networks or cloud regions, verify security group rules and VPC peering configurations allow traffic on the upstream port.

Confirm DNS resolution. If the proxy resolves the upstream hostname via DNS, verify the returned IP address is correct. Stale DNS cache entries pointing to a decommissioned server cause persistent connect timeouts. Flush the proxy's DNS cache, or wait out the TTL the old record carried. Lowering the TTL after the change does nothing for caches already holding the old answer, so lower it before the next planned move.

Add upstream redundancy. Configure multiple upstream servers in the proxy's upstream block. If one instance is unreachable, the proxy fails over to a healthy instance instead of returning a 599 to the client.

See also

Last updated: November 3, 2026