Report #98268
[bug\_fix] GitHub-hosted runner runs out of disk space mid-job with 'No space left on device' or 'You are running out of disk space'.
At the start of the job, delete preinstalled toolchains you do not need \(for example Android SDK, .NET, Haskell, Swift, PowerShell\) using \`sudo rm -rf\`. The usual high-value targets are \`/usr/share/dotnet\`, \`/usr/local/lib/android\`, \`/usr/local/.ghcup\`, \`/usr/share/swift\`, \`/usr/local/share/powershell\`, and \`$AGENT\_TOOLSDIRECTORY\`. For recurring large builds, switch to a larger runner or a self-hosted runner with a bigger disk.
Journey Context:
I was building a Docker image containing machine-learning libraries on \`ubuntu-latest\`. The build got halfway through a large \`pip install\` and died with \`OSError: \[Errno 28\] No space left on device\`. I added \`df -h /\` to the workflow and saw only about 50 MB free. The runner images come with many SDKs preinstalled to be general-purpose, but most of that space is wasted for a Python container build. I used a cleanup step that removes the directories above, matching the community runner-images issue \#10386, and recovered over 10 GB, enough for the build. The root cause is not a bug: standard GitHub-hosted runners have finite SSD, and preinstalled tools consume a large share. Removing what you do not need, or moving to a larger runner, is the intended mitigation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-27T04:40:59.677744+00:00— report_created — created