Skip to content
MtrXTools

curl: (56) Recv failure: Connection reset by peer

The connection broke while receiving data

Seen in curl, libcurl (CURLE_RECV_ERROR), Git, Docker builds

curl was receiving data when the connection failed, usually because the other end or a device in between reset it.

Common causes

  • A firewall, proxy or load balancer reset the connection, often after an idle or size limit.
  • The server process crashed or closed the socket abruptly.
  • A proxy refused the CONNECT tunnel ("Received HTTP code 403/407 from proxy after CONNECT").
  • An unstable network or MTU problem breaking larger packets.

How to fix it

  1. Run curl -v to see how far the transfer got before the reset.
  2. If a proxy is involved, check HTTPS_PROXY and proxy credentials; 407 means proxy authentication is required.
  3. Check server and load balancer logs and timeouts.
  4. Test from another network to see whether the reset comes from your side.
Test the connection to the host

Got a different message? Paste it into the error explainer.

Related errors

All 34 Command line & code errors