Skip to content
Latchkey

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.

git clone output
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 failed

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

Terminal
git clone --depth 1 https://github.com/org/big-repo.git

Raise the buffer and retry

A larger post buffer helps with truncating proxies, and a bounded retry absorbs transient drops.

Terminal
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
done

How to prevent it

  • Use shallow clones in CI unless full history is genuinely needed.
  • Raise http.postBuffer on runners behind buffering proxies.
  • Cache or mirror very large repositories instead of full-cloning each run.

Frequently asked questions

What causes ""fatal: early EOF""?
Transferring a big pack over a network that stalls or drops cuts the stream before all objects arrive, so index-pack cannot complete.
How do I fix "fatal: early EOF"?
A shallow clone moves a fraction of the data and rarely hits the cutoff.
Can Latchkey fix this automatically?
Yes. Latchkey runs your GitHub Actions on managed runners that detect this failure, apply the fix, and retry the job automatically - self-healing is on by default.

Related guides

References

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