Server: Update 13.0.5 Error: Specified key was too long

Created on 4 Aug 2018  路  5Comments  路  Source: nextcloud/server

DoctrineDBALExceptionDriverException: An exception occurred while executing 'ALTER TABLE oc_addressbooks CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;': SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

bug

Most helpful comment

I observer the same issue upgrade from 13.0.4 to 13.0.5 on DietPi.

Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'ALTER TABLE `oc_addressbooks` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;': SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

Any work around for this issue? Currently, UI stock at Start Upgrade screen. Thanks in advance.

Update: @snakyjake1 I found your solution from #10449 and I applied it on DietPi like so

root@DietPi:/# sudo mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 10142
Server version: 10.0.35-MariaDB-0+deb8u1 (Raspbian)

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> set global innodb_large_prefix=on;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> set global innodb_file_format=Barracuda;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit;

Then Start upgrade again and it passed. Thanks so much! Cheers!

All 5 comments

GitMate.io thinks possibly related issues are https://github.com/nextcloud/server/pull/10350 (13.0.5), https://github.com/nextcloud/server/issues/4846 (During update: Specified key was too long), https://github.com/nextcloud/server/issues/9056 (Installation Error - Specified key was too long; max key length is 1000 bytes), https://github.com/nextcloud/server/issues/10449 (SQL errror when updating to 13.0.5), and https://github.com/nextcloud/server/issues/9815 (No update 13.0.3 possible).

I did follow:
https://docs.nextcloud.com/server/11/admin_manual/maintenance/mysql_4byte_support.html#mariadb-support

It's listed as "This is even more experimental." Perhaps part of the problem?

I observer the same issue upgrade from 13.0.4 to 13.0.5 on DietPi.

Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'ALTER TABLE `oc_addressbooks` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;': SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

Any work around for this issue? Currently, UI stock at Start Upgrade screen. Thanks in advance.

Update: @snakyjake1 I found your solution from #10449 and I applied it on DietPi like so

root@DietPi:/# sudo mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 10142
Server version: 10.0.35-MariaDB-0+deb8u1 (Raspbian)

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> set global innodb_large_prefix=on;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> set global innodb_file_format=Barracuda;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit;

Then Start upgrade again and it passed. Thanks so much! Cheers!

I am running from a shared Maria cluster. I only have permissions to change settings within the particular database in the cluster, not global variables. I currently experience this issue and cannot apply the suggested resolution. The above implies the shared case is not supported, but naturally, such support is preferable from a feature standpoint. I am not aware of whether Nextcloud expressly supports shared hosting, but I have understood that this kind of deployment has an active user base.

Thank you for reporting this issue :tada:

See this issue for more information https://github.com/nextcloud/server/issues/15058

Was this page helpful?
0 / 5 - 0 ratings