{
  "id": "cicd/github-actions-self-hosted-runner-disk-full",
  "signature": "Error: The self-hosted runner encountered a disk space issue: No space left on device",
  "signature_zh": "错误：自托管运行器遇到磁盘空间问题：设备上没有剩余空间",
  "regex": "No space left on device",
  "domain": "cicd",
  "category": "system_error",
  "subcategory": null,
  "root_cause": "Self-hosted GitHub Actions runner has exhausted disk space due to accumulated build artifacts, cached Docker images, or log files",
  "root_cause_type": "generic",
  "root_cause_zh": "自托管 GitHub Actions 运行器因累积的构建产物、缓存的 Docker 镜像或日志文件而耗尽磁盘空间",
  "versions": [
    {
      "version": "GitHub Actions Runner v2.311.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Ubuntu 22.04 LTS",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Increasing runner disk size via cloud provider without cleaning existing files only delays the issue and increases cost",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Manually deleting random files in /tmp may break running workflows or cause permission errors",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Adding more runners without addressing disk cleanup multiplies the problem across the fleet",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "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",
      "success_rate": 0.9,
      "how": "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",
      "condition": "",
      "sources": []
    },
    {
      "action": "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\"'",
      "success_rate": 0.85,
      "how": "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\"'",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use ephemeral runners with auto-scaling that are destroyed after each job to prevent disk accumulation",
      "success_rate": 0.95,
      "how": "Use ephemeral runners with auto-scaling that are destroyed after each job to prevent disk accumulation",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "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",
    "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\"'",
    "Use ephemeral runners with auto-scaling that are destroyed after each job to prevent disk accumulation"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.88,
  "resolvable": "true",
  "first_seen": "2024-01-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}