简体   繁体   中英

Issue with Git checkout | git-lfs filter-process died of signal 15

Git version is 2.22.1. We have a project that has web assets (mostly images and CSS) and build on Jenkins was working fine until we moved to multibranch pipeline build. There is no major change that took place in Jenkinsfile. Build is failing constantly with the following exception:

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)

As per the logs, source code checkout is failing on a timeout of 10 minutes. It still fails to checkout even if we update the timeout to 60 minutes. On another machine code checkout happens within 5 minutes, so this should not be an issue.

[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

I would try to clean the workspace and prune the repo

use checkout step as follow:

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

https://jenkins.io/doc/pipeline/steps/git/

https://wiki.jenkins.io/display/JENKINS/Workspace+Cleanup+Plugin

This issue is resolved by removing all attributes (all were lfs related) present in the .gitattributes file. I pushed this change and Jenkins (multibranhch pipeline) was able to checkout the source code successfully. I then add all those git attributes back and pushed the changes again. Still, Jenkins is able to checkout the code. Basically nothing changed in the code and yet somehow with these two steps checkout is happening successfully.

I also added 'Git LFS pull after checkout' configuration but this has nothing to do with code checkout issue.

For me, it turned out the large file was not properly uploaded to the server.
git lfs push --all origin master on a machine with an actual copy of the file fixed it.

I had the same issue because LFS was activated but in our Pipeline was not the extension added in the checkout step.

The fix was just adding the GitLFSPull to the checkout.

checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'WipeWorkspace'], [$class: 'PruneStaleBranch'],[$class: 'GitLFSPull'] ....

In official Documentation Site :

$class: 'GitLFSPull' Enable git large file support for the workspace by pulling large files after the checkout completes. Requires that the controller and each agent performing an LFS checkout have installed git lfs .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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