Bamboo Upgrade Fails on task 51306 due to empty administration.xml file
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
Problem
Write a brief step by step description of the symptoms of the problem including any errors, eg:
When upgrading Bamboo, you may see task 51306 fail with the following in the atlassian-bamboo.log
:
2016-10-13 17:08:10,228 INFO [localhost-startStop-1] [AbstractUpgradeManager] -----------------------------------------------------------------------------------------------------------
2016-10-13 17:08:10,229 INFO [localhost-startStop-1] [AbstractUpgradeManager] 51306 : Set 'WHITELIST' method for xStream serialization security configuration value in administration.xml
2016-10-13 17:08:10,229 INFO [localhost-startStop-1] [AbstractUpgradeManager] -----------------------------------------------------------------------------------------------------------
2016-10-13 17:08:10,254 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
...
Caused by: java.lang.RuntimeException: Unexpected exception
...
Caused by: org.dom4j.DocumentException: Error on line -1 of document : Premature end of file. Nested exception: Premature end of file.
Diagnosis
Diagnostic Steps
- Verify the contents of
BAMBOO_HOME/xml-data/configuration/administration.xml
- If the file is empty, the steps in this article apply
Cause
This is caused by a blank BAMBOO_HOME/xml-data/configuration/administration.xml
file.
Resolution
If you have a backup of your BAMBOO_HOME
directory, please copy the xml-data/configuration/administration.xml
file from there to your live BAMBOO_HOME.
If you do not, you can start a new installation of Bamboo, so that the Bamboo Home directory gets populated with the required files, and then copy that file over to the existing directory. This can be accomplished as follows:
- Create a new directory that will be the new Bamboo Home (NEW_BAMBOO_HOME)
- Update your BAMBOO_INSTALL/atlassian-bamboo/WEB-INF/classes/bamboo-init.properties to point bamboo.home to NEW_BAMBOO_HOME
- Start Bamboo and complete the setup
- Copy the NEW_BAMBOO_HOME/xml-data/configuration/administration.xml to BAMBOO_HOME/xml-data/configuration/administration.xml
- This file should be non-empty
- Stop Bamboo
- Update your BAMBOO_INSTALL/atlassian-bamboo/WEB-INF/classes/bamboo-init.properties to point bamboo.home to
BAMBOO_HOME
- Start Bamboo
The upgrade should now succeed as expected.