Skip to content
Latchkey

"No Space Left on Device" on GitLab CI - Causes and Fixes

"No Space Left on Device" is an infrastructure failure, not a bug in your code - here is the GitLab CI-specific fix.

What this error means

A job fails mid-run with no space left on device, usually while writing a file, extracting a layer, or caching. The runner disk filled up.

GitLab CI log
write /var/lib/...: no space left on device

Common causes

Accumulated Docker layers and caches

Image layers, build cache, and temp files build up and exhaust the disk, especially on reused runners.

A small runner disk

Default runners ship with limited free disk; a build that needs more transient space fails.

How to fix it

Reclaim space on GitLab CI

Use a runner with a larger disk and prune Docker between jobs; the Docker executor accumulates layers.

Write less

Use multi-stage Docker builds, a .dockerignore, and clean package caches in the same step.

How to prevent it

  • Right-size GitLab CI runners/agents for the job.
  • Cache dependencies to cut time, memory pressure, and network calls.
  • Use self-healing runners that retry transient and mechanical failures automatically.

Frequently asked questions

What causes "No space left on GitLab CI"?
Image layers, build cache, and temp files build up and exhaust the disk, especially on reused runners.
How do I fix No space left on GitLab CI?
Use a runner with a larger disk and prune Docker between jobs; the Docker executor accumulates layers.
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.

Related guides

References

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