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

Multi-branch pipeline branch index scan fails with Permission Denied (publickey)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Duplicate
    • Component/s: git-plugin
    • Labels:
      None
    • Environment:
    • Similar Issues:

      Description

      I upgraded to the latest git plugin (as part of upgrading all plugins), 3.6.2, and the multibranch pipeline builds all started to show no branches. I checked the index log and it seems that the index can no longer access the git repo:

      Started
      [Fri Oct 27 09:06:18 AEDT 2017] Starting branch indexing...
      > git --version # timeout=10
      > git ls-remote ssh://git@gitlab.xxxxx.com/group/project.git # timeout=10
      ERROR: [Fri Oct 27 09:06:19 AEDT 2017] Could not update folder level actions from source 0dd8c046-d274-4ca3-b085-b3634d8a1f41
      hudson.plugins.git.GitException: Command "git ls-remote ssh://git@gitlab.xxxxx.com/group/project.git" returned status code 128:
      stdout: 
      stderr: Permission denied (publickey).
      fatal: Could not read from remote repository.
      
      Please make sure you have the correct access rights
      and the repository exists.
      
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1924)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1643)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1561)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1552)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getRemoteReferences(CliGitAPIImpl.java:2729)
      at jenkins.plugins.git.AbstractGitSCMSource.retrieveActions(AbstractGitSCMSource.java:824)
      at jenkins.scm.api.SCMSource.fetchActions(SCMSource.java:746)
      at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:591)
      at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:276)
      at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
      at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:978)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:421)
      [Fri Oct 27 09:06:19 AEDT 2017] Finished branch indexing. Indexing took 0.44 sec
      

      If I downgrade to 3.6.0 the pipeline index scan can correctly scan the repo

      [Fri Oct 27 09:20:05 AEDT 2017] Starting branch indexing...
       > git rev-parse --is-inside-work-tree # timeout=10
      Setting origin to ssh://git@gitlab.xxxxx.com/group/project.git
       > git config remote.origin.url ssh://git@gitlab.xxxxx.com/group/project.git # timeout=10
      Fetching origin...
      Fetching upstream changes from origin
       > git --version # timeout=10
      using GIT_SSH to set credentials gitlab deploy key
       > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
      using GIT_SSH to set credentials gitlab deploy key
       > git ls-remote ssh://git@gitlab.xxxxx.com/group/project.git # timeout=10
       > git rev-parse --is-inside-work-tree # timeout=10
      Setting origin to ssh://git@gitlab.xxxxx.com/group/project.git
      ...
      

        Attachments

          Issue Links

            Activity

            Hide
            markewaite Mark Waite added a comment -

            Fixed in git plugin 3.6.3 released 26 Oct 2017

            Show
            markewaite Mark Waite added a comment - Fixed in git plugin 3.6.3 released 26 Oct 2017
            Hide
            matty666 Matt Evans added a comment -

            Mark Waite thanks Mark! I guess the update hasn't made it to the repo yet? I just checked and I can only download 3.6.2...

            Show
            matty666 Matt Evans added a comment - Mark Waite thanks Mark! I guess the update hasn't made it to the repo yet? I just checked and I can only download 3.6.2...
            Hide
            markewaite Mark Waite added a comment -

            Correct. If you need it urgently, download https://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/git/3.6.3/git-3.6.3.hpi to your local computer, then use the "Advanced" tab in "Manage Plugins" to upload that file.

            Show
            markewaite Mark Waite added a comment - Correct. If you need it urgently, download https://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/git/3.6.3/git-3.6.3.hpi to your local computer, then use the "Advanced" tab in "Manage Plugins" to upload that file.
            Hide
            svscorp Ilia Shakitko added a comment -

            Mark Waite thanks for sharing this. Do you have any info on when it will be available for download?

            Show
            svscorp Ilia Shakitko added a comment - Mark Waite thanks for sharing this. Do you have any info on when it will be available for download?
            Hide
            markewaite Mark Waite added a comment -

            Ilia Shakitko the 3.6.4 version of the plugin has been available for download since 5 Nov 2017.  It includes this fix.

            Show
            markewaite Mark Waite added a comment - Ilia Shakitko the 3.6.4 version of the plugin has been available for download since 5 Nov 2017.  It includes this fix.
            Hide
            svscorp Ilia Shakitko added a comment -

            Mark Waite strange, I have only 3.6.2 as installed an no new versions available. Will check on that.

            Show
            svscorp Ilia Shakitko added a comment - Mark Waite strange, I have only 3.6.2 as installed an no new versions available. Will check on that.

              People

              • Assignee:
                markewaite Mark Waite
                Reporter:
                matty666 Matt Evans
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: