Bamboo Data Center fails to connect to a MySQL database with exception null java.lang.IllegalStateException

Platform Notice: Data Center Only - This article only applies to Atlassian apps 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 throws a stack trace error when configuring the Database URL for MySQL on the Setup Wizard page.

Environment

The solution has been validated in Bamboo Data Center 9.2 but may be applicable to other versions.

This only affects Bamboo Data Center running with MySQL.

Diagnosis

The following stack trace will be thrown at the <bamboo-home>/logs/atlassian-bamboo.log file:

2022-01-25 21:21:05,969 INFO [performSetupDatabaseConnectionBackgroundThread] [SetupDatabaseConnectionAction] Validating connection to url: [jdbc:mysql://db.mysql.database.azure.com:3306/bamboo?useSSL=false&autoReconnect=true&useUnicode=true&characterEncoding=utf8] 2022-01-25 21:21:07,426 INFO [performSetupDatabaseConnectionBackgroundThread] [SetupDatabaseConnectionAction] Database configuration is valid. 2022-01-25 21:21:07,455 ERROR [http-nio-8085-exec-3] [ExceptionMappingInterceptor] null java.lang.IllegalStateException at com.google.common.base.Preconditions.checkState(Preconditions.java:486) at com.atlassian.bamboo.ww2.actions.setup.SetupUtilityBean.setupStandardDatabase(SetupUtilityBean.java:163) at com.atlassian.bamboo.ww2.actions.setup.SetupDatabaseConnectionAction.lambda$execute$0(SetupDatabaseConnectionAction.java:92) at com.atlassian.bamboo.setup.DefaultSetupPersister.executeSetupStep(DefaultSetupPersister.java:76) at com.atlassian.bamboo.ww2.actions.setup.SetupDatabaseConnectionAction.execute(SetupDatabaseConnectionAction.java:90) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at ognl.OgnlRuntime.invokeMethodInsideSandbox(OgnlRuntime.java:1266) at ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:1251) at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1969) at ognl.ObjectMethodAccessor.callMethod(ObjectMethodAccessor.java:68) at com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethodWithDebugInfo(XWorkMethodAccessor.java:98) at com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethod(XWorkMethodAccessor.java:90) at ognl.OgnlRuntime.callMethod(OgnlRuntime.java:2045) at ognl.ASTMethod.getValueBody(ASTMethod.java:97) at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212) at ognl.SimpleNode.getValue(SimpleNode.java:258) at ognl.Ognl.getValue(Ognl.java:537) at ognl.Ognl.getValue(Ognl.java:501) at com.opensymphony.xwork2.ognl.OgnlUtil$3.execute(OgnlUtil.java:492) at com.opensymphony.xwork2.ognl.OgnlUtil.compileAndExecuteMethod(OgnlUtil.java:544) at com.opensymphony.xwork2.ognl.OgnlUtil.callMethod(OgnlUtil.java:490) at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:438) at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:293) at org.apache.struts2.interceptor.BackgroundProcess$1.run(BackgroundProcess.java:55) at java.base/java.lang.Thread.run(Thread.java:829)

Solution

Make sure to check all steps from our MySQL documentation when setting up the database before starting up the Bamboo instance.

  1. If you are using MySQL 8, use the MySQL Connector/J 8.0.26.

  2. Check if the database server is configured to use storage engine InnoDB by default by running the query below, otherwise, ensure that your URL includes the sessionVariables=storage_engine=InnoDB flag.

mysql> show engines;

Result:

Engine

Support

Comment

Transactions

XA

Savepoints

InnoDB

DEFAULT

Supports transactions, row-level locking, and foreign keys

YES

YES

YES

3. Check the global transaction isolationlevel is READ_COMMITTED by running the queries below:

SELECT @@GLOBAL.tx_isolation, @@GLOBAL.tx_read_only; SELECT @@SESSION.tx_isolation, @@SESSION.tx_read_only;

If the level is not set to READ_COMMITTED please run the command below to adjust that:

SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;

⚠️ Run the first queries again to make sure it was set correctly.

4. Create a database with utf8 or utf8mb4_bin character encoding.

mysql> CREATE DATABASE bamboo CHARACTER SET utf8 COLLATE utf8_bin; mysql> GRANT ALL PRIVILEGES ON bamboo.* TO 'bamboouser'@'localhost' IDENTIFIED BY 'password'; mysql> FLUSH PRIVILEGES; mysql> QUIT

Or:

mysql> CREATE DATABASE bamboo CHARACTER SET utf8mb4 COLLATE utf8mb4_bin; mysql> GRANT ALL PRIVILEGES ON bamboo.* TO 'bamboouser'@'localhost' IDENTIFIED BY 'password'; mysql> FLUSH PRIVILEGES; mysql> QUIT

5. Lastly for the database, run the below query to make sure the NO_AUTO_VALUE_ON_ZERO mode was disabled.

SELECT @@SQL_MODE, @@GLOBAL.SQL_MODE;

Once the database has been set up, please:

  1. Stop Bamboo.

  2. Delete all contents from the Bamboo home directory to remove any corrupted cached data from previous install attempts. ⚠️ This only applies when installing a fresh new instance.

  3. Start Bamboo.

  4. Enter the license key.

  5. For the database URL page, add the following flags:

autoReconnect=true&useUnicode=true&characterEncoding=utf8&nullCatalogMeansCurrent=true

Your Database connection string should look similar to:

jdbc:mysql://<database-name>:3306/bamboo?autoReconnect=true&useUnicode=true&characterEncoding=utf8&nullCatalogMeansCurrent=true

Updated on January 16, 2026

Still need help?

The Atlassian Community is here for you.