Skip to content
Latchkey

CI "gzip: stdout: No space left on device" - Disk Full While Compressing

gzip could not write its compressed output because the destination disk is full. The write target - often an artifact tarball or a piped file - ran out of space mid-stream, so gzip aborted.

What this error means

A compression step fails with gzip: stdout: No space left on device, frequently while producing a .tar.gz artifact or log bundle. The output file is left truncated. df -h confirms the target filesystem is at 100%.

CI log
tar -czf artifact.tar.gz ./build
gzip: stdout: No space left on device
tar: artifact.tar.gz: Cannot write: Broken pipe

Common causes

The compressed output has nowhere to land

Even though compression shrinks data, the output still needs disk. If the source already nearly fills the volume, writing the archive alongside it exhausts the remaining space.

The disk was already near full from caches/artifacts

Prior build output, caches, and artifacts left little headroom, so the compression write is what crosses the line.

How to fix it

Check and reclaim disk

Confirm the full filesystem, then free space.

Terminal
df -h
du -sh ./* 2>/dev/null | sort -rh | head
docker system prune -af --volumes

Write the archive to a roomier volume

  1. Direct the output to a path on a larger disk (e.g. the runner temp/scratch volume).
  2. Compress in chunks or exclude large unneeded paths so the output is smaller.
  3. Delete the source tree after archiving if both share a near-full disk.

How to prevent it

  • Write artifacts to a volume sized for source plus compressed output.
  • Trim what you archive so outputs stay small.
  • Watch disk usage before artifact/compression steps on reused runners.

Frequently asked questions

What causes ""gzip: stdout: No space left on device""?
Even though compression shrinks data, the output still needs disk. If the source already nearly fills the volume, writing the archive alongside it exhausts the remaining space.
How do I fix "gzip: stdout: No space left on device"?
Confirm the full filesystem, then free space.
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