Jenkins拉取Git LFS仓库失败,返回状态码130求助
Jenkins拉取Git LFS仓库CI任务持续失败
在Jenkins上配置了多个CI任务,用于新提交触发时拉取Bitbucket上Git LFS仓库的master分支,但每次构建均失败,非LFS仓库可正常拉取。
错误日志
Checking out Revision <hash> (origin/master) > C:\Program Files\Git\cmd\git.exe config core.sparsecheckout # timeout=10 > C:\Program Files\Git\cmd\git.exe checkout -f <commit> # timeout=10 ERROR: Timeout after 10 minutes FATAL: Could not checkout <commit> hudson.plugins.git.GitException: Command "C:\Program Files\Git\cmd\git.exe checkout -f <commit>" returned status code 130: stdout: stderr: fatal: Unable to read prompt input from standard input [0xe9] fatal: No process is on the other end of the pipe at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2842) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:3170) Caused: hudson.plugins.git.GitException: Could not checkout <commit> at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:3198) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1355) at hudson.scm.SCM.checkout(SCM.java:540) at hudson.model.AbstractProject.checkout(AbstractProject.java:1245) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:649) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:85) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:521) at hudson.model.Run.execute(Run.java:1900) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44) at hudson.model.ResourceController.execute(ResourceController.java:101) at hudson.model.Executor.run(Executor.java:442) Finished: FAILURE
临时手动修复方法
任务失败后,在Jenkins实例上手动执行以下命令后重新触发任务可解决:
- 有时有效:
git clean -f git pull origin master
- 通常有效:
git reset --hard HEAD~1 git pull origin master
- 始终有效:
git fetch --all git reset --hard origin/master
或
git fetch git checkout -f origin/master git checkout master git pull origin master
已尝试的无效修复方案
- 尝试修复1:checkout前清理:启用CI任务中「Clean before checkout」选项,任务仍以相同方式失败。
- 尝试修复2:创建重复任务/工作区:新建工作区、重新克隆仓库并创建重复CI任务,任务仍直接失败。
- 尝试修复3:禁用Git LFS提示:在Jenkins环境设置
GIT_TERMINAL_PROMPT=0,错误变为fatal: Cannot prompt because terminal prompts have been disabled,问题未解决。 - 尝试修复4:跳过Smudge(Git LFS批量模式):设置
GIT_LFS_SKIP_SMUDGE=1后任务可成功,但下游任务依赖拉取的文件,仅下载指针/占位符不可行,该方案无法使用。
内容的提问来源于stack exchange,提问作者Jesse Zuniga
相关产品推荐
相关产品推荐

