Git checkout问题| Git lfs滤波过程因信号15而死亡

Git checkout问题| Git lfs滤波过程因信号15而死亡,git,jenkins,jenkins-pipeline,Git,Jenkins,Jenkins Pipeline,Git版本是2.22.1。我们有一个项目,它有web资产(主要是图像和CSS),并且在Jenkins的基础上构建,在我们转向多分支管道构建之前,它一直运行良好。詹金斯档案中没有发生重大变化。生成不断失败,出现以下异常: hudson.plugins.git.GitException: Command "git checkout -f 0d29a50ec65a5fc6302d9ed56efc59b789f727c7" returned status code 128: stdout: stder

Git版本是2.22.1。我们有一个项目,它有web资产(主要是图像和CSS),并且在Jenkins的基础上构建,在我们转向多分支管道构建之前,它一直运行良好。詹金斯档案中没有发生重大变化。生成不断失败,出现以下异常:

hudson.plugins.git.GitException: Command "git checkout -f 0d29a50ec65a5fc6302d9ed56efc59b789f727c7" returned status code 128:
stdout: 
stderr: fatal: the remote end hung up unexpectedly
error: git-lfs filter-process died of signal 15

    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2372)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$1000(CliGitAPIImpl.java:80)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2681)
Caused: hudson.plugins.git.GitException: Could not checkout 0d29a50ec65a5fc6302d9ed56efc59b789f727c7
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2705)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1195)
    at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:124)
    at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93)
    at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
    at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    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 java.lang.Thread.run(Thread.java:748)
根据日志,源代码签出在超时10分钟时失败。即使我们将超时时间更新为60分钟,它仍然无法签出。在另一台机器上,代码签出在5分钟内进行,因此这不应该是一个问题

[Pipeline] checkout
using credential buildsvc
Cloning the remote Git repository
Cloning with configured refspecs honoured and without tags
Cloning repository https://buildsvc@repo.testops.com:8443/scm/pro/web-assets.git
 > git init /var/lib/jenkins/workspace/_assets-test-ci_feature_pro-1967 # timeout=10
Fetching upstream changes from https://buildsvc@repo.testops.com:8443/scm/pro/web-assets.git
 > git --version # timeout=10
using GIT_ASKPASS to set credentials buildsvc is a service user that is not associated with any person. This is used to checkout source code from a version control system.
 > git fetch --no-tags --force --progress -- https://buildsvc@repo.testops.com:8443/scm/pro/web-assets.git +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git config remote.origin.url https://buildsvc@repo.testops.com:8443/scm/pro/web-assets.git # timeout=10
 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git config remote.origin.url https://buildsvc@repo.testops.com:8443/scm/pro/web-assets.git # timeout=10
Fetching without tags
Fetching upstream changes from https://buildsvc@repo.testops.com:8443/scm/pro/web-assets.git
using GIT_ASKPASS to set credentials buildsvc is a service user that is not associated with any person. This is used to checkout source code from a version control system.
 > git fetch --no-tags --force --progress -- https://buildsvc@repo.testops.com:8443/scm/pro/web-assets.git +refs/heads/*:refs/remotes/origin/* # timeout=10
Checking out Revision 0d29a50ec65a5fc6302d9ed56efc59b789f727c7 (feature/pro-1967)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 0d29a50ec65a5fc6302d9ed56efc59b789f727c7 # timeout=10
ERROR: Timeout after 10 minutes

我会努力清理工作区,修剪回购协议

使用签出步骤如下所示:

        checkout([$class: 'GitSCM',
            branches: scm.branches,
            extensions:  scm.extensions + [[$class: 'WipeWorkspace'], [$class: 'PruneStaleBranch']],
            userRemoteConfigs: scm.userRemoteConfigs
        ])


此问题通过删除
.gittributes
文件中存在的所有属性(所有属性都与lfs相关)来解决。我推动了这一改变,Jenkins(multibranhch管道)成功地签出了源代码。然后,我将所有这些git属性添加回去,并再次推送更改。尽管如此,詹金斯还是能够签出代码。基本上代码中没有任何更改,但通过这两个步骤,签出工作正在成功进行


我还添加了“Git LFS签出后拉”配置,但这与代码签出问题无关。

对我来说,原来大文件没有正确上传到服务器。

git-lfs-push——所有原始主机
都安装在一台机器上,并带有文件的实际副本。谢谢您的回复。我担心,添加这个并没有任何区别。嘿,关于你关于git lfs的回答,我建议你还是使用checkout步骤,但是尽可能使用最精确的配置。签出步骤有很多选项,比如GitLFSPull和CloneOption,例如,我在stackoverflow上发现了这个问题是的,我同意。我们有一个类似配置的签出步骤。