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
- Run curl -v to see how far the transfer got before the reset.
- If a proxy is involved, check HTTPS_PROXY and proxy credentials; 407 means proxy authentication is required.
- Check server and load balancer logs and timeouts.
- Test from another network to see whether the reset comes from your side.
Got a different message? Paste it into the error explainer.
Related errors
- curl: (28) Operation timed out · The request timed out
- ECONNABORTED · The connection or request was aborted
- unable to get local issuer certificate · The client can't find the certificate's issuer
- unable to verify the first certificate · The intermediate certificate is missing
- certificate has expired · The server certificate has expired
- self signed certificate in certificate chain · The chain ends in an untrusted root
- wrong version number · TLS spoken to something that isn't TLS
- curl: (6) Could not resolve host · The hostname doesn't resolve
- curl: (7) Failed to connect · The connection was refused or unreachable
- curl: (51) SSL: no alternative certificate subject name matches target host name · The certificate doesn't match the hostname
- curl: (3) URL using bad/illegal format or missing URL · curl could not parse the URL
- curl: (18) transfer closed with outstanding read data remaining · The connection closed before the body finished