Update from 20.01 to 20.0.2 failed!
Using the Web Updater the update failed with this message while updating the DB scheme:
Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'ALTER TABLE oc_authtoken CHANGE password_invalid password_invalid TINYINT(1) DEFAULT '0'': SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
Detaillierte Protokollmeldungen Update vorbereiten
Log-Level auf "debug" gesetzt
Wartungsmodus eingeschaltet
Reparaturschritt: Repair MySQL collation
Reparaturinformation: All tables already have the correct collation -> nothing to do
Reparaturschritt: Repair SQLite autoincrement
Reparaturschritt: Copy data from accounts table when migrating from ownCloud
Reparaturschritt: Drop account terms table when migrating from ownCloud
Das Datenbankschema wird aktualisiert
Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'ALTER TABLE oc_authtoken CHANGE password_invalid password_invalid TINYINT(1) DEFAULT '0'': SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
I am not an expert :) I am an educator managing nextcloud for a school in covid lockdown. Pls help :)
the following apps needed updating after the Nextcloud web updater ran:
Nextcloud wird auf Version 20.0.2 aktualisiert Folgende Apps werden aktualisiert: Activity (activity) WebDAV (dav) User status (user_status) Stellen Sie vor dem Fortsetzen bitte sicher, dass die Datenbank, der Konfigurationsordner und der Datenordner gesichert wurden.
I saved the DB, config and datafolders
I executed this: sudo -u fsh php ./occ upgrade
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
Setting log level to debug
Turned on maintenance mode
Updating database schema
Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'ALTER TABLE oc_authtoken CHANGE password_invalid password_invalid TINYINT(1) DEFAULT '0'':
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 Resetting log level
Found the problem and fixed it. innodb_large_prefix=true was not set in MySQL Set it and restarted mysqld. ./occ maintenance:repair ./occ upgrade and then ./occ db:add-missing-primary-keys did the trick fixing final issues
@NielsHansa when you say it was not set in MySQL do you mean mysql conf?
Yes. Exactly.
I had the same problem and your fix worked for me! Thank you very much, @NielsHansa
Addition: If you want a permanent solution, you should set following settings in your mysql.cnf:
[mysqld]
innodb_large_prefix=ON
innodb_file_format=Barracuda
innodb_file_per_table=ON
Worked for me. Thanks a lot, you saved me lots of hours of work!!!
I have the same issue however the route you took to repair did not work for me...any suggestions?
I had the additional issue, that the table itself was not "DYNAMIC" but "COMPRESSED".