Skip to content
Latchkey

Azure Pipelines "No space left on device" on Agent

The agent ran out of disk while writing build outputs, caches, or artifacts, so a step failed with No space left on device.

What this error means

A step fails with "No space left on device" during checkout, restore, build, or publish. Self-hosted agents keep failing until space is reclaimed.

azure-pipelines
##[error]ENOSPC: no space left on device, write
##[error]Bash exited with code '1'.

Common causes

Accumulated caches and work folders

Self-hosted agents keep stale _work directories and caches that fill the disk.

Large build output

A build produces more data than the agent disk holds.

Undersized agent volume

The agent disk is too small for the workload.

How to fix it

Reclaim disk on the agent

  1. Clean the agent _work folder and prune Docker images and caches.
  2. Enable workspace clean on the job.
azure-pipelines.yml
jobs:
  - job: build
    workspace:
      clean: all

Grow the disk

  1. Increase the agent volume or use a larger agent.

How to prevent it

  • If you run on GitHub Actions, self-healing managed runners such as Latchkey auto-retry transient failures and provision fresh runners, avoiding accumulated disk pressure. On Azure DevOps, clean work folders and monitor agent disk.

Frequently asked questions

What causes ""No space left on device""?
Self-hosted agents keep stale _work directories and caches that fill the disk.
How do I fix "No space left on device"?
Reclaim disk on the agent

Related guides

References

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