Skip to content
Latchkey

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.

GitLab Runner
fatal: write error: No space left on device
ERROR: Job failed: exit code 1

Common 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

  1. Prune unused Docker data and old caches.
  2. Schedule periodic cleanup so the disk does not refill.
  3. Re-run the job.
Terminal
docker system prune -af --volumes
df -h

Provision a larger volume or trim the build

Increase the runner disk, or reduce what the build writes (shallow clone, fewer cached paths, smaller artifacts).

.gitlab-ci.yml
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.

Frequently asked questions

What causes ""no space left on device""?
On a long-lived runner host, old images, layers, and caches fill the disk over time.
How do I fix "no space left on device"?
Reclaim disk on the runner host

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card