Skip to content
Latchkey

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.

git
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 EOF

Common 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

  1. Use a shallow clone so only recent history is fetched.
  2. Limit to the single branch the job needs.
Terminal
git clone --depth 1 --single-branch --branch main https://github.com/org/repo.git

Harden the transport

  1. Raise the HTTP post buffer for large pushes/pulls.
  2. Force HTTP/1.1 if HTTP/2 resets are frequent.
Terminal
git config --global http.postBuffer 524288000
git config --global http.version HTTP/1.1

How 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.

Frequently asked questions

What causes ""RPC failed; curl 56 ... HTTP 500""?
A multi-gigabyte history streamed over a flaky or throttled network link is interrupted before the pack finishes.
How do I fix "RPC failed; curl 56 ... HTTP 500"?
Shrink the transfer

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card