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

jenkins-cli.jar hangs when using ssh

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Minor Minor
    • cli
    • Jenkins 2.481
      (java version "17.0.13")

      When attempting to use the jenkins-cli.jar shipped with Jenkins 2.481 (or 2.480) over SSH to Jenkins 2.481 (or 2.480), it hangs.

      NOTE: The examples below are with Jenkins unlocked (no user/name password required). With Jenkins locked (user/name password required) and a public key added for this SSH connection, the same symptoms are experienced.

      Using the jenkins-cli.jar shipped with Jenkins 2.481 over SSH to Jenkins 2.481, it hangs:

      $ java -jar "/tmp/kitchen/cache/jenkins-cli.jar" -s http://127.0.0.1:8080 -ssh -user "dummer_user" help
      Oct 24, 2024 9:53:11 AM io.jenkins.cli.shaded.org.apache.sshd.common.util.security.AbstractSecurityProviderRegistrar getOrCreateProvider
      INFO: getOrCreateProvider(EdDSA) created instance of io.jenkins.cli.shaded.net.i2p.crypto.eddsa.EdDSASecurityProvider
      Oct 24, 2024 9:53:11 AM io.jenkins.cli.shaded.org.apache.sshd.common.io.DefaultIoServiceFactoryFactory getIoServiceProvider
      INFO: No detected/configured IoServiceFactoryFactory; using Nio2ServiceFactoryFactory
      Oct 24, 2024 9:53:11 AM io.jenkins.cli.shaded.org.apache.sshd.client.config.hosts.ConfigFileHostEntryResolver resolveEffectiveResolver
      INFO: resolveEffectiveResolver(dummer_user@127.0.0.1:53801/null) no configuration file at /home/xxxx/.ssh/config

      Using the jenkins-cli.jar shipped with Jenkins 2.479 over SSH to Jenkins 2.481, it works:

      $ java -jar "jenkins-cli.jar" -s http://127.0.0.1:8080 -ssh -user "dummer_user" help
      Oct 24, 2024 9:55:53 AM io.jenkins.cli.shaded.org.apache.sshd.common.util.security.AbstractSecurityProviderRegistrar getOrCreateProvider
      INFO: getOrCreateProvider(EdDSA) created instance of io.jenkins.cli.shaded.net.i2p.crypto.eddsa.EdDSASecurityProvider
      Oct 24, 2024 9:55:53 AM io.jenkins.cli.shaded.org.apache.sshd.common.io.DefaultIoServiceFactoryFactory getIoServiceProvider
      INFO: No detected/configured IoServiceFactoryFactory; using Nio2ServiceFactoryFactory
      Oct 24, 2024 9:55:53 AM io.jenkins.cli.shaded.org.apache.sshd.client.config.hosts.ConfigFileHostEntryResolver resolveEffectiveResolver
      INFO: resolveEffectiveResolver(dummer_user@127.0.0.1:53801/null) no configuration file at /home/xxxx/.ssh/configOct 24, 2024 9:55:53 AM io.jenkins.cli.shaded.org.apache.sshd.client.keyverifier.DefaultKnownHostsServerKeyVerifier reloadKnownHosts
      WARNING: reloadKnownHosts(/home/xxxx/.ssh/known_hosts) invalid file permissions: Permissions violation (GROUP_WRITE)
      Oct 24, 2024 9:55:53 AM hudson.cli.SSHCLI$1 verifyServerKey
      WARNING: Unknown host key for /127.0.0.1:53801
      add-job-to-view
          Adds jobs to view.`
      build
      ~

      Hanging session with logger enabled; Using the jenkins-cli.jar shipped with Jenkins 2.481 over SSH to Jenkins 2.481:

      $ java -jar "/tmp/kitchen/cache/jenkins-cli.jar" -s http://127.0.0.1:8080 -ssh -user "dummer_user" -logger ALL help
      Oct 24, 2024 10:01:21 AM hudson.cli.CLI _main
      FINE: using connection mode SSH
      Oct 24, 2024 10:01:21 AM hudson.cli.SSHCLI sshConnection
      FINE: Connecting via SSH to: 127.0.0.1:53801
      Oct 24, 2024 10:01:22 AM io.jenkins.cli.shaded.org.apache.sshd.common.util.security.SecurityUtils register
      FINE: register(BC) not registered - enabled=true, supported=false
      Oct 24, 2024 10:01:22 AM io.jenkins.cli.shaded.org.apache.sshd.common.util.security.AbstractSecurityProviderRegistrar getOrCreateProvider
      INFO: getOrCreateProvider(EdDSA) created instance of io.jenkins.cli.shaded.net.i2p.crypto.eddsa.EdDSASecurityProvider
      Oct 24, 2024 10:01:22 AM io.jenkins.cli.shaded.org.apache.sshd.common.helpers.AbstractFactoryManager addSessionListener
      FINEST: addSessionListener(SshClient[7bb58ca3])[io.jenkins.cli.shaded.org.apache.sshd.common.session.helpers.SessionTimeoutListener@78b1cc93] registered
      Oct 24, 2024 10:01:22 AM io.jenkins.cli.shaded.org.apache.sshd.common.util.threads.SshdThreadFactory newThread
      FINEST: newThread(java.lang.ThreadGroup[name=main,maxpri=10])[sshd-SshClient[7bb58ca3]-timer-thread-1] [runnable=java.util.concurrent.ThreadPoolExecutor$Worker@2aa5fe93State
      Oct 24, 2024 10:01:22 AM io.jenkins.cli.shaded.org.apache.sshd.common.io.DefaultIoServiceFactoryFactory getIoServiceProvider
      INFO: No detected/configured IoServiceFactoryFactory; using Nio2ServiceFactoryFactory
      Oct 24, 2024 10:01:22 AM io.jenkins.cli.shaded.org.apache.sshd.common.io.nio2.Nio2Service <init>
      FINEST: Creating Nio2Connector
      Oct 24, 2024 10:01:22 AM io.jenkins.cli.shaded.org.apache.sshd.client.config.hosts.ConfigFileHostEntryResolver resolveEffectiveResolver
      INFO: resolveEffectiveResolver(dummer_user@127.0.0.1:53801/null) no configuration file at /home/xxxx/.ssh/config
      Oct 24, 2024 10:01:22 AM io.jenkins.cli.shaded.org.apache.sshd.client.config.hosts.ConfigFileHostEntryResolver resolveEffectiveHost
      FINE: resolveEffectiveHost(dummer_user@127.0.0.1:53801/null) => null
      Oct 24, 2024 10:01:22 AM io.jenkins.cli.shaded.org.apache.sshd.client.SshClient resolveHost
      FINE: connect(dummer_user@127.0.0.1:53801) no overrides
      Oct 24, 2024 10:01:22 AM io.jenkins.cli.shaded.org.apache.sshd.common.io.nio2.Nio2Connector connect
      FINE: Connecting to /127.0.0.1:53801
      Oct 24, 2024 10:01:22 AM io.jenkins.cli.shaded.org.apache.sshd.common.io.nio2.Nio2Service setOption
      FINE: setOption(SO_REUSEADDR)[true] from property=Property[socket-reuseaddr](Boolean]
      Oct 24, 2024 10:01:22 AM io.jenkins.cli.shaded.org.apache.sshd.common.util.threads.SshdThreadFactory newThread
      FINEST: newThread(java.lang.ThreadGroup[name=main,maxpri=10])[sshd-SshClient[7bb58ca3]-nio2-resume-thread-1] [runnable=java.util.concurrent.ThreadPoolExecutor$Worker@60d8c9b7State
      Oct 24, 2024 10:01:22 AM io.jenkins.cli.shaded.org.apache.sshd.common.io.nio2.Nio2Connector lambda$connect$1
      FINE: connect(/127.0.0.1:53801): waiting for connection (timeout=60000ms)
      Oct 24, 2024 10:01:22 AM io.jenkins.cli.shaded.org.apache.sshd.common.io.nio2.Nio2Session <init>
      FINE: Creating IoSession on /127.0.0.1:34952 from /127.0.0.1:53801 via null

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

              Created:
              Updated:
              Resolved: