# Error: The self-hosted runner encountered a disk space issue: No space left on device

- **ID:** `cicd/github-actions-self-hosted-runner-disk-full`
- **Domain:** cicd
- **Category:** system_error
- **Verification:** ai_generated
- **Fix Rate:** 88%

## Root Cause

Self-hosted GitHub Actions runner has exhausted disk space due to accumulated build artifacts, cached Docker images, or log files

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| GitHub Actions Runner v2.311.0 | active | — | — |
| Ubuntu 22.04 LTS | active | — | — |

## Workarounds

1. **Add a cleanup cron job on the runner: '0 0 * * * docker system prune -af --volumes && rm -rf /home/runner/_work/* && df -h' to remove unused Docker images and old workspace data nightly** (90% success)
   ```
   Add a cleanup cron job on the runner: '0 0 * * * docker system prune -af --volumes && rm -rf /home/runner/_work/* && df -h' to remove unused Docker images and old workspace data nightly
   ```
2. **Configure a pre-job step in workflows to check disk space and fail early with a message: 'df -h / | tail -1 | awk "{print \$5}" | sed "s/%//" | xargs -I {} sh -c "if [ {} -gt 85 ]; then echo \"Disk usage {}% exceeds 85%\"; exit 1; fi"'** (85% success)
   ```
   Configure a pre-job step in workflows to check disk space and fail early with a message: 'df -h / | tail -1 | awk "{print \$5}" | sed "s/%//" | xargs -I {} sh -c "if [ {} -gt 85 ]; then echo \"Disk usage {}% exceeds 85%\"; exit 1; fi"'
   ```
3. **Use ephemeral runners with auto-scaling that are destroyed after each job to prevent disk accumulation** (95% success)
   ```
   Use ephemeral runners with auto-scaling that are destroyed after each job to prevent disk accumulation
   ```

## Dead Ends

- **** — Increasing runner disk size via cloud provider without cleaning existing files only delays the issue and increases cost (70% fail)
- **** — Manually deleting random files in /tmp may break running workflows or cause permission errors (60% fail)
- **** — Adding more runners without addressing disk cleanup multiplies the problem across the fleet (75% fail)
