Server Key Verification Fails During Upgrade From 6.10.x to 7.x with NoSuchMethod Error
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
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
Bamboo upgrade from 6.10.x to 7.x fails when performing server key verification task. The app fails to start and Bamboo is unavailable.
Diagnosis
During the upgrade you will see the following logs in ${BAMBOO_HOME}/logs/atlassian-bamboo.log:
2021-02-04 09:49:14,167 INFO [localhost-startStop-1] [BootstrapUpgradeManagerImpl] 51102 : Make sure server key has been initialized and is valid (bootstrap)
2021-02-04 09:49:14,167 INFO [localhost-startStop-1] [BootstrapUpgradeManagerImpl] --------------------------------------------------------------------------
2021-02-04 09:49:14,174 INFO [localhost-startStop-1] [UpgradeLauncher] Upgrades not performed since the application has not been set up yet.
2021-02-04 09:49:14,258 INFO [localhost-startStop-1] [BambooPluginManager] Plugin state will no longer be persisted.
Tomcat logs (${BAMBOO_INSTALL_DIR}/logs/catalina.out) will be more precise about the error:
04-Feb-2021 09:49:11.662 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpath
04-Feb-2021 09:49:14.168 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [com.atlassian.bamboo.setup.BootstrapLoaderListener]
java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V
at com.atlassian.bamboo.setup.DefaultBootstrapManager.getServerKey(DefaultBootstrapManager.java:362)
at com.atlassian.bamboo.upgrade.tasks.validation.ServerKeyIsValid.doUpgrade(ServerKeyIsValid.java:16)
at com.atlassian.bamboo.upgrade.BootstrapUpgradeManagerImpl.runValidationTask(BootstrapUpgradeManagerImpl.java:134)
at com.atlassian.bamboo.upgrade.BootstrapUpgradeManagerImpl.lambda$runValidationTasks$0(BootstrapUpgradeManagerImpl.java:93)
at com.atlassian.bamboo.upgrade.AbstractUpgradeManager.forEachTask(AbstractUpgradeManager.java:147)
at com.atlassian.bamboo.upgrade.BootstrapUpgradeManagerImpl.runValidationTasks(BootstrapUpgradeManagerImpl.java:93)
at com.atlassian.bamboo.setup.DefaultBootstrapManager.runValidationTasks(DefaultBootstrapManager.java:389)
at com.atlassian.bamboo.setup.DefaultBootstrapManager.performPersistenceUpgrade(DefaultBootstrapManager.java:293)
at com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager.init(DefaultAtlassianBootstrapManager.java:81)
at com.atlassian.bamboo.setup.BootstrapLoaderListener.contextInitialized(BootstrapLoaderListener.java:143)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4689)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5155)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1412)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1402)
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)
Solution
The error is caused by the fact that the wrong com.google.common.base.Preconditions is loaded to the classpath from one of the 3rd party plugins in WEB-INF/lib, while the one from guava-26.0-jre.jar is ignored.
To fix the error:
- Stop Bamboo
- Check for any 3rd party plugins plugins at ${BAMBOO_INSTALL_DIR}/atlassian-bamboo/WEB-INF/lib and remove them from this directory
- Start Bamboo
- Reinstall plugins. Make sure plugins are compatible with the version of Bamboo that is running
bamboo-artifactory-plugin-1.13.0.jar has been reported to cause this error, but there can be other 3rd party plugins that will load their classes to classpath.
Important! Do not put any plugin jars to ${BAMBOO_INSTALL_DIR}/atlassian-bamboo/WEB-INF/lib. The recommended ways to install plugins is to upload them using Bamboo apps UI or copy plugins jars to ${BAMBOO_HOME}/plugins.