Node.js ECONNRESETWhat ECONNRESET means
ECONNRESET surfaces when the peer sends a TCP RST on an established connection: the socket was open, data may already have flowed, and then it was killed abruptly instead of closed with a normal FIN handshake. In Node it appears on reads (read ECONNRESET) or writes (write ECONNRESET, often alongside EPIPE) — and if it fires on a socket with no 'error' listener, it crashes the entire process.
The single most common mechanical cause is the keep-alive race: your HTTP agent reuses a pooled connection at the same moment the server's idle timeout closes it. The server's close and your new request cross on the wire, and the request dies with a reset. It is inherently timing-dependent, which is why ECONNRESET is intermittent and hard to reproduce on demand.
Beyond that race, resets come from crashed or restarting processes, load balancers culling idle or long-lived connections, NAT devices dropping mappings during quiet periods, and servers that reset connections deliberately — which is exactly what rate limiters and anti-bot systems do when they dislike a traffic pattern.