Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-3133

Stash 2.1.2 failing with MySQL 5.6 due to "specified key was too long" error

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 2.2.0
    • 2.1.2
    • Database - MySQL
    • None

      Stash 2.1.2 installation with MySQL is failing with this exception:

      The schema could not be created.
      com.atlassian.stash.internal.migration.DefaultMigrationHelper.createSchema(DefaultMigrationHelper.java:117)
      com.atlassian.stash.internal.migration.AbstractMigrationMaintenanceTask.setup(AbstractMigrationMaintenanceTask.java:195)
      com.atlassian.stash.internal.maintenance.ActiveMaintenanceTaskContext.setup(ActiveMaintenanceTaskContext.java:166)
      ...
      Migration failed for change set liquibase/r1_3/m01.xml::STASHDEV-1023-10::bturner:
      Reason: liquibase.exception.DatabaseException: Error executing SQL CREATE INDEX `idx_sta_diff_comment_anchors` ON `stash`.`sta_diff_comment_anchor`(`to_hash`, `file_path`, `from_hash`): Specified key was too long; max key length is 767 bytes:
      Caused By: Error executing SQL CREATE INDEX `idx_sta_diff_comment_anchors` ON `stash`.`sta_diff_comment_anchor`(`to_hash`, `file_path`, `from_hash`): Specified key was too long; max key length is 767 bytes:
      Caused By: Specified key was too long; max key length is 767 bytes
      liquibase.changelog.ChangeSet.execute(ChangeSet.java:347)
      liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:27)
      liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:58)
      ...
      Error executing SQL CREATE INDEX `idx_sta_diff_comment_anchors` ON `stash`.`sta_diff_comment_anchor`(`to_hash`, `file_path`, `from_hash`): Specified key was too long; max key length is 767 bytes
      liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:62)
      liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:104)
      liquibase.database.AbstractDatabase.execute(AbstractDatabase.java:1091)
      ...
      Specified key was too long; max key length is 767 bytes
      sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      

      This has been reported on MySQL 5.6
      This seems to have exceeded the Innodb limit of 767 bytes (40, 1024, 40) for (`to_hash`, `file_path`, `from_hash`).

          Form Name

            [BSERV-3133] Stash 2.1.2 failing with MySQL 5.6 due to "specified key was too long" error

            The recently released MySQL 5.6.12 still contains the row ordering bug which affects 5.6.10 and 5.6.11. The MySQL team have confirmed this bug also affects all builds of the upcoming 5.7 as well. As a result, Stash will not support 5.6.12 either.

            Bryan Turner (Inactive) added a comment - The recently released MySQL 5.6.12 still contains the row ordering bug which affects 5.6.10 and 5.6.11. The MySQL team have confirmed this bug also affects all builds of the upcoming 5.7 as well. As a result, Stash will not support 5.6.12 either.

            The recently released MySQL 5.6.11 contains the fix for the query optimizer bug which prevented Stash from supporting 5.6.0 through 5.6.10. However, it introduces a new row ordering bug which affects, at a minimum, Stash's repository listings. As a result, Stash will not support 5.6.11 either.

            Bryan Turner (Inactive) added a comment - The recently released MySQL 5.6.11 contains the fix for the query optimizer bug which prevented Stash from supporting 5.6.0 through 5.6.10. However, it introduces a new row ordering bug which affects, at a minimum, Stash's repository listings. As a result, Stash will not support 5.6.11 either.

            Stash 2.2 now explicitly handles MySQL 5.6. Note that it is still not supported, due to the optimizer bug. However, Stash 2.2 will now fail gracefully and with a sensible, clear error message when used with MySQL 5.6. Database migration and external database setup will both reject migrating to 5.6. For real MySQL 5.6 support, please watch STASH-3164

            Bryan Turner (Inactive) added a comment - Stash 2.2 now explicitly handles MySQL 5.6. Note that it is still not supported , due to the optimizer bug. However, Stash 2.2 will now fail gracefully and with a sensible, clear error message when used with MySQL 5.6. Database migration and external database setup will both reject migrating to 5.6. For real MySQL 5.6 support, please watch STASH-3164

            I have addressed all the schema-level issues, so the schema can now be created without issue. However, due to the aforementioned MySQL bug, I have also added code to the system which will explicitly prohibit using MySQL 5.6.0 through 5.6.10. It will block using those versions as migration or setup targets, and will also lock out the system if the connected MySQL instance is upgraded to one of them. The bug causes Stash's permission queries to return incorrect results, so it's pretty critical to the system that it be fixed.

            Bryan Turner (Inactive) added a comment - I have addressed all the schema-level issues, so the schema can now be created without issue. However, due to the aforementioned MySQL bug, I have also added code to the system which will explicitly prohibit using MySQL 5.6.0 through 5.6.10. It will block using those versions as migration or setup targets, and will also lock out the system if the connected MySQL instance is upgraded to one of them. The bug causes Stash's permission queries to return incorrect results, so it's pretty critical to the system that it be fixed.

            Due to a critical bug in MySQL 5.6.10 we are currently not able to support this particular version of MySQL.

            We've updated the support platforms page to reflect this more accurately https://confluence.atlassian.com/display/STASH/Supported+platforms and updated our installation instructions on https://confluence.atlassian.com/display/STASH/Connecting+Stash+to+MySQL

            The MySQL bug can be tracked here: http://bugs.mysql.com/bug.php?id=68424

            Stefan Saasen (Inactive) added a comment - - edited Due to a critical bug in MySQL 5.6.10 we are currently not able to support this particular version of MySQL. We've updated the support platforms page to reflect this more accurately https://confluence.atlassian.com/display/STASH/Supported+platforms and updated our installation instructions on https://confluence.atlassian.com/display/STASH/Connecting+Stash+to+MySQL The MySQL bug can be tracked here: http://bugs.mysql.com/bug.php?id=68424

              bturner Bryan Turner (Inactive)
              ganand Gurleen Anand [Atlassian]
              Affected customers:
              0 This affects my team
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: