Skip to content
RU

upstream connect error or disconnect/reset before headers: Reading the Reset Reason

What it means: Envoy picked a backend, but the connection failed or was reset before any response headers arrived.

  1. Read the reset reason after the message
  2. Check the backend listens on that port
  3. Match TLS or mTLS settings on both sides
  4. Align keep-alive timeouts with the proxy

Test your URL now

Requests the address and shows the status code and what the server sends back.

What the message means

Envoy's router builds this body when an upstream request ends before the backend sent response headers. In the current source the string is assembled as upstream connect error or disconnect/reset before headers. , then retried and the latest if retries happened, then reset reason: and the reason, and optionally , transport failure reason: with the low-level detail (router.cc). A typical response:

HTTP/1.1 503 Service Unavailable
server: envoy

upstream connect error or disconnect/reset before headers. reset reason: remote connection failure, transport failure reason: delayed connect error: Connection refused

The status is 503, except when the reset reason is protocol error, which gives 502. Unlike no healthy upstream, Envoy did choose a host and tried to talk to it. Older Envoy releases printed shorter reasons such as reset reason: connection failure; the meaning is the same. Operators can hide the transport detail with the runtime flag envoy.reloadable_features.hide_transport_failure_reason_in_response_body, so the tail may be missing.

Reset reasons and what they point to

The reason strings come from Http::Utility::resetReasonToString() (utility.cc); the access log flag is set from the same reason.

Reset reasonAccess log flagUsual cause
remote connection failure, local connection failureUFTCP connect refused or failed: the app is not listening on that port, the pod is restarting, a NetworkPolicy blocks it
connection timeoutUFNo answer to the connect within connect_timeout (5 s if not set): firewall drops, wrong IP, overloaded node
connection terminationUCThe backend closed the connection: crash, a keep-alive connection closed by the app as Envoy reused it, TLS rejected by the server
remote reset, remote refused stream resetURThe backend sent a TCP RST or an HTTP/2 stream reset
overflowUOEnvoy's own circuit breaker (max connections or pending requests) was full
protocol errorUPEThe backend spoke a different protocol than configured: HTTP/1 to an HTTP/2 cluster, plain text to a TLS cluster, malformed headers

The transport failure reason narrows it further: an errno text such as Connection refused means nothing listens; a TLS error string means certificate, SNI or protocol mismatch between the proxy and the backend.

Typical cases in Istio and Kubernetes

  • App listens on localhost only. A server bound to 127.0.0.1 inside the pod is invisible to traffic arriving on the pod IP in some setups. Bind to 0.0.0.0.
  • Wrong targetPort. The Service sends to a port the container does not open. kubectl get svc reviews -o jsonpath='{.spec.ports}' must match containerPort.
  • mTLS mismatch. A PeerAuthentication in STRICT mode with a client that sends plain text, or a DestinationRule that originates TLS to a pod that already terminates TLS, ends in connection termination or a TLS transport reason.
  • Protocol selection. Istio picks the protocol from the Service port name or appProtocol. A port named http in front of a gRPC or HTTP/2-only server produces protocol error.
  • Keep-alive race. The app closes idle connections sooner than Envoy stops reusing them; intermittent connection termination on low traffic is the signature.

How to fix it

  1. Reproduce from the proxy's network position. From the client sidecar:
    kubectl exec deploy/productpage -c istio-proxy -- curl -sv http://reviews:9080/ 2>&1 | tail -5
  2. Check the listener inside the backend pod.
    kubectl exec deploy/reviews -c reviews -- ss -ltn
    # State  Recv-Q Send-Q Local Address:Port
    # LISTEN 0      128          0.0.0.0:9080
    A port bound to 127.0.0.1, or a different port, explains connection failure.
  3. Check TLS policy. istioctl x describe pod REVIEWS_POD shows the effective mTLS mode and DestinationRule; for TLS to an external backend test the handshake: openssl s_client -connect 203.0.113.10:443 -servername api.example.com -brief </dev/null.
  4. Check port naming. Name the Service port grpc or http2, or set appProtocol, when the backend speaks HTTP/2.
  5. Fix keep-alive. Make the backend's idle timeout longer than the proxy's, or limit how long Envoy keeps idle upstream connections (common_http_protocol_options.idle_timeout on the cluster).
  6. Watch the backend's own logs at the same timestamp: an OOM kill or restart lines up with connection termination.

How to confirm the fix

for i in $(seq 1 50); do curl -s -o /dev/null -w '%{http_code}\n' https://example.com/api/; done | sort | uniq -c
#      50 200

Intermittent cases need volume: fifty requests without a single 503 is a better test than one. In the access log the UF, UC or UPE flags must stop appearing for the cluster. For the public address, the HTTP status checker shows the status code and body the proxy returns.

Related errors

60+ Status CodesComplete HTTP status code reference
Search by CodeQuick search for 200, 301, 404, 500
Categories 1xx–5xxInformational, success, redirects, errors
Examples & CausesWhen it occurs and how to fix it

Why teams trust us

60+
status codes
1xx-5xx
all categories
SEO
ranking impact
Free
online reference

How to use the reference

1

Enter code or keyword

2

Find description and causes

3

Apply recommendations

HTTP Status Codes Reference

HTTP status codes are three-digit numbers that the server returns for every request. They tell the browser and search crawlers what happened: success, redirect, or error.

Quick Search

Enter a code or keyword — instant result with description.

All Categories

1xx Informational, 2xx Success, 3xx Redirect, 4xx Client Error, 5xx Server Error.

Causes & Fixes

For each code: typical causes and concrete steps to resolve.

SEO Impact

How each code affects indexing and link juice transfer in Google.

Who uses this

Developers

choosing correct status

SEO

redirect optimization

DevOps

5xx error diagnostics

Marketers

landing page check

Common Mistakes

Confusing 301 and 302301 is permanent (passes SEO equity), 302 is temporary (does not).
Returning 200 on error"Soft 404s" — a 404 page with status 200 — confuse search engines and stay indexed.
Ignoring 5xx errors500, 503 are server failures. Prolonged episodes remove pages from the index.
Redirect chainsA→B→C instead of A→C slows loading and dilutes SEO equity. Simplify chains.

Best Practices

Use 301 for permanent redirectsThis passes 90–99% of link equity to the new URL.
Return 404 for missing pagesDon't mask 404 as 200 — it hurts SEO and UX.
Monitor 5xx in real timeSet up an HTTP monitor that alerts on 5xx.
Use 410 instead of 404410 Gone means "page permanently removed" — Google de-indexes faster.

Monitor HTTP statuses automatically

HTTP monitor alerts when response code changes or 5xx appears.

Sign up free

Learn more

Sources

Frequently Asked Questions

What does "reset reason: connection failure" mean?

Envoy could not open a TCP connection to the chosen backend: nothing listened on that address and port, or the connect failed. Newer releases print remote connection failure or local connection failure for the same case.

Why is it a 503 sometimes and a 502 other times?

Envoy returns 502 when the reset reason is protocol error and 503 for the other reset reasons.

What does "retried and the latest reset reason" mean?

A retry policy was active, Envoy retried the request, and every attempt failed. The reason shown is the one from the last attempt.

Why does the error appear only now and then?

Intermittent cases usually come from a keep-alive race, where the backend closes an idle connection just as Envoy reuses it, or from pods restarting during a rollout.

Is this error caused by Istio mTLS?

It can be. A plain-text client hitting a STRICT mTLS workload, or double TLS between a DestinationRule and the app, ends the connection before headers. istioctl x describe pod shows the effective policy.

Try the live tool that powered this guide

Free plan — 10 monitors, checks every 5 min, no card required. Upgrade for 1-minute interval and multi-region monitoring.