Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-18199

Upgrade task 51509 fail if MySQL server contain database from old Bamboo

    XMLWordPrintable

Details

    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

      1. Install Bamboo 5.14.3.1 and configure it to use database bamboo51431
      2. Install Bamboo 5.10.0 and configure it to use database bamboo5100 (the same MySQL and database user in Step 1)
      3. 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

      Attachments

        Activity

          People

            mswinarski Maciej Swinarski (Inactive)
            klfoong Foong (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: