• 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

          Raphaël Barrois created issue -

          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.
          Kohsuke Kawaguchi made changes -
          Assignee Original: Nicolas De Loof [ ndeloof ] New: Kohsuke Kawaguchi [ kohsuke ]
          Resolution New: Not A Defect [ 7 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          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)
          Raphaël Barrois made changes -
          Resolution Original: Not A Defect [ 7 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]

          @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
          Nicolas De Loof made changes -
          Component/s New: git-client [ 17423 ]
          Component/s Original: git [ 15543 ]

          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.
          Mark Waite made changes -
          Resolution New: Cannot Reproduce [ 5 ]
          Status Original: Reopened [ 4 ] New: Resolved [ 5 ]

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

              Created:
              Updated:
              Resolved: