GitLab CI "no space left on device" during job in CI
A write failed because the runner ran out of disk. Builds accumulate Docker layers, caches, cloned repos, and artifacts; when the volume fills, any write (checkout, build, upload) fails with ENOSPC.
What this error means
A step fails with "no space left on device" or "write /...: no space left on device", sometimes during checkout, build, or artifact upload.
fatal: write error: No space left on device
ERROR: Job failed: exit code 1Common causes
Accumulated Docker images and build caches
On a long-lived runner host, old images, layers, and caches fill the disk over time.
A large build or artifact for a small volume
A build that writes many gigabytes (or a big artifact archive) outgrows an undersized runner volume.
How to fix it
Reclaim disk on the runner host
- Prune unused Docker data and old caches.
- Schedule periodic cleanup so the disk does not refill.
- Re-run the job.
docker system prune -af --volumes
df -hProvision a larger volume or trim the build
Increase the runner disk, or reduce what the build writes (shallow clone, fewer cached paths, smaller artifacts).
variables:
GIT_DEPTH: "20"How to prevent it
- Prune Docker and cache data on runner hosts on a schedule.
- Size runner volumes for your largest builds.
- Use shallow clones and lean artifacts to limit disk use.