{
  "id": "pip/vcs-git-clone-permission-denied-public-key",
  "signature": "ERROR: Command errored out with exit status 128: git clone --filter=blob:none 'git@github.com:user/private-repo.git' /tmp/pip-install-xxx/package. Check the logs for full command output. stderr: git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.",
  "signature_zh": "错误：命令以退出状态 128 失败：git clone --filter=blob:none 'git@github.com:user/private-repo.git' /tmp/pip-install-xxx/package。请检查日志以获取完整命令输出。stderr：git@github.com：权限被拒绝（公钥）。致命错误：无法从远程仓库读取。请确保您拥有正确的访问权限并且仓库存在。",
  "regex": "Permission denied \\(publickey\\).*fatal: Could not read from remote repository",
  "domain": "pip",
  "category": "auth_error",
  "subcategory": null,
  "root_cause": "Pip tries to clone a private Git repository via SSH, but the SSH key is not configured or not accepted by the remote server, causing a public key authentication failure.",
  "root_cause_type": "generic",
  "root_cause_zh": "Pip 尝试通过 SSH 克隆私有 Git 仓库，但 SSH 密钥未配置或未被远程服务器接受，导致公钥认证失败。",
  "versions": [
    {
      "version": "pip 23.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "pip 23.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "pip 24.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "git 2.40",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Using pip install with --no-deps to skip VCS dependencies",
      "why_fails": "This only avoids the error for the current install but leaves the missing dependency unresolved, causing import errors later.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "Adding the SSH key to the ssh-agent with ssh-add without checking the key is correct for the repository",
      "why_fails": "If the key is not added to the GitHub account or is the wrong key type, authentication still fails.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "Setting GIT_SSH_COMMAND='ssh -v' to debug but not fixing the underlying key issue",
      "why_fails": "Debugging alone does not resolve the authentication failure.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Generate an SSH key pair and add the public key to your GitHub account: ssh-keygen -t ed25519 -C 'your_email@example.com'; cat ~/.ssh/id_ed25519.pub (copy output); go to GitHub Settings > SSH and GPG keys > New SSH key; paste and save. Then retry pip install.",
      "success_rate": 0.9,
      "how": "Generate an SSH key pair and add the public key to your GitHub account: ssh-keygen -t ed25519 -C 'your_email@example.com'; cat ~/.ssh/id_ed25519.pub (copy output); go to GitHub Settings > SSH and GPG keys > New SSH key; paste and save. Then retry pip install.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use HTTPS instead of SSH for the Git URL in the requirements file: replace git+ssh://git@github.com/user/private-repo.git with git+https://github.com/user/private-repo.git and use a personal access token (PAT) for authentication: pip install git+https://<PAT>@github.com/user/private-repo.git",
      "success_rate": 0.85,
      "how": "Use HTTPS instead of SSH for the Git URL in the requirements file: replace git+ssh://git@github.com/user/private-repo.git with git+https://github.com/user/private-repo.git and use a personal access token (PAT) for authentication: pip install git+https://<PAT>@github.com/user/private-repo.git",
      "condition": "",
      "sources": []
    },
    {
      "action": "If the repository is public, change the URL to use the public HTTPS clone URL without authentication: git+https://github.com/user/public-repo.git",
      "success_rate": 1.0,
      "how": "If the repository is public, change the URL to use the public HTTPS clone URL without authentication: git+https://github.com/user/public-repo.git",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "生成 SSH 密钥对并将公钥添加到您的 GitHub 帐户：ssh-keygen -t ed25519 -C 'your_email@example.com'；cat ~/.ssh/id_ed25519.pub（复制输出）；转到 GitHub 设置 > SSH 和 GPG 密钥 > 新建 SSH 密钥；粘贴并保存。然后重试 pip install。",
    "在 requirements 文件中使用 HTTPS 而不是 SSH 作为 Git URL：将 git+ssh://git@github.com/user/private-repo.git 替换为 git+https://github.com/user/private-repo.git，并使用个人访问令牌（PAT）进行身份验证：pip install git+https://<PAT>@github.com/user/private-repo.git",
    "如果仓库是公开的，将 URL 更改为使用无需身份验证的公共 HTTPS 克隆 URL：git+https://github.com/user/public-repo.git"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://pip.pypa.io/en/stable/topics/vcs-support/",
  "official_doc_section": null,
  "error_code": "ERROR",
  "verification_tier": "ai_generated",
  "confidence": 0.9,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-06-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}