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

No output returned from sshCommand

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • ssh-steps-plugin
    • None
    • Jenkins 2.164.1 ssh-steps 1.2.1

      Setting up a test case to verify a few things at once--ssh-steps, service account creation, and so forth, by running a simple command on a remote server and getting the output. I'm seeing that the ssh connection seems to work and the command is executed, but output doesn't reliably come back.

      Looking through the console output I can't help but notice that

      logging = none

      is in the command parameters, but I can't find that documented anywhere. Could that be part of the problem?

       

      Here is my script: 

      def remote = [:]
      remote.name = 'Test run'
      remote.host = 'host'
      remote.filetransfer = 'SCP'
      remote.allowAnyHosts = true
      remote.appendName = true
      remote.logLevel = 'FINEST'
      remote.pty = true
      node 
      {
       withCredentials([usernamePassword(credentialsId: 'user', passwordVariable: 'p', usernameVariable: 'u')]) 
       {
       remote.user = u
       remote.password = p
      stage('Remote SSH') 
       {
       sshCommand remote: remote, command: "cd / && ls"
       }
       }
      }
      

      and the output:

      Started by user User
      Running in Durability level: MAX_SURVIVABILITY
      [Pipeline] Start of Pipeline (hide)
      [Pipeline] node
      Running on ESG-AGENT in /var/jenkins-agent/workspace/name
      [Pipeline] {
      [Pipeline] withCredentials
      Masking only exact matches of $u or $p
      [Pipeline] {
      [Pipeline] stage
      [Pipeline] { (Remote SSH)
      [Pipeline] sshCommand
      Using default settings: {fileTransfer=sftp, jschLog=false, retryWaitSec=0, timeoutSec=0, pty=false, authentications=[publickey, keyboard-interactive, password], agentForwarding=false, keepAliveSec=60, sudoPath=sudo, dryRun=false, encoding=UTF-8, retryCount=0, logging=slf4j, knownHosts=/var/jenkins-agent/.ssh/known_hosts, ignoreError=false, agent=false}
      Using global settings: {}
      Using per-service settings: {}
      Using per-remote settings: {jschLog=true, pty=true, user=****, interaction=org.jenkinsci.plugins.sshsteps.SSHService$_defineRemote_closure1$_closure8$_closure9@b1ae59f, dryRun=false, logging=none, knownHosts=allowAnyHosts, ignoreError=false, password=...}
      Enabled JSch logging on Thread[pool-1-thread-7098 for channel id=4086,5,main]
      Connecting to Test run[host:22] with {keepAliveSec=60, retryCount=0, retryWaitSec=0, knownHosts=allowAnyHosts, timeoutSec=0, agent=false, authentications=[publickey, keyboard-interactive, password], password=..., user=****}
      Host key checking is off. It may be vulnerable to man-in-the-middle attacks.
      Using password authentication for Test run[host:22]
      [jsch] Connecting to host port 22
      [jsch] Connection established
      [jsch] Remote version string: SSH-2.0-OpenSSH_5.3
      [jsch] Local version string: SSH-2.0-JSCH-0.1.54
      [jsch] CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
      [jsch] CheckKexes: diffie-hellman-group14-sha1,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521
      [jsch] CheckSignatures: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
      [jsch] SSH_MSG_KEXINIT sent
      [jsch] SSH_MSG_KEXINIT received
      [jsch] kex: server: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
      [jsch] kex: server: ssh-rsa,ssh-dss
      [jsch] kex: server: aes128-ctr,aes192-ctr,aes256-ctr
      [jsch] kex: server: aes128-ctr,aes192-ctr,aes256-ctr
      [jsch] kex: server: hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160@openssh.com
      [jsch] kex: server: hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160@openssh.com
      [jsch] kex: server: none,zlib@openssh.com
      [jsch] kex: server: none,zlib@openssh.com
      [jsch] kex: server: 
      [jsch] kex: server: 
      [jsch] kex: client: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
      [jsch] kex: client: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
      [jsch] kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-ctr,aes192-cbc,aes256-ctr,aes256-cbc
      [jsch] kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-ctr,aes192-cbc,aes256-ctr,aes256-cbc
      [jsch] kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
      [jsch] kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
      [jsch] kex: client: none
      [jsch] kex: client: none
      [jsch] kex: client: 
      [jsch] kex: client: 
      [jsch] kex: server->client aes128-ctr hmac-sha1 none
      [jsch] kex: client->server aes128-ctr hmac-sha1 none
      [jsch] SSH_MSG_KEXDH_INIT sent
      [jsch] expecting SSH_MSG_KEXDH_REPLY
      [jsch] ssh_rsa_verify: signature true
      [jsch] Permanently added 'host' (RSA) to the list of known hosts.
      [jsch] SSH_MSG_NEWKEYS sent
      [jsch] SSH_MSG_NEWKEYS received
      [jsch] SSH_MSG_SERVICE_REQUEST sent
      [jsch] SSH_MSG_SERVICE_ACCEPT received
      [jsch] Authentications that can continue: publickey,keyboard-interactive,password
      [jsch] Next authentication method: publickey
      [jsch] Authentications that can continue: keyboard-interactive,password
      [jsch] Next authentication method: keyboard-interactive
      [jsch] Authentication succeeded (keyboard-interactive).
      Connected to Test run[host:22] (SSH-2.0-OpenSSH_5.3)
      Executing command on Test run[host:22]: cd / && ls: {pty=true, encoding=UTF-8, agentForwarding=false, logging=none, timeoutSec=0, ignoreError=false, interaction=org.jenkinsci.plugins.sshsteps.SSHService$_defineRemote_closure1$_closure8$_closure9@b1ae59f}
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] }
      [Pipeline] // withCredentials
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      Finished: SUCCESS

            nrayapati Naresh Rayapati
            ehamric Evan Hamrick
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: