【发布时间】:2018-03-28 07:41:11
【问题描述】:
我在 windows 上运行 Jenkins 并尝试通过 jenkins 从 Git 下载代码,出现以下错误。我尝试使用选项将“其他行为”配置为“高级克隆行为”-“浅克隆”和“克隆和获取操作的超时(以分钟为单位):60”,但作业仍然失败并出现以下错误
检查修订版 c340e8f017689f723b19c2b479d7db7c3e66591d(起源/开发)
c:\programs\Git\bin\git.exe config core.sparsecheckout # timeout=10 c:\programs\Git\bin\git.exe checkout -f c340e8f017689f723b19c2b479d7db7c3e66591d
ERROR: Timeout after 10 minutes
FATAL: Could not checkout c340e8f017689f723b19c2b479d7db7c3e66591d
hudson.plugins.git.GitException: Could not checkout c340e8f017689f723b19c2b479d7db7c3e66591d
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2031)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:152)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:145)
at hudson.remoting.UserRequest.perform(UserRequest.java:120)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:332)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at hudson.remoting.Engine$1$1.run(Engine.java:85)
at java.lang.Thread.run(Unknown Source)
at ......remote call to jenkins10(Native Method)
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1416)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:220)
at hudson.remoting.Channel.call(Channel.java:781)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:145)
at sun.reflect.GeneratedMethodAccessor559.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:131)
at com.sun.proxy.$Proxy58.execute(Unknown Source)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1033)
at hudson.scm.SCM.checkout(SCM.java:485)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1738)
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: Command "c:\programs\Git\bin\git.exe checkout -f c340e8f017689f723b19c2b479d7db7c3e66591d" returned status code -1:
stdout:
stderr:
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1752)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$800(CliGitAPIImpl.java:64)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2023)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:152)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:145)
at hudson.remoting.UserRequest.perform(UserRequest.java:120)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:332)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at hudson.remoting.Engine$1$1.run(Engine.java:85)
at java.lang.Thread.run(Unknown Source)
Finished: FAILURE
【问题讨论】:
-
看起来是 Jenkins 的 github 插件中的一个已知问题。 issues.jenkins-ci.org/browse/JENKINS-26290
-
尝试通过使用 "-Dhudson.plugins.git.GitSCM.verbose=true" 启动 Jenkins 来进行诊断。它将帮助您了解错误的根本原因。
-
@dildeepak :感谢您的回复。我对 jenkins 很陌生,请指导我在哪里可以添加“-Dhudson.plugins.git.GitSCM.verbose=true”参数,这会为该问题提供高级日志记录吗?没找到具体的解决方案,推荐安装最新的Jenkins/Git插件吗,我目前的Git插件是2.3.5。