Jenkins作业失败,原因是:hudson.plugins.git.GitException:checkout -f返回状态码-1

时间:2017-04-07 16:58:36

标签: git jenkins

我在Windows上运行Jenkins并尝试通过jenkins从Git下载代码,发生以下错误。我尝试配置"附加行为"推进克隆行为'选项 - '浅层克隆'和克隆和获取操作的超时(以分钟为单位):60'但仍然失败的工作是以下错误

检查修订版c340e8f017689f723b19c2b479d7db7c3e66591d(origin / develop)

  

c:\ programs \ Git \ bin \ git.exe config core.sparsecheckout #timetime = 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

1 个答案:

答案 0 :(得分:0)

我跟着@dildeepak建议,我发现我的问题是git抱怨长文件名。

annotate("text", x=-0.25, y=seq(1,length(Rwdecs), 1), label=Rc, color="blue", 
    size=2.25)+ #http://ggplot2.tidyverse.org/reference/annotate.html
annotate("text", x=Vwscale, y=0.5, label=Vc, color="blue", size=2.25)+
  if(Rw>0){scale_y_discrete(labels=Rwdecs)
  } else{theme(axis.title.y=element_blank(),
               axis.text.y=element_blank(),
               axis.ticks.y=element_blank())}+
  if(Rw>0){scale_x_discrete(labels=Vw)
  } else{theme(axis.title.x=element_blank(),
               axis.text.x=element_blank(),
               axis.ticks.x=element_blank())}

要了解问题的根本原因,请执行以下操作

  

停止詹金斯

修改

stdout: 
stderr: error: unable to create file Referenced Packages/CloudSense Contract Lifecycle Management Data Model/layouts/Document_Template_Section_Association__c-Document Template%2FSection Association 
Layout.layout: Filename too long

JENKINS_INSTALL_FOLDER/jenkins.xml 添加到-Dhudson.plugins.git.GitSCM.verbose=true代码

<arguments>
  

启动Jenkins

现在运行您的构建作业,并查看控制台输出以获取更详细的错误消息。你会发现根本原因。