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) -

          Tanuj Soni created issue -
          Tanuj Soni made changes -
          Assignee Original: FABRIZIO MANFREDI [ thoulen ] New: Paul Weber [ 000panther ]
          Tanuj Soni made changes -
          Description Original: We are trying this steps to configuring slaves for Jenkins
           * We're using Ubuntu base images
           * Java is not installed by default but we're installing it via cloud-init scripts
           * 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/]
          New: We are trying this steps to configuring slaves for Jenkins
           * We're using Ubuntu base images
           * Java is not installed by default but we're installing it via cloud-init scripts
           * 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/



          `|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)
          ```
          Tanuj Soni made changes -
          Description Original: We are trying this steps to configuring slaves for Jenkins
           * We're using Ubuntu base images
           * Java is not installed by default but we're installing it via cloud-init scripts
           * 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/



          `|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)
          ```
          New: We are trying this steps to configuring slaves for Jenkins
           * We're using Ubuntu base images
           * Java is not installed by default but we're installing it via cloud-init scripts
           * 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/

          `|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)
           ```
          Tanuj Soni made changes -
          Description Original: We are trying this steps to configuring slaves for Jenkins
           * We're using Ubuntu base images
           * Java is not installed by default but we're installing it via cloud-init scripts
           * 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/

          `|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)
           ```
          New: We are trying this steps to configuring slaves for Jenkins
           * We're using Ubuntu base images
           * Java is not installed by default but we're installing it via cloud-init scripts
           * 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)
           ```
          Tanuj Soni made changes -
          Attachment Original: Screenshot from 2021-12-08 19-49-46.png [ 56914 ]
          Tanuj Soni made changes -
          Description Original: We are trying this steps to configuring slaves for Jenkins
           * We're using Ubuntu base images
           * Java is not installed by default but we're installing it via cloud-init scripts
           * 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)
           ```
          New: We have a native Cloud configuration for our slaves ( Ubuntu 20.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 ( 20.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/
          ]
          {quote}$ 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)


          {quote}
          Tanuj Soni made changes -
          Assignee Original: Paul Weber [ 000panther ] New: FABRIZIO MANFREDI [ thoulen ]
          Tanuj Soni made changes -
          Assignee Original: FABRIZIO MANFREDI [ thoulen ] New: Allen Polak [ 00500005 ]
          Tanuj Soni made changes -
          Description Original: We have a native Cloud configuration for our slaves ( Ubuntu 20.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 ( 20.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/
          ]
          {quote}$ 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)


          {quote}
          New: We have a native Cloud configuration for our slaves ( Ubuntu 20.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 ( 20.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/] ]
          {quote}$ 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)
          {quote}

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

              Created:
              Updated: