{
  "id": "git/gc-lock-file-error",
  "signature": "fatal: Unable to create '.git/objects/pack/pack-abc123.idx.lock': File exists.",
  "signature_zh": "致命错误：无法创建'.git/objects/pack/pack-abc123.idx.lock'：文件已存在。",
  "regex": "fatal: Unable to create '.+\\.lock': File exists\\.",
  "domain": "git",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Another git process (e.g., gc or fetch) is already running and holds the lock file, preventing the current operation from proceeding.",
  "root_cause_type": "generic",
  "root_cause_zh": "另一个git进程（例如gc或fetch）已在运行并持有锁定文件，阻止当前操作继续。",
  "versions": [
    {
      "version": "2.40.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "2.41.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "2.42.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Deleting the .lock file immediately without checking for other processes.",
      "why_fails": "If another git process is still running, deleting the lock file can cause corruption or race conditions.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "Running 'git gc' again to force the lock to be released.",
      "why_fails": "This will likely fail with the same error because the lock is already held. It may also start another gc process, making things worse.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Rebooting the system to clear all processes.",
      "why_fails": "Overkill and unnecessary; a simple process check and kill is sufficient. Also disrupts other work.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Check for running git processes: 'ps aux | grep git'. If found, wait for them to finish or kill them gently (e.g., 'kill <PID>'). Then remove the stale lock file: 'rm -f .git/objects/pack/pack-abc123.idx.lock'.",
      "success_rate": 0.95,
      "how": "Check for running git processes: 'ps aux | grep git'. If found, wait for them to finish or kill them gently (e.g., 'kill <PID>'). Then remove the stale lock file: 'rm -f .git/objects/pack/pack-abc123.idx.lock'.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If no git process is running, the lock file is stale. Remove it: 'rm -f .git/objects/pack/pack-abc123.idx.lock'. Then retry the operation.",
      "success_rate": 0.9,
      "how": "If no git process is running, the lock file is stale. Remove it: 'rm -f .git/objects/pack/pack-abc123.idx.lock'. Then retry the operation.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "检查正在运行的git进程：'ps aux | grep git'。如果找到，等待它们完成或温和地终止（例如'kill <PID>'）。然后删除过时的锁定文件：'rm -f .git/objects/pack/pack-abc123.idx.lock'。",
    "如果没有git进程在运行，则锁定文件已过时。删除它：'rm -f .git/objects/pack/pack-abc123.idx.lock'。然后重试操作。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://git-scm.com/docs/git-gc#Documentation/git-gc.txt",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2024-01-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}