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

Error connecting slave using SSH Plugin

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: ssh-slaves-plugin
    • Labels:
      None
    • Environment:
      Jenkins Version 2.150.3
      SSH Slaves Plugin - 1.29.4
      OpenJDK 1.8.0_171 - Master
      OpenJDK 1.8.0_191 - Slave
      Red Hat Enterprise Linux Server release 7.4 - Master
      Red Hat Enterprise Linux Server release 7.3 - Slave
    • Similar Issues:

      Description

      Apr 17, 2019 2:16:23 PM INFO hudson.remoting.SynchronousCommandTransport$ReaderThread run
      When attempting to connect a slave using "Launch Agent via SSH" getting the following error.
      
      [04/17/19 16:27:27] [SSH] Checking java version of /u01/app/jenkinswork/jdk/bin/java
      [04/17/19 16:27:28] [SSH] /u01/app/jenkinswork/jdk/bin/java -version returned 1.8.0_191.
      [04/17/19 16:27:28] [SSH] Starting sftp client.
      [04/17/19 16:27:28] [SSH] Copying latest remoting.jar...
      [04/17/19 16:27:28] [SSH] Copied 776,717 bytes.
      Expanded the channel window size to 4MB
      [04/17/19 16:27:28] [SSH] Starting agent process: cd "/u01/app/jenkinswork" && /u01/app/jenkinswork/jdk/bin/java -jar remoting.jar -workDir /u01/app/jenkinswork
      Apr 17, 2019 4:27:28 PM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
      INFO: Using /u01/app/jenkinswork/remoting as a remoting work directory
      Both error and output logs will be printed to /u01/app/jenkinswork/remoting
      <===[JENKINS REMOTING CAPACITY]===>channel started
      Remoting version: 3.27
      This is a Unix agent
      Evacuated stdout
      Slave JVM has not reported exit code. Is it still running?
      [04/17/19 16:27:33] Launch failed - cleaning up connection
      [04/17/19 16:27:33] [SSH] Connection closed.
      ERROR: Connection terminated
      java.io.EOFException
       at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2678)
       at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:3153)
       at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:861)
       at java.io.ObjectInputStream.<init>(ObjectInputStream.java:357)
       at hudson.remoting.ObjectInputStreamEx.<init>(ObjectInputStreamEx.java:49)
       at hudson.remoting.Command.readFrom(Command.java:140)
       at hudson.remoting.Command.readFrom(Command.java:126)
       at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:36)
       at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:63)
      Caused: java.io.IOException: Unexpected termination of the channel
       at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:77)
      

       

      Slave log shows:

      hudson.remoting.SynchronousCommandTransport$ReaderThread run
      INFO: I/O error in channel channel
      java.io.IOException: Unexpected termination of the channel
       at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:77)
      Caused by: java.io.EOFException
       at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2680)
       at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:3155)
       at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:861)
       at java.io.ObjectInputStream.<init>(ObjectInputStream.java:357)
       at hudson.remoting.ObjectInputStreamEx.<init>(ObjectInputStreamEx.java:49)
       at hudson.remoting.Command.readFrom(Command.java:140)
       at hudson.remoting.Command.readFrom(Command.java:126)
       at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:36)
       at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:63)
      

        Attachments

          Activity

          Hide
          ifernandezcalvo Ivan Fernandez Calvo added a comment -

          Could you attach the whole Agent log (http://jenkins.example.com/computer/NODENAME/log)?
          Did you check the troubleshooting guide?
          In order to have the whole context I need the info I describe at Common info needed to troubleshooting a bug
          Did you check the SSHD service logs? try to increase the verbosity by setting `LogLevel VERBOSE` or `LogLevel DEBUG1` on your /etc/ssh/sshd_config file and see Logging_and_Troubleshooting

          Show
          ifernandezcalvo Ivan Fernandez Calvo added a comment - Could you attach the whole Agent log ( http://jenkins.example.com/computer/NODENAME/log)? Did you check the troubleshooting guide ? In order to have the whole context I need the info I describe at Common info needed to troubleshooting a bug Did you check the SSHD service logs? try to increase the verbosity by setting `LogLevel VERBOSE` or `LogLevel DEBUG1` on your /etc/ssh/sshd_config file and see Logging_and_Troubleshooting
          Hide
          skirk Shane Kirk added a comment -

          I finally figured this out. For anyone else that might encounter something similar.  I ended up connecting the slave via "command on the master" and writing a shell script that ssh'd to the server and kicked off the remoting.jar file.  I was then able to see the following error:

           

          Unable to launch the agent for *************
          java.io.IOException: Invalid encoded sequence encountered: 3D 3D 5B 4A 45 4E 4B 49 4E 53 20 52 45 4D 4F 54 49 4E 47 20 43 41 50 41 43 49 54 59 5D 3D 3D 3D 3E 72 4F 30 41 42 58 4E 79 41 42 70 6F 64 57 52 7A 62 32 34 75 63 6D 56 74 62 33 52 70 62 6D 63 75 51 32 46 77 59 57 4A 70 62 47 6C 30 65 51 41 41 41 41 41 41 41 41 41 42 41 67 41 42 53 67 41 45 62 57 46 7A 61 33 68 77 41 41 41 41 41 41 41 41 41 66 34

           

          That led me down another path which involved me wiping out the workspace on the slave.  After deleting the workspace, the slave started up via SSH fine.

           

          This issue can be closed.  thanks!

          Show
          skirk Shane Kirk added a comment - I finally figured this out. For anyone else that might encounter something similar.  I ended up connecting the slave via "command on the master" and writing a shell script that ssh'd to the server and kicked off the remoting.jar file.  I was then able to see the following error:   Unable to launch the agent for ************* java.io.IOException: Invalid encoded sequence encountered: 3D 3D 5B 4A 45 4E 4B 49 4E 53 20 52 45 4D 4F 54 49 4E 47 20 43 41 50 41 43 49 54 59 5D 3D 3D 3D 3E 72 4F 30 41 42 58 4E 79 41 42 70 6F 64 57 52 7A 62 32 34 75 63 6D 56 74 62 33 52 70 62 6D 63 75 51 32 46 77 59 57 4A 70 62 47 6C 30 65 51 41 41 41 41 41 41 41 41 41 42 41 67 41 42 53 67 41 45 62 57 46 7A 61 33 68 77 41 41 41 41 41 41 41 41 41 66 34   That led me down another path which involved me wiping out the workspace on the slave.  After deleting the workspace, the slave started up via SSH fine.   This issue can be closed.  thanks!
          Hide
          ifernandezcalvo Ivan Fernandez Calvo added a comment -

          I wonder which files cause it, Do you have the whole `java.io.IOException: Invalid encoded sequence encountered:` stack trace? I've added it to the troubleshooting guide Corrupt agent workdir folder

          Show
          ifernandezcalvo Ivan Fernandez Calvo added a comment - I wonder which files cause it, Do you have the whole `java.io.IOException: Invalid encoded sequence encountered:` stack trace? I've added it to the troubleshooting guide Corrupt agent workdir folder

            People

            • Assignee:
              skirk Shane Kirk
              Reporter:
              skirk Shane Kirk
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: