Bamboo Data Center is not coming up online after upgrading to version 10 due to Java class version mismatch
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
This article covers a scenario where Bamboo is not coming up online after upgrading the current version to Bamboo 10.x.x. The issue is related to starting Bamboo 10 with an unsupported Java version.
Environment
The issue was seen while upgrading Bamboo from 9.2.16 to 10.0.1
Diagnosis
1) Looking at <bamboo-home>logs>atlassian-bamboo.log file we can see that it does not contain any logs post Bamboo was started with new version which is 10.0.1, the logs are only present when Bamboo was shutdown.
INFO [ActiveMQ ShutdownHook] [TransportConnector] Connector vm://bamboo stopped
INFO [Thread-66] [HikariDataSource] HikariPool-2 - Shutdown initiated...
INFO [Thread-66] [HikariDataSource] HikariPool-2 - Shutdown completed.
INFO [Thread-66] [QuartzScheduler] Scheduler scheduler_$_NON_CLUSTERED shutdown complete.
2) Looking at <bamboo-install>logs>catalina.out file we can see that the Tomcat server was started after Bamboo was started with version 10.0.1.
INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.91]
3) We can see the below error in catalina.out file > com/atlassian/bamboo/log/BambooLog4jHomeLocatorContext has been compiled by a more recent version of the Java Runtime
2024-09-10T08:25:47.417589Z main WARN Could not examine class com/atlassian/bamboo/log/BambooLog4jHomeLocatorContext.class java.lang.UnsupportedClassVersionError: com/atlassian/bamboo/log/BambooLog4jHomeLocatorContext has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0 (unable to load class [com.atlassian.bamboo.log.BambooLog4jHomeLocatorContext])
at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2291)
Cause
1) The issue is because as per Bamboo 10 supported platform Bamboo 10.0 only supports Java 17, if you are starting Bamboo with Java 11 you'll see the above errors.
2) Class file version 55.0 means Java 11 and Class file version 61 means Java 17.
Solution
1) Install JDK 17 on your Bamboo server and set the environment variables correctly, refer Setting JAVA_HOME for more details.
2) Make sure the results of below 2 commands point to jdk17
java --version
echo $JAVA_HOME
3) Restart your Bamboo application