Connection reset by peer
The computer at the other end, or a firewall or load balancer between you, abruptly aborted the connection with a reset packet.
Quick checks
- Does it happen after a period of inactivity? That's an idle timeout.
- Does it happen on large transfers? Look at MTU or server limits.
- Try another network or turn off the VPN.
Fixes on Mac
SSH sessions that drop when idle
- Add to
~/.ssh/config:ServerAliveInterval 60andServerAliveCountMax 3, so the session sends keep-alives through NAT and firewalls.
- Add to
Node.js (ECONNRESET)
- Retry idempotent requests with backoff.
- Mismatched keep-alive timeouts are common: make the client's idle socket timeout shorter than the server's, so the client never reuses a socket the server just closed.
Check MTU on VPNs
- If large transfers reset but small ones work, lower the MTU (System Settings › Network › Details › Hardware) and test.
Fixes on Windows
Windows
- Check antivirus network protection and VPN clients; reset Winsock if resets happen everywhere.
Other devices
Servers
- Check server logs for crashes or limits (max connections, request size, timeouts) at the time of the reset.
Still not working?
Broken pipe is the mirror image: your program wrote to a connection the other side had already closed. The fixes are the same: keep-alives, sensible timeouts and retries.
See what’s happening
LightAtom's connections view shows long-lived connections from your apps and when they disappear.
Frequently asked questions
What does “connection reset by peer” mean?
The remote end sent a TCP RST, ending the connection immediately, because the server process closed, crashed, timed out the connection, or a middlebox killed it.
What is ECONNRESET in Node.js?
Node's error code for a connection reset by the other side. It often happens when reusing a keep-alive socket the server had already closed.
What causes “broken pipe”?
Writing to a socket after the other side closed it. Idle timeouts and server restarts are common triggers.