ECONNRESET API Origin: Application & API OSI layer 4 · Transport Last updated 14 Oct 2026

Error: socket hang up / read ECONNRESET

The other side closed the TCP connection abruptly while your client was still using it.

Exact message you may see socket hang upConnection reset by peerread ECONNRESETConnection aborted
Seen on: Node.js Python AWS

Meaning

The connection was established, then reset. Typical culprits are keep-alive connections reused after the server (or a load balancer) already closed them, servers crashing mid-response, and proxies/firewalls killing long or idle connections.

Common causes

  • Reusing a keep-alive socket the server already closed (server keep-alive timeout < client’s)
  • Upstream crashed or restarted while handling the request
  • Load balancer/NAT idle timeout dropping the connection
  • TLS/protocol mismatch (HTTP to an HTTPS port)
  • Request body too large → server closes early

⚡ Quick fix

  1. Retry idempotent requests once on ECONNRESET
  2. Make server keep-alive timeout longer than the load balancer’s idle timeout
  3. Check server logs for crashes at the same time
  4. Verify protocol/port (https on 443)

Detailed fix by platform

Node.js

  1. Server keep-alive longer than the ALB idle timeout (60s):
    javascript
    const server = app.listen(3000);
    server.keepAliveTimeout = 65_000;
    server.headersTimeout = 66_000;   // must be greater than keepAliveTimeout

Python

  1. requests: mount an HTTPAdapter with Retry(total=3, allowed_methods=None, backoff_factor=0.5) to retry connection resets.

How to diagnose

  1. When — First request or reused connection?
  2. Server — Crash/restart logs at that time?
  3. Timeouts — Keep-alive vs LB idle timeout
  4. Protocol — Right scheme and port?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

0x80070035 — 0x80070035: The network path was not found (System error 53) (Windows)0x800700350x80072EE7 — Error 0x80072EE7 (Windows Update / Microsoft Store: server name could not be resolved) (Windows)0x80072EE70x8024402C — Windows Update error 0x8024402C (cannot connect to update server) (Windows)0x8024402C14 UNAVAILABLE — gRPC Error: 14 UNAVAILABLE: No connection established / failed to connect to all addresses (API)14 UNAVAILABLE2003 — MySQL ERROR 2003 (HY000): Can't connect to MySQL server on 'host:3306' (111) (MySQL)2003502 — HTTP 502 Bad Gateway (HTTP)502511 — HTTP 511 Network Authentication Required (HTTP)511auth/network-request-failed — Firebase Auth: auth/network-request-failed — A network AuthError (such as timeout, interrupted connection or unreachable host) has occurred (Authentication)auth/network-request-…ECONNRESET

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.