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

Unable to Connect to Agents after upgrade to 1822.v87175d209b_b_5

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • ec2-plugin
    • None

      Unable to Connect to Agents after upgrade to 1822.v87175d209b_b_5 
      plugin logs are given below,

      java.io.EOFException: unexpected stream termination at hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:478) at hudson.remoting.ChannelBuilder.build(ChannelBuilder.java:422) at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:440) at PluginClassLoader for ec2//hudson.plugins.ec2.ssh.EC2UnixLauncher.launchRemotingAgent(EC2UnixLauncher.java:453) at PluginClassLoader for ec2//hudson.plugins.ec2.ssh.EC2UnixLauncher.launchScript(EC2UnixLauncher.java:402) at PluginClassLoader for ec2//hudson.plugins.ec2.EC2ComputerLauncher.launch(EC2ComputerLauncher.java:55) at hudson.slaves.SlaveComputer.lambda$_connect$0(SlaveComputer.java:297) at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46) at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:80) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang.Thread.run(Thread.java:1583)

          [JENKINS-75187] Unable to Connect to Agents after upgrade to 1822.v87175d209b_b_5

          Rammanokar created issue -
          Jean-Marc Desprez made changes -
          Assignee Original: FABRIZIO MANFREDI [ thoulen ] New: Jean-Marc Desprez [ jmdesprez ]
          Jean-Marc Desprez made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

          I'm also running into this bug when I upgraded.

          The only thing that I'll add is that my logs include the following line in addition the error message posted above.

          Error: Unable to access jarfile /tmp/remoting.jar

           
          I don't know is this helps at all.

          Henry Borchers added a comment - I'm also running into this bug when I upgraded. The only thing that I'll add is that my logs include the following line in addition the error message posted above. Error: Unable to access jarfile /tmp/remoting.jar   I don't know is this helps at all.

          bjbishop added a comment -

          I've tried updating the temporary directory to something other than /tmp and it didn't make a difference.  It seems it's unable to detect the scp executable or has some trouble running it to copy the remoting.jar over to the node.

           

          Rolling back this plugin fixed that issue right away and the logs with the rolled back plugin show it's copying correctly:

          INFO: Verifying: which scp
          /usr/bin/scp
          Jan 24, 2025 10:38:44 AM hudson.plugins.ec2.EC2Cloud
          INFO: Copying remoting.jar to: /tmp 

          which wasn't being shown before.

          bjbishop added a comment - I've tried updating the temporary directory to something other than /tmp and it didn't make a difference.  It seems it's unable to detect the scp executable or has some trouble running it to copy the remoting.jar over to the node.   Rolling back this plugin fixed that issue right away and the logs with the rolled back plugin show it's copying correctly: INFO: Verifying: which scp /usr/bin/scp Jan 24, 2025 10:38:44 AM hudson.plugins.ec2.EC2Cloud INFO: Copying remoting.jar to: /tmp which wasn't being shown before.

          Jeff added a comment -

          Pretty sure broken in: https://github.com/jenkinsci/ec2-plugin/pull/1022

          Looks like the unix agent change only pushes agent as part of script init.

          You can try adding something to the scripts init section to trigger that part of the code.  Theory

          Jeff added a comment - Pretty sure broken in: https://github.com/jenkinsci/ec2-plugin/pull/1022 Looks like the unix agent change only pushes agent as part of script init. You can try adding something to the scripts init section to trigger that part of the code.  Theory

          Ana Trakhtman added a comment - - edited

          Having same issue. 

          ssh -o StrictHostKeyChecking=accept-new -o "UserKnownHostsFile=/tmp/ec2_2865626304991671756_known_hosts" -o "HostKeyAlgorithms=ecdsa-sha2-nistp256" -i /tmp/ec2_9176542016464751743.pem ubuntu@172.31.7.4 -p 22 /usr/bin/java -jar /tmp/remoting.jar -workDir /home/ubuntu Failed to add the host to the list of known hosts (/tmp/ec2_2865626304991671756_known_hosts).
           
          Error: Unable to access jarfile /tmp/remoting.jar ERROR: Unable to launch the agent for EC2 (aws-ec2) - light-weight-tasks (sir-5xm71tjh) java.io.EOFException: unexpected stream termination at hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:478) at hudson.remoting.ChannelBuilder.build(ChannelBuilder.java:422) at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:440) at PluginClassLoader for command-launcher//hudson.slaves.CommandLauncher.launch(CommandLauncher.java:188) at PluginClassLoader for ec2//hudson.plugins.ec2.ssh.EC2UnixLauncher.launchScript(EC2UnixLauncher.java:392) at PluginClassLoader for ec2//hudson.plugins.ec2.EC2ComputerLauncher.launch(EC2ComputerLauncher.java:55) at hudson.slaves.SlaveComputer.lambda$_connect$0(SlaveComputer.java:297) at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46) at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:80) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang.Thread.run(Thread.java:1583)

          Ana Trakhtman added a comment - - edited Having same issue.  ssh -o StrictHostKeyChecking=accept- new -o "UserKnownHostsFile=/tmp/ec2_2865626304991671756_known_hosts" -o "HostKeyAlgorithms=ecdsa-sha2-nistp256" -i /tmp/ec2_9176542016464751743.pem ubuntu@172.31.7.4 -p 22 /usr/bin/java -jar /tmp/remoting.jar -workDir /home/ubuntu Failed to add the host to the list of known hosts (/tmp/ec2_2865626304991671756_known_hosts).   Error: Unable to access jarfile /tmp/remoting.jar ERROR: Unable to launch the agent for EC2 (aws-ec2) - light-weight-tasks (sir-5xm71tjh) java.io.EOFException: unexpected stream termination at hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:478) at hudson.remoting.ChannelBuilder.build(ChannelBuilder.java:422) at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:440) at PluginClassLoader for command-launcher //hudson.slaves.CommandLauncher.launch(CommandLauncher.java:188) at PluginClassLoader for ec2//hudson.plugins.ec2.ssh.EC2UnixLauncher.launchScript(EC2UnixLauncher.java:392) at PluginClassLoader for ec2//hudson.plugins.ec2.EC2ComputerLauncher.launch(EC2ComputerLauncher.java:55) at hudson.slaves.SlaveComputer.lambda$_connect$0(SlaveComputer.java:297) at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46) at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:80) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang. Thread .run( Thread .java:1583)

          > Looks like the unix agent change only pushes agent as part of script init

           

          Yes, a typo has been introduced in this PR. A possible workaround would be to not have an empty init script (it must contain a command, not just spaces). If the init script is empty, `/tmp/remoting.jar` is not copied to the remote machine.

           

          I'm also investigating a possible problem with the key. 

          Jean-Marc Desprez added a comment - > Looks like the unix agent change only pushes agent as part of script init   Yes, a typo has been introduced in this PR. A possible workaround would be to not have an empty init script (it must contain a command, not just spaces). If the init script is empty, `/tmp/remoting.jar` is not copied to the remote machine.   I'm also investigating a possible problem with the key. 
          Basil Crow made changes -
          Link New: This issue is caused by JENKINS-75011 [ JENKINS-75011 ]
          Basil Crow made changes -
          Link New: This issue is duplicated by JENKINS-75198 [ JENKINS-75198 ]

            jmdesprez Jean-Marc Desprez
            rammanokar Rammanokar
            Votes:
            8 Vote for this issue
            Watchers:
            17 Start watching this issue

              Created:
              Updated:
              Resolved: