tar Write Error: No Space Left on Device (CI)
A tar write error almost always means the target filesystem ran out of space mid-write.
Disk-full failures are common in CI because runners have modest, shared disks. tar reports them as write errors, and the fix is freeing space, not changing flags.
What it does
When the filesystem holding the output archive (or the extraction target) fills up, the underlying write() call fails with ENOSPC and tar reports a write error, then exits non-zero. The same happens to compressors in the pipeline (gzip, zstd), which report their own no-space errors.
Common usage
df -h . # check free space first
docker system prune -af # reclaim space from images/layers
rm -rf /tmp/* ~/.cache/* # clear caches
tar -czf - dir/ | ssh host 'cat > backup.tgz' # avoid local diskError messages
| Message | Meaning |
|---|---|
| tar: out.tar: Cannot write: No space left on device | Output disk is full |
| tar: Error is not recoverable: exiting now | Fatal write failure, archive incomplete |
| gzip: stdout: No space left on device | Compressor ran out of space |
| zstd: error 70 : Write error : No space left on device | zstd output disk full |
| tar: Cannot write: Broken pipe | Downstream consumer died (often after its disk filled) |
In CI
Hosted runners start with limited free disk and large toolchains. Before a big packaging or cache step, run df -h and reclaim space: docker system prune -af, delete unused language SDKs, or clear ~/.cache. Streaming the archive off-box with | ssh avoids writing it to the runner disk at all.
Common errors in CI
Any No space left on device from tar, gzip, or zstd means the destination is full, not that the command is wrong. The archive left behind is truncated and will later fail extraction with tar: Unexpected EOF in archive. Free space and re-run; do not trust a partial archive produced by a failed write.