在Jenkins上我收到错误
Checking out Revision 028951e3660cfba709acb85d4620ce071f89451b (origin/JenkinsTest)
Enabling Git LFS pull
> git.exe config core.sparsecheckout # timeout=10
> git.exe checkout -f 028951e3660cfba709acb85d4620ce071f89451b
FATAL: Could not checkout 028951e3660cfba709acb85d4620ce071f89451b
hudson.plugins.git.GitException: Command "git.exe checkout -f 028951e3660cfba709acb85d4620ce071f89451b" returned status code 128:
stdout:
stderr: fatal: reference is not a tree: 028951e3660cfba709acb85d4620ce071f89451b
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1990)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$800(CliGitAPIImpl.java:72)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2289)
Caused: hudson.plugins.git.GitException: Could not checkout 028951e3660cfba709acb85d4620ce071f89451b
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2313)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1210)
at hudson.scm.SCM.checkout(SCM.java:495)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1202)
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:1724)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:421)
Sending e-mails to: xxxxxxxxxxxxxxxxx
Finished: FAILURE
问题如下:
我们使用自己的Gitlab-Server,而存储库是从github导入的。
为了测试,我创建了分支“origin / jenkinsTest”,这是Gitlab上的错误。
经过测试,我从github上删除了gitlab和importet上的存储库。现在没有分支“origin / jenkinsTest”了。
我已经在Jenkins上为此存储库删除了工作区,但它仍然因此错误而失败。
我该如何解决这个问题?
在另一台PC上,我可以完美地从Gitlab克隆存储库,因此它不能在Gitlab-Server上出现故障,但必须在Jenkins-Server(Windows 10)上。
修改
按照评论中的建议在另一个克隆上运行git branch -r
给了我
origin/BugFixing
origin/CoroutinesDisableButtons
origin/GestureRotation
origin/MovePanelsOnMove
origin/NewNetworking
origin/RebuildUIWithPrefabs
origin/ShowSimpleModelsOnly
origin/SourceLostBug
origin/States_Management
origin/SwitchToplayers
origin/UI-Panels
origin/UIFeinschliff
origin/master
实际上就在上面的错误之前,我也在Jenkins输出中看到了这个:
Seen branch in repository origin/BugFixing
Seen branch in repository origin/CoroutinesDisableButtons
Seen branch in repository origin/GestureRotation
Seen branch in repository origin/MovePanelsOnMove
Seen branch in repository origin/NewNetworking
Seen branch in repository origin/RebuildUIWithPrefabs
Seen branch in repository origin/ShowSimpleModelsOnly
Seen branch in repository origin/SourceLostBug
Seen branch in repository origin/States_Management
Seen branch in repository origin/SwitchToplayers
Seen branch in repository origin/UI-Panels
Seen branch in repository origin/UIFeinschliff
Seen branch in repository origin/master
seen 13 remote branches
> git.exe show-ref --tags -d # timeout=10
编辑2
我创建并配置了一个具有不同名称的新作业,这个克隆/结帐/拉git就好了,而使用原始作业仍然失败。 (我让詹金斯在构建之前清理工作区,并手动删除整个工作区文件夹。)
是否有任何关于Job / Git存储在工作区文件夹外的数据?
答案 0 :(得分:0)
解决此问题的唯一方法是删除整个作业定义(不仅是工作区)并创建具有相同设置的新作业。 现在它克隆并构建完美。
因此,Jenkins在某处存储了有关git存储库的更多信息,而不仅仅是在作业的工作区中。
我已经看到作业定义本身存储在<JenkinsInstall>\Jobs
下,并且可能还有关于以前拉出的分支与前一个构建信息一起存储的信息。
答案 1 :(得分:0)
删除工作区中的旧项目,然后再次运行测试以克隆并运行测试