"No Space Left on Device" on Jenkins - Causes and Fixes
"No Space Left on Device" is an infrastructure failure, not a bug in your code - here is the Jenkins-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.
Jenkins log
write /var/lib/...: no space left on deviceCommon 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 Jenkins
Use an agent with more disk and add a workspace cleanup (cleanWs()) step; long-lived agents fill up.
Write less
Use multi-stage Docker builds, a .dockerignore, and clean package caches in the same step.
How to prevent it
- Right-size Jenkins 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
Self-Healing CI: Automatic Recovery from "No Space Left on Device"Disk-exhaustion failures are recoverable without a code change. See the manual cleanup and how self-healing C…
Docker "no space left on device" - Causes and FixesWhy Docker builds fail with "no space left on device" in CI, and how to reclaim space, prune layers, and stop…
GitHub-Hosted vs Self-Hosted vs Managed Runners (2026)GitHub-hosted vs self-hosted vs managed GitHub Actions runners compared on cost, speed, maintenance, and reli…