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

After upgrade to 2.358 - ec2 agents are not launched

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Blocker Blocker
    • ec2-plugin
    • None

      Looks like something goes wrong when the jenkins master trying to bring new nodes up,

      here is the log of the jenkins node launching:

       

      Complete!
      Jul 07, 2022 2:44:50 PM hudson.plugins.ec2.EC2Cloud
      INFO: Verifying: which scp
      /usr/bin/scp
      Jul 07, 2022 2:44:50 PM hudson.plugins.ec2.EC2Cloud
      INFO: Copying remoting.jar to: /tmp
      Jul 07, 2022 2:44:50 PM hudson.plugins.ec2.EC2Cloud
      INFO: Launching remoting agent (via Trilead SSH2 Connection):  java  -jar /tmp/remoting.jar -workDir /home/ec2-user/jenkins
      <===[JENKINS REMOTING CAPACITY]===>ERROR: Remote call on EC2 (AWS) - my_node (sir-vjgyde5k) failed
      java.io.IOException: Remote call on EC2 (AWS) - my_node (sir-vjgyde5k) failed
          at hudson.remoting.Channel.call(Channel.java:1004)
          at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:660)
          at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:438)
          at hudson.plugins.ec2.ssh.EC2UnixLauncher.launchScript(EC2UnixLauncher.java:282)
          at hudson.plugins.ec2.EC2ComputerLauncher.launch(EC2ComputerLauncher.java:48)
          at hudson.slaves.SlaveComputer.lambda$_connect$0(SlaveComputer.java:298)
          at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:48)
          at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:82)
          at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
          at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
          at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
          at java.base/java.lang.Thread.run(Thread.java:833)
      Caused by: java.lang.UnsupportedClassVersionError: Failed to load hudson.slaves.SlaveComputer$SlaveVersion
          at hudson.remoting.RemoteClassLoader.loadClassFile(RemoteClassLoader.java:460)
          at hudson.remoting.RemoteClassLoader.loadRemoteClass(RemoteClassLoader.java:292)
          at hudson.remoting.RemoteClassLoader.loadWithMultiClassLoader(RemoteClassLoader.java:269)
          at hudson.remoting.RemoteClassLoader.findClass(RemoteClassLoader.java:228)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
          at java.lang.Class.forName0(Native Method)
          at java.lang.Class.forName(Class.java:348)
          at hudson.remoting.MultiClassLoaderSerializer$Input.resolveClass(MultiClassLoaderSerializer.java:132)
          at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1985)
          at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1849)
          at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2159)
          at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1666)
          at java.io.ObjectInputStream.readObject(ObjectInputStream.java:502)
          at java.io.ObjectInputStream.readObject(ObjectInputStream.java:460)
          at hudson.remoting.UserRequest.deserialize(UserRequest.java:289)
          at hudson.remoting.UserRequest.perform(UserRequest.java:189)
          at hudson.remoting.UserRequest.perform(UserRequest.java:54)
          at hudson.remoting.Request$2.run(Request.java:376)
          at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
          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)
          Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to EC2 (AWS) - my_node (sir-vjgyde5k)
              at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1784)
              at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
              at hudson.remoting.Channel.call(Channel.java:1000)
              at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:660)
              at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:438)
              at hudson.plugins.ec2.ssh.EC2UnixLauncher.launchScript(EC2UnixLauncher.java:282)
              at hudson.plugins.ec2.EC2ComputerLauncher.launch(EC2ComputerLauncher.java:48)
              at hudson.slaves.SlaveComputer.lambda$_connect$0(SlaveComputer.java:298)
              at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:48)
              at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:82)
              at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
              at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
              at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
              at java.base/java.lang.Thread.run(Thread.java:833)
      Caused by: java.lang.UnsupportedClassVersionError: hudson/slaves/SlaveComputer$SlaveVersion has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
          at java.lang.ClassLoader.defineClass1(Native Method)
          at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
          at java.lang.ClassLoader.defineClass(ClassLoader.java:635)
          at hudson.remoting.RemoteClassLoader.loadClassFile(RemoteClassLoader.java:458)
          ... 23 more
      ERROR: Connection terminated
      java.io.EOFException
          at java.base/java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2926)
          at java.base/java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:3421)
          at java.base/java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:959)
          at java.base/java.io.ObjectInputStream.<init>(ObjectInputStream.java:397)
          at hudson.remoting.ObjectInputStreamEx.<init>(ObjectInputStreamEx.java:49)
          at hudson.remoting.Command.readFrom(Command.java:142)
          at hudson.remoting.Command.readFrom(Command.java:128)
          at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:35)
          at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:61)
      Caused: java.io.IOException: Unexpected termination of the channel
          at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:75)HTTP ERROR 404 Not Found 

      an upgrade to 2.357 also caused a similar error

      its happening with all the images i tried:

      2.358-jdk17

      2.358-jdk11

      2.358

      2.357-jdk11

       

          [JENKINS-68946] After upgrade to 2.358 - ec2 agents are not launched

          Mark Waite added a comment -

          I suspect a configuration error more than a bug in Jenkins. I suspect that the EC2 image where you're trying to run the Jenkins agent is running Java 8 rather than Java 11. You'll need to change the configuration of that image so that it runs Java 11 instead of running Java 8.

          Mark Waite added a comment - I suspect a configuration error more than a bug in Jenkins. I suspect that the EC2 image where you're trying to run the Jenkins agent is running Java 8 rather than Java 11. You'll need to change the configuration of that image so that it runs Java 11 instead of running Java 8.

          Ofir added a comment - - edited

          markewaite 

          Hi Mark,

          the ec2-plugin does the java installation, so perhaps its a bug in the ec2-plugin - because it always installs the java 8.

          I have no idea how to configure the ec2-plugin to install java 11 instead of java 8.

          does some here knows how to do it ?

          Ofir added a comment - - edited markewaite   Hi Mark, the ec2-plugin does the java installation, so perhaps its a bug in the ec2-plugin - because it always installs the java 8. I have no idea how to configure the ec2-plugin to install java 11 instead of java 8. does some here knows how to do it ?

          Mark Waite added a comment - - edited

          As far as I can tell from the EC2 plugin documentation, it does not install Java on its own. The documentation says

          Init script is the shell script to be run on the newly launched EC2 instance, before Jenkins starts launching a agent agent. If the AMI doesn't have Java pre-installed, you can do this in the init script. This is also a good place to install additional packages that you need for your builds and tests

          Mark Waite added a comment - - edited As far as I can tell from the EC2 plugin documentation , it does not install Java on its own. The documentation says Init script is the shell script to be run on the newly launched EC2 instance, before Jenkins starts launching a agent agent. If the AMI doesn't have Java pre-installed, you can do this in the init script. This is also a good place to install additional packages that you need for your builds and tests

          Ofir added a comment - - edited

           

          Issue resolved:

          as markewaite  suggested: the issue was resolved by replacing the AMI with a new AMI that have java11 installed on it. 

           

          it seems that if there is no java installed on the ec2 nodes, then the ec2-plugin install java 8 on the node, which is no longer supported since version 2.357.

          Thanks

          Ofir added a comment - - edited   Issue resolved: as markewaite   suggested: the issue was resolved by replacing the AMI with a new AMI that have java11 installed on it.     it seems that if there is no java installed on the ec2 nodes, then the ec2-plugin install java 8 on the node, which is no longer supported since version 2.357. Thanks

            Unassigned Unassigned
            ofiry Ofir
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: