Details
-
Bug
-
Resolution: Done
-
Highest
-
5.15.0.1
-
None
-
Severity 3 - Minor
-
Description
Summary
If there are multiple Bamboo databases in a single MySQL server, the upgrade task 51509 will fail because it detected constraint from the older version Bamboo database
Environment
MySQL
Steps to Reproduce
- Install Bamboo 5.14.3.1 and configure it to use database bamboo51431
- Install Bamboo 5.10.0 and configure it to use database bamboo5100 (the same MySQL and database user in Step 1)
- Upgrade Bamboo 5.14.3.1 to Bamboo 5.15.0.1
Expected Results
It will successfully upgraded
Actual Results
The upgrade fail with the below exception thrown in the atlassian-bamboo.log file:
2017-02-20 20:21:50,159 INFO [localhost-startStop-1] [AbstractUpgradeManager] Completed task 51507 successfully. 2017-02-20 20:21:50,159 INFO [localhost-startStop-1] [AbstractUpgradeManager] ------------------------------------------------------------------------ 2017-02-20 20:21:50,159 INFO [localhost-startStop-1] [AbstractUpgradeManager] 51509 : Drop all FK constraints created by the old Hibernate (bootstrap) 2017-02-20 20:21:50,159 INFO [localhost-startStop-1] [AbstractUpgradeManager] ------------------------------------------------------------------------ 2017-02-20 20:21:50,164 INFO [localhost-startStop-1] [AbstractDbmsBean] Detected schema: null ... 2017-02-20 20:21:51,392 INFO [localhost-startStop-1] [JdbcUtils] Executing: [select CONSTRAINT_NAME from INFORMATION_SCHEMA.KEY_COLUMN_USAGE where TABLE_NAME='EC2_IMAGE_SCRIPT'] ... 2017-02-20 20:21:52,572 INFO [localhost-startStop-1] [JdbcUtils] Executing: [select CONSTRAINT_NAME from INFORMATION_SCHEMA.KEY_COLUMN_USAGE where TABLE_NAME='VCS_LOCATION'] 2017-02-20 20:21:52,604 INFO [localhost-startStop-1] [JdbcUtils] Executing: [alter table EC2_IMAGE_SCRIPT drop foreign key FK435AAF5A39C0559D] 2017-02-20 20:21:52,629 ERROR [localhost-startStop-1] [AbstractUpgradeManager] java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Can't DROP 'FK435AAF5A39C0559D'; check that column/key exists java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Can't DROP 'FK435AAF5A39C0559D'; check that column/key exists at com.google.common.base.Throwables.propagate(Throwables.java:160) at com.atlassian.bamboo.upgrade.tasks.v5_15.UpgradeTask51509DropHibernate2FkConstraints.dropForeignKeyConstraint(UpgradeTask51509DropHibernate2FkConstraints.java:93) at com.atlassian.bamboo.upgrade.tasks.v5_15.UpgradeTask51509DropHibernate2FkConstraints.lambda$null$1(UpgradeTask51509DropHibernate2FkConstraints.java:64) at java.lang.Iterable.forEach(Iterable.java:75) at com.atlassian.bamboo.upgrade.tasks.v5_15.UpgradeTask51509DropHibernate2FkConstraints.lambda$doUpgrade$2(UpgradeTask51509DropHibernate2FkConstraints.java:60) at com.atlassian.bamboo.upgrade.AbstractBootstrapUpgradeTask.withDatabaseConnection(AbstractBootstrapUpgradeTask.java:83)
Notes
Constraint FK435AAF5A39C0559D exist in bamboo5100