Skip to content
Latchkey

GitHub Actions "No space left on device" on the Runner

A step failed because the runner ran out of disk. GitHub-hosted runners ship a fixed disk, and preinstalled toolchains plus Docker images and build artifacts can exhaust it during a heavy job.

What this error means

A build, Docker pull, or file-writing step fails with "no space left on device". The error comes from the kernel, so it can surface from many different commands.

Actions log
failed to register layer: write /usr/lib/.../libLLVM.so: no space left on device
# or
ENOSPC: no space left on device, write

Common causes

Large images and build output

Pulling big base images, generating large artifacts, or downloading datasets can fill the runner disk mid-job.

Preinstalled tooling consuming space

Hosted runners come with many preinstalled SDKs and toolchains that occupy several gigabytes you may not need.

How to fix it

Free space at the start of the job

Remove preinstalled tooling you do not use, and prune Docker before the heavy step.

.github/workflows/ci.yml
- name: Free disk space
  run: |
    sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android
    docker image prune --all --force
    df -h

Reduce what the job writes

  1. Use multi-stage Docker builds and a .dockerignore to shrink context.
  2. Clean package caches in the same step that creates them.
  3. Stream large downloads instead of materializing them all on disk.

How to prevent it

  • Add a free-disk-space step to image-heavy jobs.
  • Use a larger runner or a self-hosted host with more disk for big builds.
  • Monitor df -h in CI to catch creeping disk usage.

Frequently asked questions

What causes "Runner out of disk"?
Pulling big base images, generating large artifacts, or downloading datasets can fill the runner disk mid-job.
How do I fix Runner out of disk?
Remove preinstalled tooling you do not use, and prune Docker before the heavy step.
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