Azure Pipelines "No space left on device" on Agent
By Kaveh Alemi·Latchkey
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
Clean the agent _work folder and prune Docker images and caches.
Enable workspace clean on the job.
azure-pipelines.yml
jobs:- job:buildworkspace:clean:all
Grow the disk
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.