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

ec2 agents fail to connect without explicit remote FS root declaration

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: ec2-plugin, remoting
    • Labels:
      None
    • Environment:
      Jenkins 2.182
      ec2-plugin 1.44
      Linux master and agents
      Java 8
    • Similar Issues:

      Description

      After upgrading ec2 plugin to 1.44 (from 1.43) and Jenkins to 2.182 (from 2.181), EC2 agents failed to connect with an error from agent jar about workDir requiring an argument.
      The ec2 configuration I had did not specify any remote FS root (i.e. workDir). I had to explicitly declare the remote FS root for each ec2 pool I have to make them work again.

      Expected behavior: Empty remote FS root should default to what it used to default to (user home).

      2019-06-24 12:45:51.417+0000 [id=111]   INFO    hudson.plugins.ec2.EC2Cloud#log: Copying remoting.jar to: /tmp
      2019-06-24 12:45:51.683+0000 [id=27]    INFO    o.j.main.modules.sshd.SSHD#start: Started SSHD at port 2222
      2019-06-24 12:45:52.323+0000 [id=111]   INFO    hudson.plugins.ec2.EC2Cloud#log: Launching remoting agent (via SSH client process): ssh -o StrictHostKeyChecking=no -i /tmp/ec2_7971206362067266819.pem root@10.21.211.212 -p 22  java -Djava.awt.headless=true -jar /tmp/remoting.jar -workDir
      2019-06-24 12:45:52.998+0000 [id=111]   SEVERE  hudson.slaves.CommandLauncher#launch: Unable to launch the agent for EC2 (Jenkins) - AWS Agent (i-bleblehbleh)
      java.io.EOFException: unexpected stream termination
              at hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:415)
              at hudson.remoting.ChannelBuilder.build(ChannelBuilder.java:360)
              at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:431)
              at hudson.slaves.CommandLauncher.launch(CommandLauncher.java:154)
              at hudson.plugins.ec2.ssh.EC2UnixLauncher.launchScript(EC2UnixLauncher.java:252)
              at hudson.plugins.ec2.EC2ComputerLauncher.launch(EC2ComputerLauncher.java:48)
              at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:294)
              at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
              at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:71)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:745)
      

      Note that I attempted the same without ssh client process, and the result was the same.

        Attachments

          Issue Links

            Activity

            Show
            zbynek Zbynek Konecny added a comment - Likely caused by https://github.com/jenkinsci/ec2-plugin/pull/352/files
            Show
            raihaan Raihaan Shouhell added a comment - can you try the build from  https://repo.jenkins-ci.org/incrementals/org/jenkins-ci/plugins/ec2/1.45-rc980.7e1580e3f8d5/   Its the build from https://github.com/jenkinsci/ec2-plugin/pull/373
            Hide
            djan Can Yildiz added a comment -

            Fix works as intended. Thank you folks

            Show
            djan Can Yildiz added a comment - Fix works as intended. Thank you folks

              People

              • Assignee:
                raihaan Raihaan Shouhell
                Reporter:
                djan Can Yildiz
              • Votes:
                1 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: