Update von 15.0.7 auf 16.0.0 funktioniert nicht: 1071 Specified key was too long; max key length is 767 bytes

Der Web-Update bleibt mit folgender Fehlermeldung stehen:

Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'CREATE TABLE oc_login_flow_v2 (id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL, timestamp BIGINT UNSIGNED NOT NULL, started SMALLINT UNSIGNED DEFAULT 0 NOT NULL, poll_token VARCHAR(255) NOT NULL, login_token VARCHAR(255) NOT NULL, public_key TEXT NOT NULL, private_key TEXT NOT NULL, client_name VARCHAR(255) NOT NULL, login_name VARCHAR(255) DEFAULT NULL, server VARCHAR(255) DEFAULT NULL, app_password VARCHAR(1024) DEFAULT NULL, UNIQUE INDEX poll_token (poll_token), UNIQUE INDEX login_token (login_token), INDEX timestamp (timestamp), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin ENGINE = InnoDB ROW_FORMAT = compressed': SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

Das Update auf MySQL 4-byte-support habe ich bereits VOR dem Update auf 16.0.0 gemacht: https://docs.nextcloud.com/server/15/admin_manual/configuration_database/mysql_4byte_support.html

Wie kriege ich NC wieder zum Laufen?

Nextcloud hängt jetzt bei diesem Fenster:

Wie kann ich es abbrechen, um einstweilen wieder mit der Version 15.0.7 zu arbeiten?

Konnte das Problem lösen.

Habe zwar seinerzeit auf MySQL 4-byte-support upgraded, aber einige Tabellen hatten doch noch das alte Format (Antelope, vermutlich durch nachträgliche Installation von Apps). Nachdem ich diese auch umgestellt hatte, konnte ich das Upgrade auf 16.0.0 fortsetzen.

In Nextcloud 15 gibt es in den Administrator-Einstellungen eine Funktion die prüft, ob die Datenbank bereits auf Barracuda umgestellt wurde. Das war bei mir der Fall, da die entsprechende Fehlermeldung nicht mehr aufgetaucht ist.

Fazit: der Updater prüft nicht, ob alle Tabellen das Barracuda-Format haben.

Also prüft vor dem Update auf 16.0.0, ob alle Tabellen auf Barracuda umgestellt wurden!

Hallo,
wo genau findet man diese Info (NC-15.0.8.1)?
Danke + Gruß, NC

Hier:

Jain…, hier leider nicht (15.0.8.1):
Screen-2019-06-28_07-43-05

Es ist der Text in gelber Schrift gemeint. Wenn auf Barracuda umgestellt wird, verschwindet dieser.
Steht alles in der Administration Guide: Table of contents — Nextcloud 15 Administration Manual 15 documentation

Ich habe das gleiche Problem, aber es funktioniert nicht.

root@nextcloud:/usr/local/www/nextcloud # sudo -u www php occ config:system:set mysql.utf8mb4 --type boolean --value="true"
The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
System config value mysql.utf8mb4 set to boolean true
root@nextcloud:/usr/local/www/nextcloud # sudo -u www php occ maintenance:repair
The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
 - Repair MySQL collation
     - All tables already have the correct collation -> nothing to do
 - Repair mime types
 - Clean tags and favorites
     - 0 tags of deleted users have been removed.
     - 0 tags for delete files have been removed.
     - 0 tag entries for deleted tags have been removed.
     - 0 tags with no entries have been removed.
 - Repair invalid shares
 - Remove shares of a users root folder
 - Move .step file of updater to backup location
 - Fix potential broken mount points
     - No mounts updated
 - Repair invalid paths in file cache
 - Add log rotate job
 - Clear frontend caches
     - Image cache cleared
     - SCSS cache cleared
     - JS cache cleared
 - Clear every generated avatar on major updates
 - Add preview background cleanup job
 - Queue a one-time job to cleanup old backups of the updater
 - Repair pending cron jobs
     - No need to repair pending cron jobs.
 - Extract the vcard uid and store it in the db
 - Cleanup invalid photocache files for carddav
 - Add background job to cleanup login flow v2 tokens
 - Remove potentially over exposing share links
     - No need to remove link shares.
 - Fix component of birthday calendars
     - 1 birthday calendars updated.
 - Regenerating birthday calendars to use new icons and fix old birthday events without year
     - Repair step already executed
 - Fix broken values of calendar objects
    0 [>---------------------------]
 - Registering building of calendar search index as background job
     - Repair step already executed
 - Registering background jobs to update cache for webcal calendars
     - Added 0 background jobs to update webcal calendars
 - Clean up orphan event and contact data
     - 0 events without a calendar have been cleaned up
     - 0 properties without an events have been cleaned up
     - 0 changes without a calendar have been cleaned up
     - 0 contacts without an addressbook have been cleaned up
     - 0 properties without a contact have been cleaned up
     - 0 changes without an addressbook have been cleaned up
 - Remove activity entries of private events
     - Removed 0 activity entries
 - Delete orphaned ACL rules
 - Write default encryption module configuration to the database
 - Fix the share type of guest shares when migrating from ownCloud
 - Copy the share password into the dedicated column
 - Update OAuth token expiration times
 - Add background job to check for backup codes
root@nextcloud:/usr/local/www/nextcloud # sudo -u www php occ upgrade
The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Set log level to debug
Updating database schema
Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'CREATE TABLE oc_login_flow_v2 (id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL,
timestamp BIGINT UNSIGNED NOT NULL, started SMALLINT UNSIGNED DEFAULT 0 NOT NULL, poll_token VARCHAR(255) NOT NULL, login_token VARCHAR(255) NOT NULL, public_key TEXT NOT NULL, private_key TEXT NOT NULL, client_name VARCHAR(255) NOT NULL, login_name VARCHAR(255) DEFAULT NULL, server VARCHAR(255) DEFAULT NULL, app_password VARCHAR(1024) DEFAULT NULL, UNIQUE INDEX poll_token (poll_token), UNIQUE INDEX login_token (login_token), INDEX timestamp (timestamp), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin ENGINE = InnoDB ROW_FORMAT = compressed':

SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
Update failed
Maintenance mode is kept active
Reset log level
root@nextcloud:/usr/local/www/nextcloud #


root@nextcloud:/usr/local/www/nextcloud # mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 76
Server version: 5.6.43 Source distribution

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

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

mysql> show variables like 'innodb_file_format';
+--------------------+----------+
| Variable_name      | Value    |
+--------------------+----------+
| innodb_file_format | Antelope |
+--------------------+----------+
1 row in set (0.00 sec)

mysql> show variables like 'innodb_file_per_table';
+-----------------------+-------+
| Variable_name         | Value |
+-----------------------+-------+
| innodb_file_per_table | ON    |
+-----------------------+-------+
1 row in set (0.00 sec)

mysql>

Okay, I forgot to add

[mysqld]
# [...]
innodb_large_prefix=true
innodb_file_format=barracuda
innodb_file_per_table=1

to /usr/local/my.cnf

1 Like