• Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • git-client-plugin
    • Linux/Debian
      Jenkins 1.533
      git-client-plugin 1.3.0
      git-plugin 2.0-beta2
      scm-api-plugin 0.2

      Hi,

      I've tried to switch to the next (unreleased) version of the Git plugin, in order to integrate with Jenkins credentials repository.

      I've selected:

      • Repository: git@github.com:ORG/PROJECT.git
      • Credentials: <A ssh deploy key linked to that project>
      • Git executable: JGit
      • Activate SSH Agent with the same credentials

      The SSH key isn't set as the "default key" of the Jenkins shell user on the server.

      As a result, Git SCM Polling, Github web hook and pre-build fetch fail.
      When I switch back to the "native" git executable, polling and web hook fail (as usual), but pre-build fetch succeed.

      Here is the stack trace I get:

      Started by user anonymous
      Building remotely on kiso3 in workspace /home/jenkins/workspace/blusers
      [ssh-agent] Using credentials git (blusers)
      [ssh-agent] Looking for ssh-agent implementation...
      [ssh-agent]   Java/JNR ssh-agent
      [ssh-agent] Started.
      Fetching changes from the remote Git repository
      FATAL: Cannot open session, connection is not authenticated.
      java.lang.IllegalStateException: Cannot open session, connection is not authenticated.
      	at com.trilead.ssh2.Connection.openSession(Connection.java:1102)
      	at org.jenkinsci.plugins.gitclient.trilead.TrileadSession.exec(TrileadSession.java:24)
      	at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:248)
      	at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:147)
      	at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:136)
      	at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122)
      	at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1105)
      	at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:128)
      	at org.jenkinsci.plugins.gitclient.JGitAPIImpl.fetch(JGitAPIImpl.java:342)
      	at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:616)
      	at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:299)
      	at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:280)
      	at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:239)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      	at hudson.remoting.Request$2.run(Request.java:326)
      	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:679)
      

          [JENKINS-19921] Git clone fails with JGit and SSH Credentials

          Trilead, the SSH implementation we use underneath, does not support SSH agent. So you'll have to specify the passphrase of your private key inside Jenkins.

          It'd be good to file a separate RFE for SSH agent support in Trilead if you think it's an important enough addition.

          Kohsuke Kawaguchi added a comment - Trilead, the SSH implementation we use underneath, does not support SSH agent. So you'll have to specify the passphrase of your private key inside Jenkins. It'd be good to file a separate RFE for SSH agent support in Trilead if you think it's an important enough addition.

          The issue doesn't come from the use of SSHAgent: even if I remove that config, I still get a failure.

          Regarding the clone, I'm cloning from a (private) GitHub repository using GitHub SSH Deploy Keys, without a passphrase, added to the "credentials" section of Jenkins.

          Here is the error with "SSH Agent" disabled:

          Started by user anonymous
          Building remotely on kiso3 in workspace /home/jenkins/workspace/blusers
          Fetching changes from the remote Git repository
          FATAL: Cannot open session, connection is not authenticated.
          java.lang.IllegalStateException: Cannot open session, connection is not authenticated.
          	at com.trilead.ssh2.Connection.openSession(Connection.java:1102)
          	at org.jenkinsci.plugins.gitclient.trilead.TrileadSession.exec(TrileadSession.java:24)
          	at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:248)
          	at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:147)
          	at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:136)
          	at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122)
          	at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1105)
          	at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:128)
          	at org.jenkinsci.plugins.gitclient.JGitAPIImpl.fetch(JGitAPIImpl.java:342)
          	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          	at java.lang.reflect.Method.invoke(Method.java:616)
          	at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:299)
          	at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:280)
          	at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:239)
          	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
          	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
          	at hudson.remoting.Request$2.run(Request.java:326)
          	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
          	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
          	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
          	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
          	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
          	at java.lang.Thread.run(Thread.java:679)
          

          Raphaƫl Barrois added a comment - The issue doesn't come from the use of SSHAgent: even if I remove that config, I still get a failure. Regarding the clone, I'm cloning from a (private) GitHub repository using GitHub SSH Deploy Keys, without a passphrase, added to the "credentials" section of Jenkins. Here is the error with "SSH Agent" disabled: Started by user anonymous Building remotely on kiso3 in workspace /home/jenkins/workspace/blusers Fetching changes from the remote Git repository FATAL: Cannot open session, connection is not authenticated. java.lang.IllegalStateException: Cannot open session, connection is not authenticated. at com.trilead.ssh2.Connection.openSession(Connection.java:1102) at org.jenkinsci.plugins.gitclient.trilead.TrileadSession.exec(TrileadSession.java:24) at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:248) at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:147) at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:136) at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122) at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1105) at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:128) at org.jenkinsci.plugins.gitclient.JGitAPIImpl.fetch(JGitAPIImpl.java:342) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:299) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:280) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:239) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang. Thread .run( Thread .java:679)

          @Kohsuke : we use a fork of trilead that itself is just a fork maitained by svnkit. Trilead.com don't support this package anymore. I guess it would make more sense to use a supported ssh lib. Apache Mina one for sample

          Nicolas De Loof added a comment - @Kohsuke : we use a fork of trilead that itself is just a fork maitained by svnkit. Trilead.com don't support this package anymore. I guess it would make more sense to use a supported ssh lib. Apache Mina one for sample

          Mark Waite added a comment -

          Could you check to see if this problem still exists in git-client-plugin 1.6.2 and in git-plugin 2.0.1? A number of other authentication issues have been resolved since this bug was reported, and this one may have been resolved as well.

          Mark Waite added a comment - Could you check to see if this problem still exists in git-client-plugin 1.6.2 and in git-plugin 2.0.1? A number of other authentication issues have been resolved since this bug was reported, and this one may have been resolved as well.

          Mark Waite added a comment -

          Closing this after a month with no response to the request for verification if the problem still exists.

          Mark Waite added a comment - Closing this after a month with no response to the request for verification if the problem still exists.

          E. Sammer added a comment -

          I was able to confirm this and find a work around.

          Specifically with Github, the proper combination of magic is to create an SSH credential in Jenkins with the username git. This is because all github ssh activity happens at user git. That, combined with a git repository URL of github.com:myorg/myrepo.git (note the lack of git@) worked for me. I'm using the jgit plugin and a non-standard ssh key location on the jenkins box (/var/lib/jenkins/.ssh/jenkins_github_deploy). I did see someone on StackOverflow suggest generating the known_hosts file so Jenkins doesn't get stuck, which I also did with `su - jenkins && cd /var/lib/jenkins/.ssh/ && ssh-keyscan github.com > known_hosts`.

          Hope this helps.

          E. Sammer added a comment - I was able to confirm this and find a work around. Specifically with Github, the proper combination of magic is to create an SSH credential in Jenkins with the username git. This is because all github ssh activity happens at user git. That, combined with a git repository URL of github.com:myorg/myrepo.git (note the lack of git@) worked for me. I'm using the jgit plugin and a non-standard ssh key location on the jenkins box (/var/lib/jenkins/.ssh/jenkins_github_deploy). I did see someone on StackOverflow suggest generating the known_hosts file so Jenkins doesn't get stuck, which I also did with `su - jenkins && cd /var/lib/jenkins/.ssh/ && ssh-keyscan github.com > known_hosts`. Hope this helps.

          Oded Arbel added a comment -

          I have the same problem: changing git provider to JGit gives me this:

          {{
          ERROR: Failed to record SCM polling for hudson.model.FreeStyleProject@7582f1de[orchestration]
          java.lang.IllegalStateException: Cannot open session, connection is not authenticated.
          at com.trilead.ssh2.Connection.openSession(Connection.java:1127)
          at org.jenkinsci.plugins.gitclient.trilead.TrileadSession.exec(TrileadSession.java:32)
          at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:262)
          at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:161)
          at org.jenkinsci.plugins.gitclient.JGitAPIImpl.getHeadRev(JGitAPIImpl.java:746)
          at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:576)
          at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:526)
          at hudson.scm.SCM.compareRemoteRevisionWith(SCM.java:381)
          at hudson.scm.SCM.poll(SCM.java:398)
          at hudson.model.AbstractProject._poll(AbstractProject.java:1459)
          at hudson.model.AbstractProject.poll(AbstractProject.java:1362)
          at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:510)
          at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:539)
          at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
          at java.util.concurrent.FutureTask.run(FutureTask.java:262)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
          at java.lang.Thread.run(Thread.java:745)
          }}

          I'm using an SSH key that is installed in Jenkins credentials system, using "git" as the user name. changing the git URL for the project to not have the user name part, as E. Sammer mentioned, does not change anything for me.

          I'm using the latest git plugin

          Oded Arbel added a comment - I have the same problem: changing git provider to JGit gives me this: {{ ERROR: Failed to record SCM polling for hudson.model.FreeStyleProject@7582f1de [orchestration] java.lang.IllegalStateException: Cannot open session, connection is not authenticated. at com.trilead.ssh2.Connection.openSession(Connection.java:1127) at org.jenkinsci.plugins.gitclient.trilead.TrileadSession.exec(TrileadSession.java:32) at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:262) at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:161) at org.jenkinsci.plugins.gitclient.JGitAPIImpl.getHeadRev(JGitAPIImpl.java:746) at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:576) at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:526) at hudson.scm.SCM.compareRemoteRevisionWith(SCM.java:381) at hudson.scm.SCM.poll(SCM.java:398) at hudson.model.AbstractProject._poll(AbstractProject.java:1459) at hudson.model.AbstractProject.poll(AbstractProject.java:1362) at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:510) at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:539) at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) }} I'm using an SSH key that is installed in Jenkins credentials system, using "git" as the user name. changing the git URL for the project to not have the user name part, as E. Sammer mentioned, does not change anything for me. I'm using the latest git plugin

          Mark Waite added a comment -

          guss77 I think your problem is most likely a configuration problem that is specific to your site, not a general problem with the plugin. I frequently use ssh secured connections between various slaves (Windows, CentOS, Debian, Ubuntu) and various different git repositories (GItHub, Assembla, bitbucket, sourceforge, and more) successfully. Many, many of the 60000+ installations of the git plugin also use ssh authenticated connections.

          The fact that both JGit and CliGit show the problem seems like a further indication that the problem is not in the git plugin or the git client plugin.

          Mark Waite added a comment - guss77 I think your problem is most likely a configuration problem that is specific to your site, not a general problem with the plugin. I frequently use ssh secured connections between various slaves (Windows, CentOS, Debian, Ubuntu) and various different git repositories (GItHub, Assembla, bitbucket, sourceforge, and more) successfully. Many, many of the 60000+ installations of the git plugin also use ssh authenticated connections. The fact that both JGit and CliGit show the problem seems like a further indication that the problem is not in the git plugin or the git client plugin.

          krzyk added a comment -

          markewaite I don't think this is an isolated problem, I have exactly the same on jgit using ssh credentials doesn't work, and I get the same stacktrace, using the latest git client plugin.
          I'm using credentials that should retrieve keys from the .ssh directory.

          krzyk added a comment - markewaite I don't think this is an isolated problem, I have exactly the same on jgit using ssh credentials doesn't work, and I get the same stacktrace, using the latest git client plugin. I'm using credentials that should retrieve keys from the .ssh directory.

          Mark Waite added a comment -

          I'm reasonably confident it is an isolated problem.

          There are are many use models which use the JGit implementation with ssh credentials. There are automated tests of JGit with ssh credentials. I have acceptance test cases I regularly run from a docker instance to confirm JGit with ssh credentials to multiple servers, including a personal ssh based git server, assembla, bitbucket, github, and gitlab. Those tests are all passing.

          If it weren't an isolated problem, I'd expect more of the installations to be reporting the issue, especially since the last comment on this closed bug report is from Aug 2015.

          Mark Waite added a comment - I'm reasonably confident it is an isolated problem. There are are many use models which use the JGit implementation with ssh credentials. There are automated tests of JGit with ssh credentials. I have acceptance test cases I regularly run from a docker instance to confirm JGit with ssh credentials to multiple servers, including a personal ssh based git server, assembla, bitbucket, github, and gitlab. Those tests are all passing. If it weren't an isolated problem, I'd expect more of the installations to be reporting the issue, especially since the last comment on this closed bug report is from Aug 2015.

          guss77 I have the same issue, have you managed to solve it?

          Tidhar Klein Orbach added a comment - guss77 I have the same issue, have you managed to solve it?

          Mark Waite added a comment -

          I'm still not able to duplicate this with the current code. Automated and interactive tests of JGit with an RSA private key continue to run correctly on Windows, Ubuntu 12, Ubuntu 14, Debian 7, Debian 8, Debian 9 pre-release, CentOS 6, and CentOS 7. The tests uses private git repositories on assembla, bitbucket, gitlab, github, and on two different private computers that I host at home.

          I have 2 JGit based failures in the automated test suite that are only visible when using the git client plugin 1.20 beta and the git plugin 2.5 beta with submodule authentication configured to use the credentials of the parent repository. If that's the case you're seeing, please share that information.

          If you have more details, or a publicly accessible way to duplicate the bug, I'm certainly interested. I'm also interested if you've been able to successfully connect to the same repository with command line git rather than JGit.

          Mark Waite added a comment - I'm still not able to duplicate this with the current code. Automated and interactive tests of JGit with an RSA private key continue to run correctly on Windows, Ubuntu 12, Ubuntu 14, Debian 7, Debian 8, Debian 9 pre-release, CentOS 6, and CentOS 7. The tests uses private git repositories on assembla, bitbucket, gitlab, github, and on two different private computers that I host at home. I have 2 JGit based failures in the automated test suite that are only visible when using the git client plugin 1.20 beta and the git plugin 2.5 beta with submodule authentication configured to use the credentials of the parent repository. If that's the case you're seeing, please share that information. If you have more details, or a publicly accessible way to duplicate the bug, I'm certainly interested. I'm also interested if you've been able to successfully connect to the same repository with command line git rather than JGit.

          Oded Arbel added a comment -

          tizkiko : Haven't happened to me for a while now, I don't remember what I changed - if at all.

          Oded Arbel added a comment - tizkiko : Haven't happened to me for a while now, I don't remember what I changed - if at all.

          D Claus added a comment -

          Other people (http://stackoverflow.com/questions/34317581/jenkins-workflow-multibranch-with-git-illegalstateexception) including me, are having this same problem.

          I am using Jenkins 2.7 with the multibranch plugin, all plugins are at the latest version.

          If I create a project, and add a "Branch Source" of "Git", type in the repository (git@git.DOMAIN.com:/opt/git/PROJECT.git), select credentials that work everywhere else in Jenkins, and click "Save" I get a "Branch Indexing Log" screen with this stack trace:

          Started
          Setting origin to git@git.(DOMAIN).com:/opt/git/(PROJECT).git
          Fetching origin...
          FATAL: Failed to recompute children of deleteme multibranch
          java.lang.IllegalStateException: Cannot open session, connection is not authenticated.
          	at com.trilead.ssh2.Connection.openSession(Connection.java:1127)
          	at org.jenkinsci.plugins.gitclient.trilead.TrileadSession.exec(TrileadSession.java:32)
          	at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:262)
          	at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:161)
          	at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:136)
          	at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122)
          	at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1138)
          	at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:130)
          	at org.jenkinsci.plugins.gitclient.JGitAPIImpl.fetch(JGitAPIImpl.java:678)
          	at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:174)
          	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:146)
          	at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:296)
          	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:157)
          	at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:122)
          	at hudson.model.ResourceController.execute(ResourceController.java:98)
          	at hudson.model.Executor.run(Executor.java:410)
          Finished: FAILURE
          

          D Claus added a comment - Other people ( http://stackoverflow.com/questions/34317581/jenkins-workflow-multibranch-with-git-illegalstateexception ) including me, are having this same problem. I am using Jenkins 2.7 with the multibranch plugin, all plugins are at the latest version. If I create a project, and add a "Branch Source" of "Git", type in the repository (git@git.DOMAIN.com:/opt/git/PROJECT.git), select credentials that work everywhere else in Jenkins, and click "Save" I get a "Branch Indexing Log" screen with this stack trace: Started Setting origin to git@git.(DOMAIN).com:/opt/git/(PROJECT).git Fetching origin... FATAL: Failed to recompute children of deleteme multibranch java.lang.IllegalStateException: Cannot open session, connection is not authenticated. at com.trilead.ssh2.Connection.openSession(Connection.java:1127) at org.jenkinsci.plugins.gitclient.trilead.TrileadSession.exec(TrileadSession.java:32) at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:262) at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:161) at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:136) at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122) at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1138) at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:130) at org.jenkinsci.plugins.gitclient.JGitAPIImpl.fetch(JGitAPIImpl.java:678) at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:174) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:146) at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:296) at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:157) at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:122) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) Finished: FAILURE

          Mark Waite added a comment -

          dc00 please open a separate bug report for that problem. It sounds like it is specific to the multi-branch plugin rather than the git plugin or the git client plugin.

          Mark Waite added a comment - dc00 please open a separate bug report for that problem. It sounds like it is specific to the multi-branch plugin rather than the git plugin or the git client plugin.

          D Claus added a comment -

          Looks like the actual bug is JENKINS-33983. The workaround (also posted in that JIRA) is to go into "Manage Jenkins" -> "Global Tool Configuration" then under "Git" click "Add Git" then select "JGit". See also https://wiki.jenkins-ci.org/display/JENKINS/Git+plugin+2.0+beta+testing#Gitplugin2.0betatesting-ActivatingJGit.
          The attached links says "go to the system configuration page" which should read "go into the Global Tool Configuration page".

          D Claus added a comment - Looks like the actual bug is JENKINS-33983 . The workaround (also posted in that JIRA) is to go into "Manage Jenkins" -> "Global Tool Configuration" then under "Git" click "Add Git" then select "JGit". See also https://wiki.jenkins-ci.org/display/JENKINS/Git+plugin+2.0+beta+testing#Gitplugin2.0betatesting-ActivatingJGit . The attached links says "go to the system configuration page" which should read "go into the Global Tool Configuration page".

          ptho ho added a comment -

          I run into the same issue. Pipeline works but Multibranch Pipeline job doesn't work . Add JGit to under GIT in Global Tool Configuration as well, it's not working.

          Setting origin to git@github.somecompany.com:RnD/test.git
          Fetching origin...
          FATAL: Failed to recompute children of test_multibranch_pipeline
          java.lang.IllegalStateException: Cannot open session, connection is not authenticated.

          I tried different credentials, none worked in multibranch pipeline.

          ptho ho added a comment - I run into the same issue. Pipeline works but Multibranch Pipeline job doesn't work . Add JGit to under GIT in Global Tool Configuration as well, it's not working. Setting origin to git@github.somecompany.com:RnD/test.git Fetching origin... FATAL: Failed to recompute children of test_multibranch_pipeline java.lang.IllegalStateException: Cannot open session, connection is not authenticated. I tried different credentials, none worked in multibranch pipeline.

          Mark Waite added a comment -

          Refer to JENKINS-36958 for the bug which tracks one case where a multi-branch pipeline cannot authenticate in the same environment where a freestyle job can authenticate. The distinction in that case is that the freestyle job uses command line git for its initial clone, while the multi-branch pipeline uses JGit

          Mark Waite added a comment - Refer to JENKINS-36958 for the bug which tracks one case where a multi-branch pipeline cannot authenticate in the same environment where a freestyle job can authenticate. The distinction in that case is that the freestyle job uses command line git for its initial clone, while the multi-branch pipeline uses JGit

            kohsuke Kohsuke Kawaguchi
            xelnor Raphaƫl Barrois
            Votes:
            1 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: