{
  "id": "git/error-failed-to-run-maintenance",
  "signature": "error: failed to run maintenance: could not create temporary file: Permission denied",
  "signature_zh": "错误：运行维护失败：无法创建临时文件：权限被拒绝",
  "regex": "error: failed to run maintenance: could not create temporary file: Permission denied",
  "domain": "git",
  "category": "system_error",
  "subcategory": null,
  "root_cause": "Git's background maintenance tasks (like gc or commit-graph write) cannot create temporary files in the repository's object directory due to insufficient filesystem permissions or disk space.",
  "root_cause_type": "generic",
  "root_cause_zh": "Git 的后台维护任务（如 gc 或 commit-graph write）无法在仓库的对象目录中创建临时文件，原因是文件系统权限不足或磁盘空间不足。",
  "versions": [
    {
      "version": "git 2.31.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "git 2.40.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "git 2.44.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Running git gc manually without addressing permission issues will fail with the same error because gc also needs to create temp files.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Changing ownership of .git/objects to root with chown -R root:root can break other git operations and is not a proper fix.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "chmod -R u+w .git/objects  # Grant write permission to the objects directory for the current user",
      "success_rate": 0.85,
      "how": "chmod -R u+w .git/objects  # Grant write permission to the objects directory for the current user",
      "condition": "",
      "sources": []
    },
    {
      "action": "df -h && du -sh .git  # Check disk space; if full, free up space by removing large files or running git maintenance stop to disable auto-maintenance",
      "success_rate": 0.75,
      "how": "df -h && du -sh .git  # Check disk space; if full, free up space by removing large files or running git maintenance stop to disable auto-maintenance",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "chmod -R u+w .git/objects  # Grant write permission to the objects directory for the current user",
    "df -h && du -sh .git  # Check disk space; if full, free up space by removing large files or running git maintenance stop to disable auto-maintenance"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://git-scm.com/docs/git-maintenance",
  "official_doc_section": null,
  "error_code": "EACCES",
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2024-03-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}