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

Jenkins CLI unable to read SSH keys generated on RHEL 7

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • cli
    • None
    • RHEL 7

      I've generated an SSH key for a user on a RHEL 7 Jenkins host, but the Jenkins CLI is unable to use that key. The CLI outputs this error when run normally:

       

      $ sudo -u jenkins java -jar /opt/jenkins/jenkins-cli.jar -s http://localhost:8080/jenkins -ssh -user someuser who-am-i                                                                                                                                             
      Nov 07, 2017 2:50:23 PM org.apache.sshd.client.config.keys.ClientIdentitiesWatcher doGetKeyPair
      WARNING: loadKeys(/var/lib/jenkins/.ssh/id_rsa) failed (NullPointerException) to load key: null
      org.apache.sshd.common.SshException: No more authentication methods available
              at org.apache.sshd.client.session.ClientUserAuthService.tryNext(ClientUserAuthService.java:314)
              at org.apache.sshd.client.session.ClientUserAuthService.processUserAuth(ClientUserAuthService.java:251)
              at org.apache.sshd.client.session.ClientUserAuthService.process(ClientUserAuthService.java:198)
              at org.apache.sshd.common.session.helpers.AbstractSession.doHandleMessage(AbstractSession.java:566)
              at org.apache.sshd.common.session.helpers.AbstractSession.handleMessage(AbstractSession.java:499)
              at org.apache.sshd.common.session.helpers.AbstractSession.decode(AbstractSession.java:1413)
              at org.apache.sshd.common.session.helpers.AbstractSession.messageReceived(AbstractSession.java:460)
              at org.apache.sshd.common.session.helpers.AbstractSessionIoHandler.messageReceived(AbstractSessionIoHandler.java:66)
              at org.apache.sshd.common.io.nio2.Nio2Session.handleReadCycleCompletion(Nio2Session.java:284)
              at org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:264)        at org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:261)
              at org.apache.sshd.common.io.nio2.Nio2CompletionHandler.lambda$completed$0(Nio2CompletionHandler.java:38)
              at java.security.AccessController.doPrivileged(Native Method)
              at org.apache.sshd.common.io.nio2.Nio2CompletionHandler.completed(Nio2CompletionHandler.java:37)
              at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
              at sun.nio.ch.Invoker$2.run(Invoker.java:218)
              at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
              at java.lang.Thread.run(Thread.java:748)

      Running with -logger FINE gives a better clue as to what's going wrong, so I'll attach that log.

      I'm not sure, but I strongly suspect that the root cause is this org.apache.sshd:sshd-core bug: https://issues.apache.org/jira/browse/SSHD-760. The fix for that has been released by the dependency, but the Jenkins CLI hasn't yet updated to a 1.7.0+ version that includes it.

            Unassigned Unassigned
            karlmdavis karlmdavis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: