• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • git-plugin
    • Jenkins 1.536
      Git plugin 2 beta 3
      SSH Credential 1.5.1
      Jenkins GIT client plugin 1.4.3

      Trying to run jGit with credentials on windows slave produces following error, works perfectly fine on linux (centos 6)

      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: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:1108)
      	at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:128)
      	at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:178)
      	at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:125)
      	at org.jenkinsci.plugins.gitclient.JGitAPIImpl$3.execute(JGitAPIImpl.java:700)
      	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:150)
      	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:143)
      	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.run(Unknown Source)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      	at hudson.remoting.Engine$1$1.run(Engine.java:63)
      	at java.lang.Thread.run(Unknown Source)
      

          [JENKINS-20179] Jgit doesnt appear to work on Windows Slave

          Shamul Rohman created issue -
          Nicolas De Loof made changes -
          Labels Original: git2 New: git-client
          Nicolas De Loof made changes -
          Labels Original: git-client New: git-client jgit

          That's a pity, as using JGit was especially considered to avoid such OS-specific issues :'(

          Nicolas De Loof added a comment - That's a pity, as using JGit was especially considered to avoid such OS-specific issues :'(

          Mark Waite added a comment - - edited

          If I do not configure a credential for the JGit configured job, and I use an ssh git URL for the repository, I get the same message on Linux. If I configure a credential, Windows and Linux machines can all clone the repository.

          Mark Waite added a comment - - edited If I do not configure a credential for the JGit configured job, and I use an ssh git URL for the repository, I get the same message on Linux. If I configure a credential, Windows and Linux machines can all clone the repository.

          Mark Waite added a comment - - edited

          I have used both jgit and command line git with ssh credentials on Windows slaves, Linux slaves, and a Linux master.

          I am running Jenkins 1.509.4, git plugin 2.0, and git client plugin 1.4.6 and have several multi-configuration jobs which use ssh credentials on the Linux master and on Windows and Linux slaves. Maybe you need to upgrade from 1.4.3 to 1.4.6 of the git client plugin?

          Mark Waite added a comment - - edited I have used both jgit and command line git with ssh credentials on Windows slaves, Linux slaves, and a Linux master. I am running Jenkins 1.509.4, git plugin 2.0, and git client plugin 1.4.6 and have several multi-configuration jobs which use ssh credentials on the Linux master and on Windows and Linux slaves. Maybe you need to upgrade from 1.4.3 to 1.4.6 of the git client plugin?

          Mark Waite added a comment -

          Can you provide more information about the conditions which might cause this in your installation?

          For example, here are some possible questions to explore:

          Have you configured a global credential and used the global credential in the job definition?

          Have you configured a credential domain and used a credential from that domain in the job definition?

          Have you updated to the latest Git plugin and the latest Git client plugin?

          Have you attempted to create a trivial job which only performs a clone from that repo with no other settings?

          Mark Waite added a comment - Can you provide more information about the conditions which might cause this in your installation? For example, here are some possible questions to explore: Have you configured a global credential and used the global credential in the job definition? Have you configured a credential domain and used a credential from that domain in the job definition? Have you updated to the latest Git plugin and the latest Git client plugin? Have you attempted to create a trivial job which only performs a clone from that repo with no other settings?

          Shamul Rohman added a comment -

          Hi Mark,

          the jenkins, Git version is already on here Under Environment.

          I did setup a trivial job, which just cloned from git repository from bitbucket. My Credential is a global one, which has a passphrase.

          I am curerntly retesting it as I have now updated my jenkins to 1.537, and have now updated my Java on my windows slave to 1.7.0_45. Will keep you updated if i still get any issues.

          Shamul Rohman added a comment - Hi Mark, the jenkins, Git version is already on here Under Environment. I did setup a trivial job, which just cloned from git repository from bitbucket. My Credential is a global one, which has a passphrase. I am curerntly retesting it as I have now updated my jenkins to 1.537, and have now updated my Java on my windows slave to 1.7.0_45. Will keep you updated if i still get any issues.

          Shamul Rohman added a comment - - edited

          Getting the same error as before, this was a basic job, just cloning from git repository, using a global credential. Again works fine on linux (centos) but not on windows.

          My configurations are now

          • Jenkins 1.537
          • Git plugin 2
          • SSH Credential 1.5.1
          • Jenkins GIT client plugin 1.4.6
          • Credentials Plugin 1.9.1

          My Windows slave is windows 7 (64 Bit) and is running Java 64 Bit SE

          Shamul Rohman added a comment - - edited Getting the same error as before, this was a basic job, just cloning from git repository, using a global credential. Again works fine on linux (centos) but not on windows. My configurations are now Jenkins 1.537 Git plugin 2 SSH Credential 1.5.1 Jenkins GIT client plugin 1.4.6 Credentials Plugin 1.9.1 My Windows slave is windows 7 (64 Bit) and is running Java 64 Bit SE

          Running openssl s_client -connect www.bitbucket.org:443 -showcerts

          I notice bitbuket certificat chain stop with "DigiCert High Assurance EV CA-1" and don't include "DigiCert High Assurance EV Root" parent down to root certificate. Surprisingly, Google Chrome resolve them (not sure how) but anyway this will break on any JVM.

          Nicolas De Loof added a comment - Running openssl s_client -connect www.bitbucket.org:443 -showcerts I notice bitbuket certificat chain stop with "DigiCert High Assurance EV CA-1" and don't include "DigiCert High Assurance EV Root" parent down to root certificate. Surprisingly, Google Chrome resolve them (not sure how) but anyway this will break on any JVM.

            ndeloof Nicolas De Loof
            sham480 Shamul Rohman
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: