Jenkins:使用https克隆远程git存储库失败

时间:2016-08-30 08:38:49

标签: git jenkins jenkins-plugins

我正在jenkins中配置我们的项目,以便在从远程https git存储库克隆之后构建。但是在克隆项目期间得到了以下错误。非常感谢帮助解决这个问题。

> git config --local credential.username myusername # timeout=10
> git config --local credential.helper store --file=/Users/Shared/Jenkins/tmp/git4065038663529705946.credentials # timeout=10
> git -c core.askpass=true fetch --tags --progress https://myusername@bitbucket-eng-sjc1.mycompany.com/bitbucket/scm/xxx/myapp.git +refs/heads/*:refs/remotes/origin/*
ERROR: Timeout after 10 minutes
> git config --local --remove-section credential # timeout=10
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "git -c core.askpass=true fetch --tags --progress https://myusername@bitbucket-eng-sjc1.mycompany.com/bitbucket/scm/xxx/myapp.git +refs/heads/*:refs/remotes/origin/*" returned status code 143:
stdout: 
stderr: 
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1740)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1476)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:63)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:314)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:506)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1046)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1086)
at hudson.scm.SCM.checkout(SCM.java:495)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1278)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1720)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
ERROR: null
Finished: FAILURE

2 个答案:

答案 0 :(得分:0)

这是你的问题:ERROR: Timeout after 10 minutes。测试id时间的原因。

测试连接,ping和身份验证。服务器是否允许来自该域/主机名/ ip-range的连接?

答案 1 :(得分:0)

检查系统上是否有任何代理设置。检查环境变量" http_proxy "或" https_proxy "已设定。可能是它设置了 http_proxy 环境变量的情况,这就是您能够从命令行克隆/访问存储库的原因。

如果设置了代理,那么您还需要在jenkins中设置代理。 在

上设置http代理
"Jenkins -> Manage Jenkins -> Manage Plugins -> Advanced Tab".