Git "RPC failed; curl 56 / HTTP 500" on a large clone in CI
The clone started but the connection died while streaming a large pack. curl 56 (recv failure) and intermittent HTTP 500s on big repos are transport-level drops, not repository corruption.
What this error means
Cloning a large repo fails partway with RPC failed; curl 56 Recv failure: Connection reset by peer or error: RPC failed; HTTP 500. Small repos clone fine; the same big repo sometimes succeeds on retry.
remote: Enumerating objects: 1338201, done.
error: RPC failed; curl 56 Recv failure: Connection reset by peer
fatal: the remote end hung up unexpectedly
fatal: early EOFCommon causes
Large pack over an unstable connection
A multi-gigabyte history streamed over a flaky or throttled network link is interrupted before the pack finishes.
Proxy or gateway buffer limits
An intermediate proxy or CI egress gateway caps the response size or idle time and resets long transfers.
HTTP/2 multiplexing hiccups
Some networks handle Git over HTTP/2 poorly, causing resets that HTTP/1.1 avoids.
How to fix it
Shrink the transfer
- Use a shallow clone so only recent history is fetched.
- Limit to the single branch the job needs.
git clone --depth 1 --single-branch --branch main https://github.com/org/repo.gitHarden the transport
- Raise the HTTP post buffer for large pushes/pulls.
- Force HTTP/1.1 if HTTP/2 resets are frequent.
git config --global http.postBuffer 524288000
git config --global http.version HTTP/1.1How to prevent it
- Prefer shallow, single-branch clones in CI for large repos. Self-healing managed runners such as Latchkey automatically retry transient clone failures like curl 56 and intermittent registry/transport 5xx blips, so a one-off connection reset does not fail the whole job.