{
  "id": "pip/git-clone-ssh-key-error",
  "signature": "ERROR: Command errored out with exit status 128: git clone --filter=blob:none 'git@github.com:user/private-repo.git' /tmp/pip-req-build-xxxxx\n  stderr: Cloning into '/tmp/pip-req-build-xxxxx'...\n  git@github.com: Permission denied (publickey).\n  fatal: Could not read from remote repository.",
  "signature_zh": "错误：命令以退出状态 128 出错：git clone --filter=blob:none 'git@github.com:user/private-repo.git' /tmp/pip-req-build-xxxxx\n  stderr: 克隆到 '/tmp/pip-req-build-xxxxx'...\n  git@github.com: 权限被拒绝 (publickey)。\n  fatal: 无法从远程仓库读取。",
  "regex": "ERROR: Command errored out with exit status 128: git clone.*\\n\\s+stderr:.*Permission denied \\(publickey\\)\\.\\n\\s+fatal: Could not read from remote repository\\.",
  "domain": "pip",
  "category": "auth_error",
  "subcategory": null,
  "root_cause": "pip attempts to clone a private Git repository via SSH but the SSH agent lacks the correct private key or the key is not added to the SSH agent, resulting in 'Permission denied (publickey)'.",
  "root_cause_type": "generic",
  "root_cause_zh": "pip 尝试通过 SSH 克隆私有 Git 仓库，但 SSH 代理缺少正确的私钥或密钥未添加到 SSH 代理，导致 '权限被拒绝 (publickey)'。",
  "versions": [
    {
      "version": "pip 24.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Git 2.43",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Python 3.12",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Running 'pip install --upgrade pip' does not affect SSH key authentication; the error is in Git, not pip.",
      "fail_rate": 0.98,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Setting PIP_REQUIRE_VIRTUALENV has no effect on Git authentication.",
      "fail_rate": 0.99,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Using 'git config --global url.\"https://github.com/\".insteadOf \"git@github.com:\"' may work for public repos but fails for private repos that need SSH key auth.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Add the SSH private key to the agent: 'ssh-add ~/.ssh/id_ed25519' (or appropriate key file). Then retry pip install.",
      "success_rate": 0.85,
      "how": "Add the SSH private key to the agent: 'ssh-add ~/.ssh/id_ed25519' (or appropriate key file). Then retry pip install.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use HTTPS with personal access token: pip install git+https://<token>@github.com/user/private-repo.git",
      "success_rate": 0.95,
      "how": "Use HTTPS with personal access token: pip install git+https://<token>@github.com/user/private-repo.git",
      "condition": "",
      "sources": []
    },
    {
      "action": "Configure pip to use SSH with a different key by setting GIT_SSH_COMMAND: 'GIT_SSH_COMMAND=\"ssh -i ~/.ssh/custom_key\" pip install git+ssh://git@github.com/user/private-repo.git'",
      "success_rate": 0.8,
      "how": "Configure pip to use SSH with a different key by setting GIT_SSH_COMMAND: 'GIT_SSH_COMMAND=\"ssh -i ~/.ssh/custom_key\" pip install git+ssh://git@github.com/user/private-repo.git'",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "将 SSH 私钥添加到代理：'ssh-add ~/.ssh/id_ed25519'（或相应的密钥文件）。然后重试 pip install。",
    "使用带有个人访问令牌的 HTTPS：pip install git+https://<token>@github.com/user/private-repo.git",
    "通过设置 GIT_SSH_COMMAND 配置 pip 使用不同的 SSH 密钥：'GIT_SSH_COMMAND=\"ssh -i ~/.ssh/custom_key\" pip install git+ssh://git@github.com/user/private-repo.git'"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://pip.pypa.io/en/stable/topics/vcs-support/#git",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.9,
  "fix_success_rate": 0.88,
  "resolvable": "partial",
  "first_seen": "2024-01-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}