Jenkins执行git命令时出错 [英] Jenkins error performing git command

查看:321
本文介绍了Jenkins执行git命令时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试构建时出现以下错误:

Getting the following error while trying to build:

Building in workspace F:\BuildSource\SeleniumHTTPMonitoring
 > F:\soft\Git\bin\git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > F:\soft\Git\bin\git.exe config remote.origin.url https://bitbucket.mycompany.io/scm/oi/seleniumhttpmonitoring.git # timeout=10
Fetching upstream changes from https://bitbucket.mycompany.io/scm/oi/seleniumhttpmonitoring.git
 > F:\soft\Git\bin\git.exe --version # timeout=10
using .gitcredentials to set credentials
 > F:\soft\Git\bin\git.exe config --local credential.username master.builder # timeout=10
 > F:\soft\Git\bin\git.exe config --local credential.helper store --file=\"C:\Windows\TEMP\git1527457549107748901.credentials\" # timeout=10
 > F:\soft\Git\bin\git.exe -c core.askpass=true fetch --tags --progress https://bitbucket.mycompany.io/scm/oi/seleniumhttpmonitoring.git +refs/heads/*:refs/remotes/origin/*

 > F:\soft\Git\bin\git.exe config --local --remove-section credential # timeout=10
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from https://bitbucket.mycompany.io/scm/oi/seleniumhttpmonitoring.git
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:799)
    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1055)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1086)
    at hudson.scm.SCM.checkout(SCM.java:485)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
    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:1741)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:410)
Caused by: hudson.plugins.git.GitException: Error performing git command
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1751)
    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 hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:797)
    ... 11 more
Caused by: org.jvnet.winp.WinpException: Failed to read environment variable table error=299 at .\envvar-cmdline.cpp:201
    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$Windows$1.getArguments(ProcessTree.java:441)
    at hudson.plugins.msbuild.MsBuildKillingVeto.vetoProcessKilling(MsBuildKillingVeto.java:55)
    at hudson.util.ProcessTree$OSProcess.getVeto(ProcessTree.java:239)
    at hudson.util.ProcessTree$Windows$1.killRecursively(ProcessTree.java:422)
    at hudson.util.ProcessTree.killAll(ProcessTree.java:142)
    at hudson.Proc$LocalProc.destroy(Proc.java:375)
    at hudson.Proc$LocalProc.join(Proc.java:348)
    at hudson.Proc.joinWithTimeout(Proc.java:164)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1736)
    ... 15 more
ERROR: null

Jenkins 2.7.1在Windows Server 2012 R2上运行(在Jenkins 2.7.4上发生了相同的错误).我可以通过git命令行克隆仓库,没有任何问题.发生这种情况时,我可以在任务管理器屏幕截图中看到多个git进程树,如果我等待一段时间后,我会在Jenkins中看到.

Jenkins 2.7.1 is running on Windows Server 2012 R2 (the same error was occurring on Jenkins 2.7.4). I can clone the repo via git command line without any problems. When this happens I can see multiple git processes trees in task manager Screenshot and if I wait for a while I will see this in Jenkins.

推荐答案

罪魁祸首是Git插件.更新后它开始工作. 我使用的是2.5.3版本.

The culprit was Git plugin. It started working after update. I was using 2.5.3 version.

这篇关于Jenkins执行git命令时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆