Jenkins Git插件:无法连接到存储库,返回状态码128

ebb*_*fl0 9 git jenkins github-enterprise

我正在尝试克隆一个远程GitHub企业存储库,并在我的Jenkins配置中将我的远程repo的URL添加到Git插件后遇到以下错误:

hudson.plugins.git.GitException: Command "/usr/bin/git -c askpass=true fetch --tags --progress https://github.com/myUsername/myProject.git  refs/heads/*:refs/remotes/origin/*" returned status code 128: stdout: stderr: fatal: unable to access https://github.myOrg.com/myUsername/myProject.git/': Failed to connect to github.com port 443: Operation timed out    at... 
Run Code Online (Sandbox Code Playgroud)

配置细节和我尝试过的事情:

  • Jenkins URL默认为http:// localhost:8080 / (获取警告:"请设置有效的主机名,而不是localhost")
  • 列出的所有依赖项都已安装用于Git插件
  • 我已将git凭据添加到我组织的远程仓库中进行授权
  • 我尝试将我的个人(非企业git帐户)凭据和repo添加到插件中,结果相同
  • 我已将"Git可执行文件路径"设置为'git'和'/ usr/bin/git'
  • 我可以通过命令行和浏览器连接到Git

问题:

  • 我不知何故应该提供身份验证(ssh密钥)只是为了詹金斯使用/克隆我的远程仓库?
  • 为什么Jenkins会抛出保留默认URL的警告?这是否意味着我需要将詹金斯放在除本地机器以外的地方?

我已经对此进行了几天的故障排除,目前还不确定我的问题是什么!请帮忙!!

Dmi*_*kov 5

  1. 关于第一个问题-您需要将正确的ssh密钥与适当的存储库相关联。您可以在 /var/lib/jenkins/.ssh/config文件中进行操作-详细说明在这里,这在支持多个git repos方面是更可靠的解决方案,或者您可以在/.ssh 文件夹中添加正确的ssh键。为了进行故障排除,请尝试在jenkins框内的jenkins用户下执行克隆github存储库。

  2. 关于第二个问题。下面是我的詹金斯网络设置和我没有任何警告信息: /etc/hosts127.0.0.1 localhost localhost.localdomain /etc/sysconfig/networkHOSTNAME=localhost.localdomain。您的主机名和本地主机也应在jenkins服务器中解析。