Bamboo Upgrade process failing with LazyReference InitializationException post Database setup stage

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs 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

Bamboo Upgrade is failing post DB initialization stage with the below error.

1 2 ERROR [https-jsse-nio-8443-exec-4] [runtime] Error executing FreeMarker template FreeMarker template error
1 2 io.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.NullPointerException at io.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:156)

Environment

Issue seen on Bamboo 8.1.3

Diagnosis

  • During the Bamboo upgrade process post DB Initialization stage, Bamboo GUI fails to come up and below error message in seen on the screen.

(Auto-migrated image: description temporarily unavailable)
(Auto-migrated image: description temporarily unavailable)

  • Bamboo Logs also confirm that the DB initialization was successful. Below log messages would be displayed.

1 2 INFO [performSetupDatabaseConnectionBackgroundThread] [SetupDatabaseConnectionAction] Validating connection to url: INFO [performSetupDatabaseConnectionBackgroundThread] [SetupDatabaseConnectionAction] Database configuration is valid.

  • Immediately post the above log messages 500 Exception related error would be present in the logs.

1 2 ERROR [FiveOhOh] 500 Exception was thrown. ERROR [runtime] Error executing FreeMarker template

Cause

Below are the cause for the Issue

  1. Proper permission is not available to Bamboo user to <bamboo-home> and <bamboo-install> folders.

  2. Bamboo is not able to read the bamboo.cfg.xml file (or the file is corrupted).

Solution

Solution outlined will cover both the causes explained above.

Solution 1 : To provide proper permission to folders

  • The first step is to make sure proper permission is provided to bamboo folders and files are owned by user which is running Bamboo. Please run the below command

    1 2 chown -R <user_name> <bamboo-home> chown -R <user_name> <bamboo-install>

    ℹ️ where <user_name> is the user_id you're using to start the service.

    ℹ️ Please include the -R parameter as it is important to make sure the ownership to all files and subfolders will also be adjusted.

Solution 2 : To regenerate bamboo.cfg.xml file.

  • Rename the bamboo.cfg.xml file with the below command

    1 mv bamboo.cfg.xml bamboo.cfg.xml_bkp

Below steps would be common for both solution 1 and solution 2 defined above.

  • Restart Bamboo and verify if the bamboo.cfg.xml file was created with the correct permission (bamboo user).

  • Move forward with the installation.

Updated on April 24, 2025

Still need help?

The Atlassian Community is here for you.