No space left on device in GitHub Actions
"No space left on device" in GitHub Actions means the runner disk filled up mid-job and the next write failed. Find out which of the three shapes you have, bytes, inodes or watchers, then reclaim space before the step that needs it rather than after. The recorded run: the disk is at 100 per cent and the write fails, the runner reclaims space, and the retried step writes the 1.2 GB artifact. The…
When a GitHub Actions job encounters the "No space left on device" error, it indicates that the runner's disk has run out of available space during the execution of a specific step. This issue can arise from various reasons, such as a job writing more data than the available space on the runner, Docker layers and build cache accumulating, or caches being restored onto the same disk as the work being done.
To address this issue, it is crucial to understand the underlying cause by measuring the available disk space and inodes before deleting any files. Run `df -h /` and `df -i /` to determine whether the issue is due to a lack of blocks or inodes. Additionally, use `du` to identify the biggest consumers of disk space and remove them accordingly. Adding similar commands to a failure step will provide evidence for future occurrences.
In some cases, the "No space left on device" error might be caused by inode exhaustion instead of a lack of disk blocks. This type of issue can occur when there are millions of small files, or when running a watch-mode command in CI. In these cases, simply deleting large files will not resolve the problem. Instead, raising the inotify watch limit may be necessary.
To prevent this error from occurring, it is essential to put cleanup steps at the beginning of any Docker-heavy or dataset-heavy job, as well as caching the package manager's store instead of the installed tree. Right-sizing the runner is also recommended, as a machine that is too small may need cleanup as a workaround.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.
This story
This is one outlet's version. Read the fullest account.