Bamboo upgrade throwing Database exception MySQL bad SQL grammar

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

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.

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).
 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.
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. 



Last modified on Mar 30, 2022

Was this helpful?

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