gpt4 book ai didi

Jenkins 无法连接到存储库

转载 作者:行者123 更新时间:2023-12-04 19:30:08 25 4
gpt4 key购买 nike

我正在尝试将 Jenkins 连接到私有(private) BitBucket 存储库。

我有一组(id_rsa 和 id_rsa.pub)在 /var/lib/jenkins/.ssh 处生成的 SSH key .我复制了id_rsa.pub key 并将其粘贴到我的 BitBucket 存储库的部署 key 部分。同样,运行命令 git ls-remote -h git@bitbucket.org:user/project.git有一个有效的返回,并已添加到 known_hosts .

什么可能导致我的 Jenkins 无法连接到 Jenkins 的 git 源代码管理部分?返回的错误是:

Failed to connect to repository : Command "git -c core.askpass=true ls-remote -h https://git@bitbucket.org/user/project.git HEAD" returned status code 128: stdout: stderr: remote: Invalid username or password. If you log in via a third party service you must ensure you have an account password set in your account profile. fatal: Authentication failed for 'https://git@bitbucket.org/user/project.git/'



我也试过 ssh -Tv git@bitbucket.org根据 this doc来自 Atlassian 关于解决 SSH 问题的信息。退货说明:

This deploy key has read access to the following repositories:

user/project: Jenkins -- jenkins@ip-xxx-xx-xx-xxx

最佳答案

对于 Jenkins 的 Git Plugin 的 Project Repository 字段提供,似乎他们的主页中显示的该字段的示例之一(特别是 https://git@bitbucket.org/user/project.git )不起作用。这可能是插件版本的情况,或者 BitBucket 的配置方式可能与 GitHub 不同,他们的文档使用 GitHub 作为示例。

然而,对我有用的是使用以下格式的 git 地址:

git@bitbucket.org:user/project.git

关于Jenkins 无法连接到存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36403694/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com