-
Bug
-
Resolution: Done
-
Low
-
None
-
None
-
None
-
None
Summary of Issue
Unable to enable the Cloud Migration Assistant for Confluence app when Confluence is integrated with My SQL 5.6.
How to reproduce
- Install Confluence 5.10.8 against My SQL 5.6
- Install the Cloud Migration Assistant app through Manage Add-ons and upload it using the URL from https://marketplace.atlassian.com/apps/1219672/cloud-migration-assistant-for-confluence
- The add-on will fail to start
- Checking atlassian-confluence.log shows:
Caused by: liquibase.exception.DatabaseException: Specified key was too long; max key length is 767 bytes [Failed SQL: CREATE TABLE confluence.MIG_CLOUD_SITE (cloudId VARCHAR(255) NOT NULL, cloudUrl VARCHAR(1024) NOT NULL, containerToken VARCHAR(255) NOT NULL, isFailing BIT(1) NULL, CONSTRAINT PK_MIG_CLOUD_SITE PRIMARY KEY (cloudId), UNIQUE (cloudUrl), UNIQUE (containerToken))] at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:356) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:57) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:125) at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1229) at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1211) at liquibase.changelog.ChangeSet.execute(ChangeSet.java:600) ... 88 more Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.Util.getInstance(Util.java:381) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1051) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3563) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3495) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2687) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2616) at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:782) at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:625) at com.mchange.v2.c3p0.impl.NewProxyStatement.execute(NewProxyStatement.java:75) at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:352) ... 93 more
- Checking atlassian-confluence.log shows:
Expected Result
The add-on should have enabled successfully without any errors.
Actual Result
The above stack trace is thrown and the add-on is not enabled.
Cause
It appears that only after MySQL 5.7, MySQL increased the key length limit of 767 to higher values in MySQL 5.7.
- https://stackoverflow.com/questions/1814532/1071-specified-key-was-too-long-max-key-length-is-767-bytes
767 bytes is the stated prefix limitation for InnoDB tables in MySQL version 5.6 (and prior versions). It's 1,000 bytes long for MyISAM tables. In MySQL version 5.7 and upwards this limit has been increased to 3072 bytes.
Work around
Approach 1: Downgrade CCMA to version 3.4.10 (recommended due to being faster and easier).
Reference: How to install a specific version of the Confluence Cloud Migration Assistant
OR
Approach 2: Temporarily migrate the Confluence database from MySQL 5.6 to MySQL 5.7 and try re-installing the add-on.
If you do not wish to upgrade MySQL, you can instead open a support request with us, and we will be able to provide you an early release of the patched version of the plugin which will work on MySQL 5.6.
It may also be necessary to drop these MIG tables (only if they exist and the add-on is disabled) before you can re-enable the Cloud Migration Assistant for Confluence app:
drop table MIG_ATTACHMENT; drop table MIG_CLOUD_SITE; drop table MIG_DB_CHANGELOG; drop table MIG_DB_CHANGELOG_LOCK; drop table MIG_PLAN; drop table MIG_SEQUENCES; drop table MIG_STATS; drop table MIG_STEP; drop table MIG_TASK; drop table MIG_WORK_ITEM;