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

bash: java: command not found ERROR: Unable to launch the agent for EC2 (AWS) -

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • ec2-plugin
    • Jenkins version : 2.302
      Ec2 Plugin version: 1.66

      We have a native Cloud configuration for our slaves ( Ubuntu 18.04 ). We are self provisioning with a cloud script ( Installing Java JVM ). 

      While Jenkins master connects to the slaves, it detects that java is not installed and it crashes. But if we manually hit the  "re-launch agent" button after the cloud-init script is done as when the java has been installed then its works fine. 

      What we are expecting here is, it shouldn't crashes instead keep trying to connect to the slave like after 1 min, maybe 30 sec or till then it detects java installation

      We are trying this steps to configuring slaves for Jenkins

      • We're using Ubuntu base images ( 18.04 )
      • Java is not installed by default but we're installing it via cloud-init scripts  ( Java version 8 )
      • If we click on "re-launch slave" after the cloud-init script is done, it's working fine.
         

      the plugin is the EC2 plugin [ https://plugins.jenkins.io/ec2/ ]

      $ ssh -o StrictHostKeyChecking=no -i /tmp/file.pem ubuntu@<IP> -p 22 java -jar /tmp/remoting.jar -workDir /home/ubuntu Warning: Permanently added '<IP>' (ECDSA) to the list of known hosts. bash: java: command not found ERROR: Unable to launch the agent for EC2 (AWS) - CI Worker (i-09a5d4d5a6da6c01e) 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:426) at hudson.slaves.CommandLauncher.launch(CommandLauncher.java:165) at hudson.plugins.ec2.ssh.EC2UnixLauncher.launchScript(EC2UnixLauncher.java:262) at hudson.plugins.ec2.EC2ComputerLauncher.launch(EC2ComputerLauncher.java:48) at hudson.slaves.SlaveComputer.lambda$_connect$0(SlaveComputer.java:295) at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46) at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:80) 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)

          [JENKINS-67327] bash: java: command not found ERROR: Unable to launch the agent for EC2 (AWS) -

          Mark Waite added a comment -

          tsoni please don't use the issue tracker to request help with a configuration issue. The Jenkins user mailing list, Jenkins community forum, and Jenkins chat channels have many more readers and many more people who are available to help.

          Mark Waite added a comment - tsoni please don't use the issue tracker to request help with a configuration issue. The Jenkins user mailing list , Jenkins community forum , and Jenkins chat channels have many more readers and many more people who are available to help.

          Tanuj Soni added a comment -

          markewaite Hello Mark 

          That is not a configuration issue but a bug -  the slave launcher crashes, and we need to manually re-launch the agent ( when init script is done ) to have the slave connected.

          We are expecting that it shouldn't crash when ssh it should have wait and retry again  and again to have slave connected 

           Also this is not an issue  when we used OpenStack connector. When launching slaves, the OS connector retries over and over again until it works

          Tanuj Soni added a comment - markewaite  Hello Mark  That is not a configuration issue but a bug -  the slave launcher crashes, and we need to manually re-launch the agent ( when init script is done ) to have the slave connected. We are expecting that it shouldn't crash when ssh it should have wait and retry again  and again to have slave connected   Also this is not an issue  when we used OpenStack connector. When launching slaves, the OS connector retries over and over again until it works

          Mark Waite added a comment -

          tsoni you've chosen to ignore my advice to ask questions in locations that have more people viewing them, then you ask if I have a workaround for the question you asked.  That is surprising.

          I don't have a workaround for the question that you asked.

          Yes, I accept that you can report it as a bug because in Jerry Weinberg's definition, it "bugs someone".  However, I think your goal was to find an answer, not just report a bug.

          Mark Waite added a comment - tsoni  you've chosen to ignore my advice to ask questions in locations that have more people viewing them, then you ask if I have a workaround for the question you asked.  That is surprising. I don't have a workaround for the question that you asked. Yes, I accept that you can report it as a bug because in Jerry Weinberg's definition, it "bugs someone".  However, I think your goal was to find an answer, not just report a bug.

            00500005 Allen Polak
            tsoni Tanuj Soni
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: