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

Can Not Connect Mac Slave Over SSH - error copying remoting.jar.

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Incomplete
    • Component/s: ssh-slaves-plugin
    • Labels:
      None
    • Environment:
    • Similar Issues:

      Description

      Note: I have a windows 10 build node hooked up to the same Jenkins server over ssh and it works fine and connects without any issues
      The Mac node where working before I update Jenkins and the ssh-slaves-plugin but, I am not sure the version number that caused the nodes to stop working
      I can scp a file from the jenkins computer from to the mac slaves from the command line manual with no issue
      Error Log Below:

      SSHLauncher{host='141.128.110.86', port=22, credentialsId='d6a51f71-c020-4c49-af41-71d00db7e235', jvmOptions='', javaPath='', prefixStartSlaveCmd='', suffixStartSlaveCmd='', launchTimeoutSeconds=210, maxNumRetries=10, retryWaitTime=15, sshHostKeyVerificationStrategy=hudson.plugins.sshslaves.verifiers.NonVerifyingKeyVerificationStrategy, tcpNoDelay=false, trackCredentials=true}
      [12/11/18 23:29:57] [SSH] Opening SSH connection to 141.128.110.86:22.
      [12/11/18 23:29:57] [SSH] WARNING: SSH Host Keys are not being verified. Man-in-the-middle attacks may be possible against this connection.
      [12/11/18 23:29:58] [SSH] Authentication successful.
      [12/11/18 23:29:58] [SSH] The remote user's environment is:
      BASH=/bin/bash
      BASH_ARGC=()
      BASH_ARGV=()
      BASH_EXECUTION_STRING=set
      BASH_LINENO=()
      BASH_SOURCE=()
      BASH_VERSINFO=([0]="3" [1]="2" [2]="57" [3]="1" [4]="release" [5]="x86_64-apple-darwin18")
      BASH_VERSION='3.2.57(1)-release'
      DIRSTACK=()
      EUID=501
      GROUPS=()
      HOME=/Users/jenkins
      HOSTNAME=Swordpoint-Mac-Mini.local
      HOSTTYPE=x86_64
      IFS=$' \t\n'
      LOGNAME=jenkins
      MACHTYPE=x86_64-apple-darwin18
      MAIL=/var/mail/jenkins
      OPTERR=1
      OPTIND=1
      OSTYPE=darwin18
      PATH=/usr/bin:/bin:/usr/sbin:/sbin
      PPID=19839
      PS4='+ '
      PWD=/Users/jenkins
      SHELL=/bin/bash
      SHELLOPTS=braceexpand:hashall:interactive-comments
      SHLVL=1
      SSH_CLIENT='242.231.8.254 46374 22'
      SSH_CONNECTION='242.231.8.254 46374 10.10.1.234 22'
      TERM=dumb
      TMPDIR=/var/folders/r5/b9fff5ts2dq5yvhfhyfdv7dm0000gn/T/
      UID=501
      USER=jenkins
      _=bash
      [12/11/18 23:29:58] [SSH] Checking java version of /Users/jenkins/.jenkins/jdk/bin/java
      Couldn't figure out the Java version of /Users/jenkins/.jenkins/jdk/bin/java
      bash: /Users/jenkins/.jenkins/jdk/bin/java: No such file or directory
      
      [12/11/18 23:29:58] [SSH] Checking java version of java
      [12/11/18 23:29:59] [SSH] java -version returned 1.8.0_181.
      [12/11/18 23:29:59] [SSH] Starting sftp client.
      [12/11/18 23:29:59] [SSH] Copying latest remoting.jar...
      java.io.IOException: Could not copy remoting.jar into '/Users/jenkins/.jenkins' on agent
      	at hudson.plugins.sshslaves.SSHLauncher.copyAgentJar(SSHLauncher.java:1109)
      	at hudson.plugins.sshslaves.SSHLauncher.access$400(SSHLauncher.java:128)
      	at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:866)
      	at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:833)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	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)
      Caused by: java.io.IOException: Could not copy remoting.jar to '/Users/jenkins/.jenkins/remoting.jar' on agent
      	at hudson.plugins.sshslaves.SSHLauncher.copyAgentJar(SSHLauncher.java:1104)
      	... 7 more
      Caused by: java.io.IOException: Unexpected end of sftp stream.
      	at com.trilead.ssh2.SFTPv3Client.readBytes(SFTPv3Client.java:217)
      	at com.trilead.ssh2.SFTPv3Client.receiveMessage(SFTPv3Client.java:240)
      	at com.trilead.ssh2.SFTPv3Client.write(SFTPv3Client.java:1340)
      	at com.trilead.ssh2.jenkins.SFTPClient$SFTPOutputStream.write(SFTPClient.java:144)
      	at java.io.OutputStream.write(OutputStream.java:75)
      	at hudson.plugins.sshslaves.SSHLauncher.copyAgentJar(SSHLauncher.java:1098)
      	... 7 more
      	Suppressed: java.io.IOException: SSH channel is closed
      		at com.trilead.ssh2.channel.ChannelManager.ioException(ChannelManager.java:1543)
      		at com.trilead.ssh2.channel.ChannelManager.sendData(ChannelManager.java:373)
      		at com.trilead.ssh2.channel.ChannelOutputStream.write(ChannelOutputStream.java:63)
      		at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
      		at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
      		at com.trilead.ssh2.SFTPv3Client.sendMessage(SFTPv3Client.java:203)
      		at com.trilead.ssh2.SFTPv3Client.sendMessage(SFTPv3Client.java:208)
      		at com.trilead.ssh2.SFTPv3Client.closeHandle(SFTPv3Client.java:269)
      		at com.trilead.ssh2.SFTPv3Client.closeFile(SFTPv3Client.java:1379)
      		at com.trilead.ssh2.jenkins.SFTPClient$SFTPOutputStream.close(SFTPClient.java:150)
      		at hudson.plugins.sshslaves.SSHLauncher.copyAgentJar(SSHLauncher.java:1099)
      		... 7 more
      	Caused by: java.io.IOException: The connection is being shutdown
      		at com.trilead.ssh2.channel.ChannelManager.handleEndMessage(ChannelManager.java:1525)
      		at com.trilead.ssh2.transport.TransportManager$1.run(TransportManager.java:535)
      		... 1 more
      	Caused by: java.net.SocketException: Connection reset
      		at java.net.SocketInputStream.read(SocketInputStream.java:210)
      		at java.net.SocketInputStream.read(SocketInputStream.java:141)
      		at com.trilead.ssh2.crypto.cipher.CipherInputStream.fill_buffer(CipherInputStream.java:41)
      		at com.trilead.ssh2.crypto.cipher.CipherInputStream.internal_read(CipherInputStream.java:52)
      		at com.trilead.ssh2.crypto.cipher.CipherInputStream.getBlock(CipherInputStream.java:79)
      		at com.trilead.ssh2.crypto.cipher.CipherInputStream.read(CipherInputStream.java:108)
      		at com.trilead.ssh2.transport.TransportConnection.receiveMessage(TransportConnection.java:232)
      		at com.trilead.ssh2.transport.TransportManager.receiveLoop(TransportManager.java:706)
      		at com.trilead.ssh2.transport.TransportManager$1.run(TransportManager.java:502)
      		... 1 more
      [12/11/18 23:30:22] Launch failed - cleaning up connection
      [12/11/18 23:30:22] [SSH] Connection closed.
      

        Attachments

          Activity

          Hide
          ifernandezcalvo Ivan Fernandez Calvo added a comment -

          Is it happening on every Mac Agent or only on one? you paste a configuration that uses Java 11, it is officially not supported yet (is in progress)

          The slave.jar file changed to remoting.jar file on slaves-ssh-plugin 1.27 https://github.com/jenkinsci/ssh-slaves-plugin/blob/master/CHANGELOG.md#127-aug-26-2018, on your agent, it is failing to create the file check that the user you use to connect with Jenkins has permission to write on /Users/jenkins/.jenkins, also check that you have disk space on the volume contains that folder.

          Caused by: java.io.IOException: Could not copy remoting.jar to '/Users/jenkins/.jenkins/remoting.jar' on agent
          at hudson.plugins.sshslaves.SSHLauncher.copyAgentJar(SSHLauncher.java:1104)
          ... 7 more
          Caused by: java.io.IOException: Unexpected end of sftp stream.
          

          I use Mac OS agents on daily basis, so it works.
          Test if you can copy the file from you Jenkins master (war/WEB-INF/lib/remoting-3.27.jar) in the same place with the same user Jenkins connects.

          Show
          ifernandezcalvo Ivan Fernandez Calvo added a comment - Is it happening on every Mac Agent or only on one? you paste a configuration that uses Java 11, it is officially not supported yet (is in progress) The slave.jar file changed to remoting.jar file on slaves-ssh-plugin 1.27 https://github.com/jenkinsci/ssh-slaves-plugin/blob/master/CHANGELOG.md#127-aug-26-2018 , on your agent, it is failing to create the file check that the user you use to connect with Jenkins has permission to write on /Users/jenkins/.jenkins, also check that you have disk space on the volume contains that folder. Caused by: java.io.IOException: Could not copy remoting.jar to '/Users/jenkins/.jenkins/remoting.jar' on agent at hudson.plugins.sshslaves.SSHLauncher.copyAgentJar(SSHLauncher.java:1104) ... 7 more Caused by: java.io.IOException: Unexpected end of sftp stream. I use Mac OS agents on daily basis, so it works. Test if you can copy the file from you Jenkins master (war/WEB-INF/lib/remoting-3.27.jar) in the same place with the same user Jenkins connects.

            People

            • Assignee:
              ifernandezcalvo Ivan Fernandez Calvo
              Reporter:
              swordpoint Alan Uthoff
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: