Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-16605

Elastic instance startup scripts fail to run with "Unsupported major.minor version 52.0"

      Steps to reproduce

      1. Start an instance with Bamboo 5.10-OD-05-003.
      2. Configure Elastic Bamboo.
      3. Edit the Stock Ubuntu image (AMI ID ami-55f5a530) and add an instance startup script (it can be anything, even just ls -l /).
      4. Start a new instance using that image.

      Expected results

      The instance starts up and the startup script is run.

      Actual results

      The instances starts up but the startup scripts fail to run. In the EC2 console logs in Bamboo, you can see the following lines:

      [...]
      [   93.920614] cloud-init[944]: Generating locales...
      [   94.628812] cloud-init[944]: en_US.UTF-8... up-to-date
      [   94.644366] cloud-init[944]: Generation complete.
      
      
      Ubuntu 15.04 ip-10-170-56-202 hvc0
      
      ip-10-170-56-202 login: [   99.115032] cloud-init[944]: Cloud-init v. 0.7.7 running 'modules:config' at Mon, 02 Nov 2015 04:41:15 +0000. Up 91.14 seconds.
      [  109.360346] cloud-init[1030]: Host ip-10-170-56-202 resolves OK.
      [  109.383856] cloud-init[1030]: mount: /dev/xvdb is already mounted or /mnt busy
      [  109.384496] cloud-init[1030]: /dev/xvdb is already mounted on /mnt
      [  109.386569] cloud-init[1030]: Making ephemeral storage available also at /media/ephemeral0...
      [  109.389250] cloud-init[1030]: Adding /media/ephemeral0 to fstab...
      [  110.137941] cloud-init[1030]: /home succesfully redirected to ephemeral storage at /mnt.
      [  110.138429] cloud-init[1030]: Restarting Docker...
      [  115.743758] cloud-init[1030]: Running startup scripts...
      [  122.243703] cloud-init[1030]: Exception in thread "main" java.lang.UnsupportedClassVersionError: com/atlassian/bamboo/agent/elastic/startup/RunStartupScripts : Unsupported major.minor version 52.0
      [  122.244443] cloud-init[1030]: at java.lang.ClassLoader.defineClass1(Native Method)
      [  122.244995] cloud-init[1030]: at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
      [  122.245401] cloud-init[1030]: at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
      [  122.245801] cloud-init[1030]: at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
      [  122.246213] cloud-init[1030]: at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
      [  122.246709] cloud-init[1030]: at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
      [  122.247281] cloud-init[1030]: at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      [  122.247923] cloud-init[1030]: at java.security.AccessController.doPrivileged(Native Method)
      [  122.248445] cloud-init[1030]: at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      [  122.248934] cloud-init[1030]: at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
      [  122.249409] cloud-init[1030]: at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
      [  122.249807] cloud-init[1030]: at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
      [  122.250200] cloud-init[1030]: at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
      [  122.253242] cloud-init[1030]: Starting Elastic Bamboo Agent...
      [  127.257462] cloud-init[1030]: Syncing Elastic Bamboo Agent files...
      [  127.258014] cloud-init[1030]: 2015-11-02 04:41:47,478 INFO [main] [S3Sync] Syncing from: bamboo-agent-release-us-e1/5.10-OD-05-003/d65286746e6b59f0cd8811ae3dfad6b4e772d230ffd1a019b331e6de0ab7fe4a/ to /opt/bamboo-elastic-agent
      [  127.299321] cloud-init[1030]: Copying SSH config of cloud-init user ubuntu to /home/ec2-user/.ssh
      [  127.299882] cloud-init[1030]: /home/ec2-user/.ssh already exists, using it.
      [...]
      

      Notes

      This only started with the release of 5.10-OD-05.

      Workaround

      Please raise a support request at support.atlassian.com in the Atlassian Cloud project and we can apply the manual fix to your instance. It will update the AMIs of the stock images to point to the correct image, and you'll just need to spin up a new elastic image afterwards (any currently-running images will be using the old AMIs).

            [BAM-16605] Elastic instance startup scripts fail to run with "Unsupported major.minor version 52.0"

            This was fixed by support for us several days ago, but now appears to be back:

            https://support.atlassian.com/servicedesk/customer/portal/23/JST-165941

            Garret_Pick added a comment - This was fixed by support for us several days ago, but now appears to be back: https://support.atlassian.com/servicedesk/customer/portal/23/JST-165941

            greganth added a comment -

            HI Kevin,

            If you're using EBS with Bamboo (https://confluence.atlassian.com/bamboo/configuring-elastic-instances-to-use-the-ebs-289277121.html), the initialization creates some scripts on the volume which are run during the slave startup. For me, JAVA_HOME was set in profile-extras.sh (Linux AMI).

            The main script for me is /mnt/bamboo-ebs/bin/customiseInstance.sh (Linux), this script in turn calls customise-extras.sh and profile-extras.sh.

            greganth added a comment - HI Kevin, If you're using EBS with Bamboo ( https://confluence.atlassian.com/bamboo/configuring-elastic-instances-to-use-the-ebs-289277121.html ), the initialization creates some scripts on the volume which are run during the slave startup. For me, JAVA_HOME was set in profile-extras.sh (Linux AMI). The main script for me is /mnt/bamboo-ebs/bin/customiseInstance.sh (Linux), this script in turn calls customise-extras.sh and profile-extras.sh.

            I've just raised the same issue, can't find anywhere to set JAVA_HOME unfortunately. Any help?

            Kevin Matthews added a comment - I've just raised the same issue, can't find anywhere to set JAVA_HOME unfortunately. Any help?

            +1 - I was also still bit by shooting myself in the foot (setting JAVA_HOME to /opt/jdk-7). Thanks for the fixes!

            Russell Snyder added a comment - +1 - I was also still bit by shooting myself in the foot (setting JAVA_HOME to /opt/jdk-7). Thanks for the fixes!

            greganth added a comment -

            My setup is using a mounted EBS volume and one of my scripts there was setting JAVA_HOME to /opt/jdk-7; I removed those lines and I'm up and running.

            Thanks Nick for the assist!

            greganth added a comment - My setup is using a mounted EBS volume and one of my scripts there was setting JAVA_HOME to /opt/jdk-7; I removed those lines and I'm up and running. Thanks Nick for the assist!

            The fix has been rolled out to everyone now. If you're still experiencing issues, please raise a support request and we can investigate!

            Nick Mason added a comment - The fix has been rolled out to everyone now. If you're still experiencing issues, please raise a support request and we can investigate!

            greganth added a comment -

            Hi Nick,

            I raised a support ticket this morning. They suggested I try a new (ami-e3a0fe86) which didn't work. I'm still waiting for a resolution or workaround.

            greganth added a comment - Hi Nick, I raised a support ticket this morning. They suggested I try a new (ami-e3a0fe86) which didn't work. I'm still waiting for a resolution or workaround.

            Hi all, please raise a support request and we can apply the fix to your instance.

            Nick Mason added a comment - Hi all, please raise a support request and we can apply the fix to your instance.

            Hi - We're unable to run bamboo builds as a result of this. Can you please provide an estimate on when this will be fixed?

            Paul Sanwald added a comment - Hi - We're unable to run bamboo builds as a result of this. Can you please provide an estimate on when this will be fixed?

            This is also crippling our Node JS app builds that use startup scripts. FWIW, the error being thrown is because a pre-Java 8 JVM (7 or lower) is trying to run Java 8 byte code.

            Russell Snyder added a comment - This is also crippling our Node JS app builds that use startup scripts. FWIW, the error being thrown is because a pre-Java 8 JVM (7 or lower) is trying to run Java 8 byte code.

              pbruski Przemek Bruski
              nmason Nick Mason
              Affected customers:
              21 This affects my team
              Watchers:
              38 Start watching this issue

                Created:
                Updated:
                Resolved: