Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-40174

Missing authentication during git checkout and git-lfs

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: git-client-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.27
      Git Plugin: 3.0.0
      Git Client Plugin: 2.0.0
    • Similar Issues:

      Description

      One of our repository is using git-lfs to store large objects. When trying to doing a checkout of the branch, Jenkins fails to clone the repository when the git-lfs filter is getting the objects.

      Cloning the remote Git repository
      Cloning repository ssh://git@github.com/foo/repo.git
       > git init /jenkins/workspace/foo/repo # timeout=10
      Fetching upstream changes from ssh://git@github.com/foo/repo.git
       > git --version # timeout=10
      using GIT_SSH to set credentials SSH Key to access github
       > git fetch --tags --progress ssh://git@github.com/foo/repo.git +refs/heads/*:refs/remotes/origin/*
       > git config remote.origin.url ssh://git@github.com/foo/repo.git # timeout=10
       > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
       > git config remote.origin.url ssh://git@github.com/foo/repo.git # timeout=10
      Fetching upstream changes from ssh://git@github.com/foo/repo.git
      using GIT_SSH to set credentials SSH Key to access github
       > git fetch --tags --progress ssh://git@github.com/foo/repo.git +refs/heads/*:refs/remotes/origin/*
       > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
       > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
      Checking out Revision 873c44c141dd1c7e879f4b07254d6c52d800aea7 (refs/remotes/origin/master)
       > git config core.sparsecheckout # timeout=10
       > git checkout -f 873c44c141dd1c7e879f4b07254d6c52d800aea7
      hudson.plugins.git.GitException: Could not checkout master with start point 873c44c141dd1c7e879f4b07254d6c52d800aea7
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2029)
      	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:152)
      	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:145)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:153)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:50)
      	at hudson.remoting.Request$2.run(Request.java:332)
      	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at hudson.remoting.Engine$1$1.run(Engine.java:85)
      	at java.lang.Thread.run(Thread.java:745)
      	at ......remote call to Channel to /172.25.0.35(Native Method)
      	at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1435)
      	at hudson.remoting.UserResponse.retrieve(UserRequest.java:253)
      	at hudson.remoting.Channel.call(Channel.java:795)
      	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:145)
      	at sun.reflect.GeneratedMethodAccessor342.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:131)
      	at com.sun.proxy.$Proxy104.execute(Unknown Source)
      	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1120)
      	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:109)
      	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:83)
      	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:73)
      	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:52)
      	at hudson.security.ACL.impersonate(ACL.java:221)
      	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:49)
      	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:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: hudson.plugins.git.GitException: Command "git checkout -f 873c44c141dd1c7e879f4b07254d6c52d800aea7" returned status code 128:
      stdout: 
      stderr: Downloading resources/data (28.67 MB)
      Error downloading object: resources/data (47088ff68c17a0f1b4530480065339d8a44caad5dacc0fb5c777526b573bd0cb)
      
      Errors logged to /jenkins/workspace/foo/repo/.git/lfs/objects/logs/20161201T183448.341010775.log
      Use `git lfs logs last` to view the log.
      error: external filter git-lfs smudge -- %f failed 2
      error: external filter git-lfs smudge -- %f failed
      fatal: resources/data: smudge filter lfs failed
      
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1752)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$800(CliGitAPIImpl.java:64)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2005)
      	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:152)
      	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:145)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:153)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:50)
      	at hudson.remoting.Request$2.run(Request.java:332)
      	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at hudson.remoting.Engine$1$1.run(Engine.java:85)
      	... 1 more
      

      On our slave, git-lfs smudge filter is turned on by default globally. The filter is not used during the git fetch command, but during the checkout command, the git-lfs plugin will try to download the objects. However, as I understand it, there's no authentication configured when doing a checkout, only during fetch.

      Would it be possible to also have authentication configured during checkout operations, so that plugins would not break?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                markewaite Mark Waite
                Reporter:
                laurentgo Laurent Goujon
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: