Bamboo fails to start up after upgrade to 8.0 or higher with upgrade task 70303 throwing FileNotFoundException

Still need help?

The Atlassian Community is here for you.

Ask the community

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 fails to start up after an attempt to upgrade the application to version 8.0 or higher with the following exception in the <bamboo-home>/logs/atlassian-bamboo.log file:

2021-10-04 09:38:41,295 INFO [localhost-startStop-1] [AbstractUpgradeManager] ---------------------------------------------------------------------------------------
2021-10-04 09:38:41,295 INFO [localhost-startStop-1] [AbstractUpgradeManager] 70303 : Correct EC2 key and certificate path after reorganising Bamboo Home (bootstrap)
2021-10-04 09:38:41,295 INFO [localhost-startStop-1] [AbstractUpgradeManager] ---------------------------------------------------------------------------------------
2021-10-04 09:38:41,310 ERROR [localhost-startStop-1] [AbstractUpgradeManager] io.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.RuntimeException: Unexpected exception
io.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.RuntimeException: Unexpected exception
        at io.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:156)
        at io.atlassian.util.concurrent.LazyReference.get(LazyReference.java:116)
        at com.atlassian.bamboo.upgrade.ConfigurationUpgrader.getDocument(ConfigurationUpgrader.java:66)
        at com.atlassian.bamboo.upgrade.AbstractXmlUpgrader.getRootElement(AbstractXmlUpgrader.java:79)
        at com.atlassian.bamboo.upgrade.AbstractXmlUpgrader.getElement(AbstractXmlUpgrader.java:84)
        at com.atlassian.bamboo.upgrade.tasks.v8_0.UpgradeTask70303FixEc2ConfigurationAfterHomeReorg.fixPathIfNecessary(UpgradeTask70303FixEc2ConfigurationAfterHomeReorg.java:41)
        at com.atlassian.bamboo.upgrade.tasks.v8_0.UpgradeTask70303FixEc2ConfigurationAfterHomeReorg.doUpgrade(UpgradeTask70303FixEc2ConfigurationAfterHomeReorg.java:32)
        at com.atlassian.bamboo.upgrade.AbstractUpgradeManager.runUpgradeTask(AbstractUpgradeManager.java:230)
        at com.atlassian.bamboo.upgrade.BootstrapUpgradeManagerImpl.doUpgrade(BootstrapUpgradeManagerImpl.java:75)
        at com.atlassian.bamboo.setup.DefaultBootstrapManager.performPersistenceUpgrade(DefaultBootstrapManager.java:394)
        at com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager.init(DefaultAtlassianBootstrapManager.java:81)
        at com.atlassian.bamboo.setup.BootstrapLoaderListener.contextInitialized(BootstrapLoaderListener.java:155)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4705)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5171)
        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)
Caused by: java.lang.RuntimeException: Unexpected exception
        at com.atlassian.bamboo.util.BambooObjectUtils.asRuntimeException(BambooObjectUtils.java:119)
        at com.atlassian.bamboo.upgrade.ConfigurationUpgrader$1.get(ConfigurationUpgrader.java:35)
        at com.atlassian.bamboo.upgrade.ConfigurationUpgrader$1.get(ConfigurationUpgrader.java:28)
        at io.atlassian.util.concurrent.Lazy$Strong.create(Lazy.java:98)
        at io.atlassian.util.concurrent.LazyReference$Sync.run(LazyReference.java:332)
        at io.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:150)
        ... 20 more
Caused by: java.io.FileNotFoundException: File 'C:\bamboo-home\xml-data\configuration\administration.xml' does not exist
        at org.apache.commons.io.FileUtils.openInputStream(FileUtils.java:2368)
        at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:2486)
        at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:2472)
        at com.atlassian.bamboo.upgrade.ConfigurationUpgrader$1.get(ConfigurationUpgrader.java:32)
        ... 24 more
2021-10-04 09:38:41,310 INFO [localhost-startStop-1] [AbstractUpgradeManager] Task 70303 completed successfully.

Environment

Bamboo 8.0 or higher.

Diagnosis

Bamboo 8 introduced major changes to the <bamboo-home>. The new organization is a requirement for using multiple nodes with Bamboo Data Center, but this upgrade affects every type of Bamboo installation, including Server and single-node Data Center setups. Part of the process consists of moving files located inside the <bamboo-home>/xml-data/configuration to the new <bamboo-shared-home>/configuration folder. In order to verify whether you are affected by the problem described in this article we advise you to:

  1. Open your <bamboo-home>/bamboo.cfg.xml file and look for the value of the bamboo.config.directory property. If it's still pointing to ${bambooHome}/configuration there's a great chance you're running into the issue described here. A successful upgrade would've updated this property to point to the new ${bambooSharedHome} folder.
  2. Check that the administration.xml file exists inside both a) <bamboo-home>/xml-data/configuration and b) <bamboo-shared-home>/configuration folders. You should not have the administration.xml file inside the <bamboo-home>/xml-data/configuration folder anymore, only at the new location: <bamboo-shared-home>/configuration. This means that the administration.xml file was properly moved to the new location even though the bamboo.config.directory property is still pointing to the old location. This means that part of the upgrade task was completed successfully but not all of it.
  3. Check and compare the contents of the <bamboo-home>/xml-data/configuration and <bamboo-shared-home>/configuration folders. If you're running into the issue described in this article you'll likely have more files inside the old <bamboo-home>/xml-data/configuration folder than the new <bamboo-shared-home>/configuration indicating that the file transfer between folders did not complete successfully.

Cause

This problem happens when the upgrade task responsible for moving files from the old <bamboo-home>/xml-data/configuration to the new <bamboo-shared-home>/configuration folder does not complete successfully leaving some of the files inside the old <bamboo-home>/xml-data/configuration folder and some in the new <bamboo-shared-home>/configuration folder.

The underlying cause can vary (e.g. permissions) but it causes Bamboo to not update some of the properties inside <bamboo-home>/bamboo.cfg.xml file (e.g. bamboo.config.directory) to point to the new ${bambooSharedHome}. Bamboo fails to start up because it looks for the administration.xml in the (wrong) old <bamboo-home>/xml-data/configuration folder.

Solution

The ideal solution would be to find and fix whatever stopped Bamboo from being able to move the files from <bamboo-home>/xml-data/configuration to the new <bamboo-shared-home>/configuration folder and redo the upgrade from scratch. However, this may not be possible if you have already started the upgrade process without taking a proper backup of the application or filesystem + database. In this case, if you can't start from scratch we recommend that you:

  1. Stop Bamboo.
  2. Open the <bamboo-home>/bamboo.cfg.xml file and update the bamboo.config.directory property to point to the new ${bambooSharedHome}:

    Linux
    ${bambooSharedHome}/configuration
    Windows
    ${bambooSharedHome}\configuration
  3. Create a backup of the existing <bamboo-shared-home>/shared/configuration folder or simply move it to another location outside the <bamboo-shared-home> directory.
  4. Copy all of the remaining files from <bamboo-home>/xml-data/configuration into the <bamboo-shared-home>/configuration directory.
  5. Start Bamboo.

This should allow Bamboo to start up properly and stop reporting a missing administration.xml file.

Last modified on Feb 7, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.