GitLab CI "no space left on device" - Runner Disk Exhausted
A write failed because the runner host or container ran out of disk. On long-lived runners this accumulates from cached layers, build dirs, and old artifacts that are never pruned.
What this error means
A step fails with "no space left on device" - often during checkout, dependency install, or docker build. It commonly affects one busy runner while others are fine, and clears after cleanup.
Job log
fatal: cannot create directory at 'node_modules': No space left on device
# or
write /var/lib/docker/tmp/...: no space left on deviceCommon causes
Build/cache buildup on a long-lived runner
Each job leaves caches and build directories. Without cleanup, a persistent runner’s disk slowly fills until writes fail.
Dangling Docker images and volumes
On a dind or socket runner, old layers, stopped containers, and anonymous volumes consume the bulk of the disk over time.
How to fix it
Reclaim disk on the runner
Runner host
docker system prune -af --volumes
sudo gitlab-runner cache-clear # if using local cache
df -hPrevent buildup automatically
- Schedule periodic
docker system pruneand cache cleanup on persistent runners. - Prefer ephemeral runners (autoscaling/Kubernetes) that start with a clean disk.
- Set
expire_inon artifacts and bound cache size so storage stays in check.
How to prevent it
- Use ephemeral runners or schedule disk cleanup on persistent ones.
- Prune Docker images/volumes regularly on dind hosts.
- Cap cache size and set artifact
expire_in.
Related guides
GitLab CI Cache Not Restored - "Successfully extracted cache" MissingFix GitLab CI cache misses - dependencies reinstall every run because the cache key changes, the policy is pu…
GitLab CI "Artifact is too large" / Upload RejectedFix GitLab CI "too large archive" / "413 Request Entity Too Large" artifact uploads - exceeding the max artif…
GitLab "Job failed (system failure): preparing environment"Fix GitLab "ERROR: Job failed (system failure): preparing environment" - a runner-side failure setting up the…