简体   繁体   English

来自 SCM 的 Jenkins 管道脚本:git 结帐错误:无法检索提交消息

[英]Jenkins pipeline script from SCM: git checkout ERROR: Unable to retrieve commit message

I created a Jenkinsfile and put it on Git repo.我创建了一个 Jenkinsfile 并将其放在 Git 存储库中。 I have Linux VM that has this pipeline that config with a script from SCM and working find.我有 Linux VM,它有这个管道,配置了来自 SCM 的脚本和工作查找。 I created a Windows VM with Jenkins also and create the same pipeline again with the same configuration (with light checkout) and got a plugin error.我还使用 Jenkins 创建了一个 Windows VM,并使用相同的配置(使用轻度检出)再次创建了相同的管道,但出现插件错误。 After unmark the light checkout the git finds the repo but on the git checkout -f part error throw.取消标记 light checkout 后,git 找到了 repo,但在 git checkout -f part error throw 上。

Error: ERROR: Unable to retrieve commit message错误: ERROR: Unable to retrieve commit message

after the error the git try to run git rev-list --no-walk on the directory path of the job (C:/..//.Jenkinsfile) and get the error not found(I checked and the file exist ).错误后 git 尝试在作业的目录路径(C:/..//.Jenkinsfile)上运行 git rev-list --no-walk 并得到错误未找到(我检查并且文件存在)。

I found I was getting this issue on Windows 10 when the job runs on the "master" node.当作业在“主”节点上运行时,我发现我在 Windows 10 上遇到了这个问题。 Setting up a new Jenkins node, starting the JNLP Java app, then specifying the "agent", using a label in the pipeline was my "workaround".设置一个新的 Jenkins 节点,启动 JNLP Java 应用程序,然后指定“代理”,在管道中使用label是我的“解决方法”。

(Edit: Though be great to dig deeper and understand why it's failing (assume some Windows Access permissions of git) as I'm now hitting this error when trying to use a Shared Library. The git checkout is failing to "read the commit message" however it does actually clone the branch, but fails to find the vars/src directories.) (编辑:虽然很高兴深入挖掘并理解它失败的原因(假设 git 的一些 Windows 访问权限),因为我现在在尝试使用共享库时遇到此错误。git 结帐未能“阅读提交消息" 但是它确实克隆了分支,但找不到 vars/src 目录。)

There is an issue with the Shared Library, and it running as the Local System, despite running a manual library step on my "agent".共享库存在问题,它作为本地系统运行,尽管在我的“代理”上运行了手动库步骤。 I followed steps to setup SSH for the local system, still no luck.我按照步骤为本地系统设置 SSH,仍然没有运气。 In the end, I setup a new Linux Mint system, to be the Jenkins Master, then use Windows agents for the clone/build and all works a treat!最后,我设置了一个新的 Linux Mint 系统,成为 Jenkins 大师,然后使用 Windows 代理进行克隆/构建,一切都很好!

TL;DR Shared Libraries on Windows is tricky, use a Linux Jenkins Master as a workaround! TL;Windows 上的 DR共享库很棘手,使用 Linux Jenkins Master 作为解决方法!

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

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