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.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →