【问题标题】:Jenkins is not able to pull code from private bitbucket cloud repoJenkins 无法从私有 bitbucket 云存储库中提取代码
【发布时间】:2017-12-01 00:15:03
【问题描述】:

我正在尝试将 bitbucket 私人仓库连接到 jenkins。我在 Bitbucket 中设置了一个 webhook。以及向 Jenkins 添加凭据。我的构建仍然卡住,无法从 Bitbucket 中提取源代码。 我知道它只在私人仓库中,因为我试图与公共 bitbucket 仓库连接并且它工作得很好。

这是我在 jenkins 中遇到的错误

ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from https://xxxx@bitbucket.org/xxxxx/test2.git
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:809)
    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1076)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1107)
    at hudson.scm.SCM.checkout(SCM.java:495)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1281)
    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: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: Error performing git command
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1886)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1596)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:71)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:348)
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:807)
    ... 11 more
Caused by: org.jvnet.winp.WinpException: Failed to read RT_USER_PROCESS_PARAMETERS error=299 at envvar-cmdline.cpp:151
    at org.jvnet.winp.Native.getCmdLineAndEnvVars(Native Method)
    at org.jvnet.winp.WinProcess.parseCmdLineAndEnvVars(WinProcess.java:126)
    at org.jvnet.winp.WinProcess.getCommandLine(WinProcess.java:102)
    at hudson.util.ProcessTree$WindowsOSProcess.getArguments(ProcessTree.java:451)
    at hudson.plugins.msbuild.MsBuildKillingVeto.vetoProcessKilling(MsBuildKillingVeto.java:56)
    at hudson.util.ProcessTree$OSProcess.getVeto(ProcessTree.java:243)
    at hudson.util.ProcessTree$WindowsOSProcess.killRecursively(ProcessTree.java:429)
    at hudson.util.ProcessTree.killAll(ProcessTree.java:146)
    at hudson.Proc$LocalProc.destroy(Proc.java:380)
    at hudson.Proc$LocalProc.join(Proc.java:353)
    at hudson.Proc.joinWithTimeout(Proc.java:166)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1873)
    ... 15 more
ERROR: null
Finished: FAILURE

进一步研究:

1) 我能够运行相同的命令 (C:\Program Files\Git\bin\git.exe fetch --tags --progress https://xxx@bitbucket.org/xxx/test.git +refs/heads/:refs/remotes/ release/) 在同一位置(Jenkins 工作区) - 它正在成功获取远程仓库。

2) Jenkins 能够获取和下载公共 repo 内容。

3) 这是第一次设置所有更新的插件,

Git 插件 - 3.3.1 Git 客户端插件 - 2.4.6 凭据插件 - 2.1.13
詹金斯 - 2.59

我想不出还有什么,因为詹金斯无法运行命令?

有人可以帮忙吗!

【问题讨论】:

    标签: git jenkins bitbucket


    【解决方案1】:

    可能失败的事情清单:

    编辑:

    • 解决方案:您是否尝试过使用不同的存储库?

    【讨论】:

    • 我正在使用 Git 插件 3.3.0 和凭据插件 2.1.13。我确定密码是正确的,因为我多次更新密码以确保它。我的密码“括号”中有特殊字符。你认为这可能是问题吗?
    • 我已经更新了我的回购密码并删除了特殊字符。仍然出现同样的错误。
    • 我尝试过使用 http 和 ssh。得到同样的错误。我第一次尝试这个设置。所以,第一次使用这个插件。 Jenkins 版本 - 2.59,Git 插件 - 3.3.0 和 Credntials 插件 - 2.1.13
    • 你更新了git客户端版本了吗? wiki.jenkins.io/display/JENKINS/Git+Client+Plugin
    • 如果您在工作中使用 git 做事,我刚刚提到了 Git 客户端。您可以尝试在 bitbucket 中创建一个新的私有仓库(一个空的,可能只有一个文件)并从那里获取吗?
    猜你喜欢
    • 2021-03-06
    • 1970-01-01
    • 2015-11-15
    • 2017-07-05
    • 2016-10-13
    • 1970-01-01
    • 2020-01-14
    • 2019-05-12
    • 1970-01-01
    相关资源
    最近更新 更多