Uploaded image for project: 'Crucible'
  1. Crucible
  2. CRUC-6937

Migration to MySQL 5.7.4 failure

    XMLWordPrintable

Details

    Description

      5.7.4 reports duplicate indexes as an error. This is a bug which is fixed in MySQL 5.7.5.

      Because of this, FishEye/Crucible is compatible with 5.7.5 but not 5.7.4.

      When migrating from HSQLDB to MySQL 5.7.4, it will fail with the following error:

      2014-09-19 22:36:45,687 INFO  [ThreadPool1 ] fisheye DefaultDBControl-stop - Shutdown in progress...
      2014-09-19 22:36:45,688 INFO  [ThreadPool1 ] fisheye HibernateUtil-destroy - Shutting down DB.
      2014-09-19 22:37:02,345 ERROR [ThreadPool1 ] fisheye DBEditHelper-doGet - Database migration failed: com.cenqua.crucible.hibernate.CruDBException: Problem with constraints script /Users/foong/Desktop/CustomWare/fisheye/fecru-3.5.3/sql/MYSQL/schema/constraints_87.sql
      com.cenqua.crucible.hibernate.CruDBException: Problem with constraints script /Users/foong/Desktop/CustomWare/fisheye/fecru-3.5.3/sql/MYSQL/schema/constraints_87.sql
      	at com.cenqua.crucible.hibernate.DefaultDBControl.addConstraints(DefaultDBControl.java:411)
      	at com.atlassian.crucible.migration.item.DBImporter.importData(DBImporter.java:145)
      	at com.atlassian.crucible.actions.admin.database.DBEditHelper$ImportRunner.call(DBEditHelper.java:93)
      	at com.atlassian.crucible.actions.admin.database.DBEditHelper$ImportRunner.call(DBEditHelper.java:75)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:744)
      Caused by: com.cenqua.crucible.hibernate.CruDBException: SQL script error on line 19: "alter table cru_changeset_comment add index FK1C588BB9A697BC70 (cru_user_id), add constraint FK1C588BB9A697BC70 foreign key (cru_user_id) references cru_user (cru_user_id);" 
      (Duplicate index 'FK1C588BB9A697BC70' defined on the table 'fecru353.cru_changeset_comment'. This is deprecated and will be disallowed in a future release.), please contact http://www.atlassian.com/support/
      	at com.cenqua.crucible.hibernate.DefaultDBControl.executeScript(DefaultDBControl.java:593)
      	at com.cenqua.crucible.hibernate.DefaultDBControl.executeScript(DefaultDBControl.java:524)
      	at com.cenqua.crucible.hibernate.DefaultDBControl.addConstraints(DefaultDBControl.java:405)
      	... 9 more
      Caused by: java.sql.SQLException: Duplicate index 'FK1C588BB9A697BC70' defined on the table 'fecru353.cru_changeset_comment'. This is deprecated and will be disallowed in a future release.
      	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
      

      However, the table 'cru_changeset_comment' in the database does not have the index 'FK1C588BB9A697BC70' after the migration failure.


      Workaround

      Use MySQL 5.7.5 or newer

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              klfoong Foong (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: