![](/img/trans.png)
[英]Cannot get git commits for multiple repos using Multiple-SCM-Plugin in Jenkins
[英]Jenkins, cannot use multiple scm (git): cannot checkout, error 128
我有 2 个 git 存储库:PyfaData PyfaConn
如果我尝试仅使用其中一个来运行 jenkins,则一切正常。
不幸的是 PyfaData 依赖于 PyfaConn,所以我需要两者。
我使用了源代码管理“git”和“multiple scms”。
只有当我使用两个 repos 时,事情才开始失败。 显然“git”不是为此而设计的,所以我使用“multiple scms”,然后在其下添加 2x git。
无论我选择哪种顺序,获取的第二个 repo 都会返回Checking out Revision 123abc.......
然后是FATAL: Could not checkout 123abc....
并且reference is not a tree: 123abc....
两个回购都只有“主”分支
完整的错误代码如下(我试图删除所有敏感信息,如果您发现我遗漏了什么,请告诉我:))
任何想法为什么会失败? 谢谢!!
> git fetch --tags --force --progress ...............git +refs/heads/*:refs/remotes/origin/*
Checking out Revision 421ed02c45a6ac0ffd2.................86523d (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f 421ed02c45a6ac0ffd2.................86523d
FATAL: Could not checkout 421ed02c45a6ac0ffd2.................86523d
hudson.plugins.git.GitException: Command "git checkout -f 421ed02c45a6ac0ffd2.................86523d" returned status code 128:
stdout:
stderr: fatal: reference is not a tree: 421ed02c45a6ac0ffd2.................86523d
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2042)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$900(CliGitAPIImpl.java:72)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2341)
Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from ......................
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:389)
at hudson.remoting.Channel.call(Channel.java:955)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
at sun.reflect.GeneratedMethodAccessor631.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)
at com.sun.proxy.$Proxy89.execute(Unknown Source)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1242)
at org.jenkinsci.plugins.multiplescms.MultiSCM.checkout(MultiSCM.java:143)
at hudson.scm.SCM.checkout(SCM.java:504)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1208)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
at hudson.model.Run.execute(Run.java:1798)
at hudson.matrix.MatrixRun.run(MatrixRun.java:153)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Caused: hudson.plugins.git.GitException: Could not checkout 421ed02c45a6ac0ffd2.................86523d
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2365)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
at hudson.remoting.UserRequest.perform(UserRequest.java:153)
at hudson.remoting.UserRequest.perform(UserRequest.java:50)
at hudson.remoting.Request$2.run(Request.java:336)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at hudson.remoting.Engine$1$1.run(Engine.java:94)
at java.lang.Thread.run(Thread.java:748)
Finished: FAILURE
我检查了其他类似的问题,但在所有其他问题中,我发现无论配置如何,用户都有这个错误 128,我只在我添加到我的 jenkins 工作中的第二个 git repo 上得到这个。
--- 更新:我正在使用多配置项目创建此作业
---更新2:
这个问题 - 经过长时间的观察 - 看起来很像一个错误:它发生在多配置项目中,而父控制台输出正确显示了 2 个不同的 s(例如 421ed02c45a6ac0ffd2........ 和 0987dc9087f687 ........)对于 2 个 repos 中的每一个,配置矩阵中的每个子节点都显示了两个 repos 的相同修订号,并且无法检出第二个。
这可能与Jenkins Bug有关
https://issues.jenkins-ci.org/browse/JENKINS-23445
显然,解决方案不是使用多配置项目插件,而是尝试使用管道来代替。
这更乏味,需要常规脚本,所以不是真正的解决方案,但绝对是我问题的答案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.