Git "fatal: early EOF" / "index-pack failed" on Clone in CI
Git received fewer bytes than the pack header promised, so it could not finish building the index. The transfer was cut short - a large repo over a flaky or buffered link is the usual trigger.
What this error means
A clone gets some way through "Receiving objects" then aborts with fatal: early EOF followed by fatal: index-pack failed. It often fails at a different percentage on each attempt, which points at a transport drop rather than a corrupt repo.
remote: Compressing objects: 100% (84211/84211), done.
remote: Total 482931 (delta 0), reused 482931 (delta 0)
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: index-pack failedCommon causes
A large pack over an unstable connection
Transferring a big pack over a network that stalls or drops cuts the stream before all objects arrive, so index-pack cannot complete.
A proxy with a small buffer or idle timeout
An intermediary that truncates long responses or times out idle streams ends the transfer early, producing the EOF.
How to fix it
Shallow-clone to shrink the transfer
A shallow clone moves a fraction of the data and rarely hits the cutoff.
git clone --depth 1 https://github.com/org/big-repo.gitRaise the buffer and retry
A larger post buffer helps with truncating proxies, and a bounded retry absorbs transient drops.
git config --global http.postBuffer 524288000 # 500 MB
for i in 1 2 3; do
git clone https://github.com/org/big-repo.git && break
sleep 5
doneHow to prevent it
- Use shallow clones in CI unless full history is genuinely needed.
- Raise
http.postBufferon runners behind buffering proxies. - Cache or mirror very large repositories instead of full-cloning each run.