简体   繁体   English

在特定数量的提取后,Jenkins 的 Git 插件在“git reset --hard”中失败

[英]Git Plugin with Jenkins is failing in "git reset --hard" after particular number of fetches

After upgrade of jenkins and git plugins, we are facing the below issues,升级 jenkins 和 git 插件后,我们面临以下问题,

Jenkins version - 2.190.3 Git plugin in jenkins - 4.0.0 git change log - 2.21 Git client - 3.0.0 Jenkins 版本 - jenkins 中的 2.190.3 Git 插件 - 4.0.0 git 更改日志 - 2.21 Git 客户端 - 3.0.0

I am using jenkins share library我正在使用 jenkins 共享库

Once this issue happens, it will never checkout till we clean up the workspace.一旦发生此问题,在我们清理工作区之前,它永远不会结帐。 After every couple of runs, this happens and keeps failing after that.每隔几次运行后,就会发生这种情况,并在此之后不断失败。 Log is below.日志如下。 Please see if this is something already known.请看看这是否是已知的。

What i have tried for this is, I tried continous runs and tried increasing timeouts from git client side.我为此尝试过的是,我尝试了连续运行并尝试从 git 客户端增加超时。 ALso tried to check if there is any issue with commits, Things seem to be normal.还尝试检查提交是否有任何问题,事情似乎很正常。 Console log of Jenkins Pipeline is below. Jenkins Pipeline 的控制台日志如下。

git rev-parse --is-inside-work-tree # timeout=10
Setting origin to ssh://<XXXX>@gerrit.ext.net.<XXXX>.com:29418/FNMS/ee-environment
 > git config remote.origin.url ssh://<XXXX>@gerrit.ext.net.<XXXX>.com:29418/FNMS/ee-environment # timeout=10
Seen 1,117 remote branches
Obtained pipeline/Altiplano-SuperFB/Jenkinsfile from 9a9ecac103bb02f5882d44c94332ea9fa667699f
Running in Durability level: PERFORMANCE_OPTIMIZED
Loading library jenkins-shared-library@master
Attempting to resolve master from remote references...
 > git --version # timeout=10
 > git ls-remote -h ssh://<XXXX>@gerrit.ext.net.<XXXX>.com:29418/FNMS/jenkin-common-lib # timeout=10
Found match: refs/heads/master revision 47e77fb305c3f39cb83dc5d3b382ced2e6a3871b
No credentials specified
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url ssh://<XXXX>@gerrit.ext.net.<XXXX>.com:29418/FNMS/jenkin-common-lib # timeout=10
Cleaning workspace
 > git rev-parse --verify HEAD # timeout=10
Resetting working tree
 > git reset --hard # timeout=10
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from ssh://<XXXX>@gerrit.ext.net.<XXXX>.com:29418/FNMS/jenkin-common-lib
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:899)
    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1114)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1145)
    at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:124)
    at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.lambda$doRetrieve$1(SCMSourceRetriever.java:154)
    at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.retrySCMOperation(SCMSourceRetriever.java:104)
    at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.doRetrieve(SCMSourceRetriever.java:153)
    at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.retrieve(SCMSourceRetriever.java:93)
    at org.jenkinsci.plugins.workflow.libs.LibraryAdder.retrieve(LibraryAdder.java:157)
    at org.jenkinsci.plugins.workflow.libs.LibraryAdder.add(LibraryAdder.java:138)
    at org.jenkinsci.plugins.workflow.libs.LibraryDecorator$1.call(LibraryDecorator.java:125)
    at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1065)
    at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603)
    at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
    at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
    at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
    at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
    at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
    at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:142)
    at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:127)
    at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:561)
    at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:522)
    at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:327)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:429)
Caused by: hudson.plugins.git.GitException: Command "git reset --hard" returned status code 128:
stdout: 
stderr: fatal: unable to read tree 6a23ff423d86f1b9e8e9649f136a99da90f1ef44

    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2372)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2302)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2298)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1857)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.reset(CliGitAPIImpl.java:625)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.clean(CliGitAPIImpl.java:972)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.clean(CliGitAPIImpl.java:987)
    at hudson.plugins.git.GitAPI.clean(GitAPI.java:311)
    at hudson.plugins.git.extensions.impl.CleanBeforeCheckout.decorateFetchCommand(CleanBeforeCheckout.java:30)
    at hudson.plugins.git.extensions.GitSCMExtension.decorateFetchCommand(GitSCMExtension.java:288)
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:895)
    ... 25 more
ERROR: Error fetching remote repo 'origin'
ERROR: Maximum checkout retry attempts reached, aborting
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: Loading libraries failed

1 error

    at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)
    at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1085)
    at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603)
    at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
    at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
    at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
    at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
    at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
    at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:142)
    at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:127)
    at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:561)
    at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:522)
    at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:327)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE

Answer from that post helped me: https://stackoverflow.com/a/47783130/2483702 .那篇文章的回答对我有帮助: https : //stackoverflow.com/a/47783130/2483702 You have to wipe out repository and clone again.您必须清除存储库并再次克隆。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM