A client gets `Connection reset by peer` in the middle of a request.
IntermediateTroubleshootingConnectivity: refused, timed out, no route
Answer
Likely causes → The server process crashed or closed the socket with unread data, an idle timeout on a middlebox (NAT, firewall, LB) expired and it sent RST, or a proxy hit a limit (request size, header size).
Diagnose →
sudo tcpdump -ni any host 10.0.3.7 and 'tcp[tcpflags] & tcp-rst != 0' -w rst.pcap
journalctl -u myapp --since -10min
dmesg -T | grep -i -E 'oom|killed'
Capture on both ends: if the server never sent the RST, a middlebox did.
Fix → Fix the crash, raise the middlebox idle timeout, or enable TCP keepalives below that timeout.
Prevent → Keep client idle timeouts shorter than every middlebox timeout in the path.
More on Connectivity: refused, timed out, no route
`curl: (7) Failed to connect to 10.0.2.15 port 8080: Connection refused`Beginner`curl: (28) Failed to connect to api.internal port 443 after 130001 ms: Connection timed out`Beginner`ssh: connect to host 10.1.4.20 port 22: No route to host`BeginnerService works with `curl localhost:3000` on the box but times out from other hosts.Beginner`ping` works but `curl` to port 80 on the same host times out.Beginner`curl` to a public site works, but `ping 8.8.8.8` shows 100% packet loss.Beginner