Bamboo upgrade throwing Database exception MySQL bad SQL grammar

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

While upgrading Bamboo from 6.5.1 to 8.1.2 error related to MySQL bad SQL grammar is seen in logs and Bamboo fails to startup.

1 ERROR [19-UpgradeTaskBackgroundThread:pool-33-thread-1] [AbstractUpgradeManager] org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar

Environment

Old Bamboo Environment : 6.5.1, New Bamboo Environment : 8.1.2

Database : MySQL

Diagnosis

Post upgrading when Bamboo startup is in progress below error message is seen on the logs.

  • Bamboo Identifies the upgrade tasks for the new version and start with the task 60602 : Move users to Embedded Crowd (post-bootstrap).

1 2 3 4 INFO [19-UpgradeTaskBackgroundThread:pool-33-thread-1] [UpgradeManagerImpl] Found 37 upgrade tasks INFO [19-UpgradeTaskBackgroundThread:pool-33-thread-1] [AbstractUpgradeManager] ----------------------------------------------------- INFO [19-UpgradeTaskBackgroundThread:pool-33-thread-1] [AbstractUpgradeManager] 60602 : Move users to Embedded Crowd (post-bootstrap) INFO [19-UpgradeTaskBackgroundThread:pool-33-thread-1] [AbstractUpgradeManager] -----------------------------------------------------
  • Error related to bad SQL grammar is seen in the logs.

1 2 3 ERROR [19-UpgradeTaskBackgroundThread:pool-33-thread-1] [AbstractUpgradeManager] org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [select count(GROUPNAME) from GROUPS]; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUPS' at line 1

Cause

  • The cause of the error is incompatible Database version of the previous Bamboo instance (6.5.1) from which upgrade is being performed.

  • Bamboo 6.5.1 was started with MySQL 8.0 and with connector mysql-connector-java-8.0.28. According to supported platforms for Bamboo MySQL 8.0 is not supported for Bamboo 6.5.1

Solution

  • Rollback Bamboo to previous version which is 6.5.1 and make sure to roll back to MySQL 5.7 using MySQL connector J 5.1

  • Please remove any latest MySQL connector mysql-connector-java-8.0.28 from <bamboo-install>lib folder.

  • Make sure to have Bamboo up and running and at this stage create an export zip for backup.

  • Upgrade Bamboo to latest 8.1.2 on the same MySQL DB ( MySQL 5.7 and MySQL connector J 5.1 ).

  • Post Bamboo is up and running MySQL DB migration to MySQL 8 can be planned. 

Updated on February 26, 2025

Still need help?

The Atlassian Community is here for you.