GitLab CI "no space left on device" - Runner Disk Exhausted
By Kaveh Alemi·Latchkey
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 device
Common 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 -h
Prevent buildup automatically
Schedule periodic docker system prune and cache cleanup on persistent runners.
Prefer ephemeral runners (autoscaling/Kubernetes) that start with a clean disk.
Set expire_in on 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.
Frequently asked questions
What causes ""no space left on device""?
Each job leaves caches and build directories. Without cleanup, a persistent runner’s disk slowly fills until writes fail.
How do I fix "no space left on device"?
Reclaim disk on the runner
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.