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

JGit: Support fallback to local SSH private key

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Minor Minor
    • git-plugin
    • None
    • Jenkins 2.289.3, Git 4.8.1, Git Client 3.9.0

      It seems that the JGit client does not fallback to the default local private key stored in ~/.ssh/...

      After switching from CLI to JGit client I see the following errors

      Caused by: org.eclipse.jgit.errors.TransportException: ssh://git@......git: remote hung up unexpectedly
      	at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:313)
      	at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:153)
      	at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:142)
      	at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:94)
      	at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1309)
      	at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:213)
      	... 11 more
      Caused by: java.lang.IllegalStateException: Cannot open session, connection is not authenticated.
      	at com.trilead.ssh2.Connection.openSession(Connection.java:1080)
      	at org.jenkinsci.plugins.gitclient.trilead.TrileadSession$ProcessImpl.<init>(TrileadSession.java:46)
      	at org.jenkinsci.plugins.gitclient.trilead.TrileadSession.exec(TrileadSession.java:36)
      	at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:296)
      	... 16 more
      

      This is especially an issue since Jenkins decides with the https://github.com/jenkinsci/git-plugin/blob/master/src/main/java/jenkins/plugins/git/GitToolChooser.java automatically which client to use.

            Unassigned Unassigned
            kwin Konrad Windszus
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: