Skip to content
Latchkey

"No Space Left on Device" on Bitbucket Pipelines - Causes and Fixes

"No Space Left on Device" is an infrastructure failure, not a bug in your code - here is the Bitbucket Pipelines-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.

Bitbucket Pipelines 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 Bitbucket Pipelines

Add size: 2x for more disk, or use self-hosted runners; build containers have a fixed size.

Write less

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

How to prevent it

  • Right-size Bitbucket Pipelines 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 Bitbucket Pipelines"?
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 Bitbucket Pipelines?
Add size: 2x for more disk, or use self-hosted runners; build containers have a fixed size.
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