Jenkins无法连接到Bitbucket云

时间:2017-09-06 05:56:25

标签: git jenkins bitbucket jenkins-plugins

我正在Jenkins设置项目,我必须从bitbucket云中提取代码。

我在Jenkins看到错误。事情是詹金斯无法连接到bitbucket云。

环境
詹金斯:内部托管; http://jenkinsserver:8080
Bitbucket云:https://bitbucket.org/
Git插件版本:3.5.1

Jenkins的日志

Started by user admin
[EnvInject] - Loading node environment variables.
Building in workspace /var/lib/jenkins/workspace/AccessbitbucketCloud
 > /opt/git/git-2.14.1/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > /opt/git/git-2.14.1/git config remote.origin.url https://bitbucket.org/myid/testpublicrepo.git # timeout=10
Fetching upstream changes from https://bitbucket.org/myid/testpublicrepo.git
 > /opt/git/git-2.14.1/git --version # timeout=10
using GIT_ASKPASS to set credentials For bitbucket Cloud
Setting http proxy: jenkinsserver:8080
 > /opt/git/git-2.14.1/git fetch --tags --progress https://bitbucket.org/myid/testpublicrepo.git +refs/heads/*:refs/remotes/origin/*
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from https://bitbucket.org/myid/testpublicrepo.git
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:817)
    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1084)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1115)
    at hudson.scm.SCM.checkout(SCM.java:495)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1276)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:560)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:485)
    at hudson.model.Run.execute(Run.java:1735)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:405)
Caused by: hudson.plugins.git.GitException: Command "/opt/git/git-2.14.1/git fetch --tags --progress https://bitbucket.org/myid/testpublicrepo.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout: 
stderr: fatal: unable to access 'https://bitbucket.org/myid/testpublicrepo.git/': Received HTTP code 407 from proxy after CONNECT

    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1924)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1643)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:71)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:352)
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:815)
    ... 11 more
ERROR: Error fetching remote repo 'origin'
Finished: FAILURE

1 个答案:

答案 0 :(得分:0)

看起来您正在使用代理连接到Bitbucket云。您是否尝试在jenkins服务器上执行此存储库的git克隆(使用命令行shell)?

  

stderr:致命:无法访问“https://bitbucket.org/myid/testpublicrepo.git/”:在CONNECT之后从代理收到HTTP代码407

看起来代理无法连接到bitbucket云。 HTTP 407是代理身份验证错误。 This是一个关于jenkins代理的git连接的好主题。