server icon indicating copy to clipboard operation
server copied to clipboard

Update from 20.01 to 20.0.2 failed!

Open NielsHansa opened this issue 6 years ago • 9 comments

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 :)

NielsHansa avatar Nov 19 '20 16:11 NielsHansa

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

NielsHansa avatar Nov 19 '20 16:11 NielsHansa

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

NielsHansa avatar Nov 19 '20 17:11 NielsHansa

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 avatar Nov 19 '20 17:11 NielsHansa

@NielsHansa when you say it was not set in MySQL do you mean mysql conf?

john-2000 avatar Nov 19 '20 20:11 john-2000

Yes. Exactly.

NielsHansa avatar Nov 20 '20 20:11 NielsHansa

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

mellmers avatar Nov 25 '20 07:11 mellmers

Worked for me. Thanks a lot, you saved me lots of hours of work!!!

oleander798 avatar Nov 25 '20 13:11 oleander798

I have the same issue however the route you took to repair did not work for me...any suggestions?

corro69 avatar Apr 23 '21 03:04 corro69

I had the additional issue, that the table itself was not "DYNAMIC" but "COMPRESSED".

Steinies avatar Apr 08 '22 19:04 Steinies