Jenkins-多分支管道中的git问题

时间:2019-05-07 00:58:14

标签: jenkins gitlab jenkins-pipeline multibranch-pipeline

我使用Helm图表在kubernetes中安装了詹金斯。

我用MultibranhPipeline创建一些任务。

在所有任务中执行了几次后,我收到以下错误:

Started by user admin
 > git rev-parse --is-inside-work-tree # timeout=10
Setting origin to git@10.12.22.25:trayectorias-educativas/gateway-service.git
 > git config remote.origin.url git@10.12.22.25:trayectorias-educativas/gateway-service.git # timeout=10
Fetching origin...
Fetching upstream changes from origin
 > git --version # timeout=10
 > git config --get remote.origin.url # timeout=10
using GIT_SSH to set credentials codicengit-ssh-key
 > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
hudson.plugins.git.GitException: Command "git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*" returned status code 255:
stdout: 
stderr: error: cannot open .git/FETCH_HEAD: Invalid argument

    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2042)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1761)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$400(CliGitAPIImpl.java:72)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:442)
    at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:365)
    at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:325)
    at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:391)
    at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582)
    at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:98)
    at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:293)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE

我尝试:

  • 更改初始化任务的方法(从gitlab推送,jenkins检查 每1分钟并手动进行一次)
  • 多次删除并重新创建任务

但是这些都不起作用。 该错误随机出现。有时在第二次执行或第十次执行

如果我在路径rm -rf *上执行/var/jenkins_home/caches,一切都会恢复正常

0 个答案:

没有答案