Nextcloud update problem due to database configuration

I encountered a problem during an update from Nextcloud 18.0.2 to 18.0.4 running with MariaDB during the step concerning Mail update :

Doctrine\DBAL\Exception\DriverException: An exception occurred while executing ‘ALTER TABLE oc_mail_mailboxes DROP sync_token’: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

Add to your MariaDB config file, in the section InnoDB

innodb_large_prefix=true
innodb_file_format=barracuda
innodb_file_per_table=1

After that, the update ran perfectly.

It is not useless to run the following command (to be honest, I don’t remember if I did it and if it is necessary but it can’t hurt) after taking place into the Nextcloud directory :

sudo -u www-data php occ maintenance:mode --on
sudo -u www-data php occ maintenance:repair
sudo -u www-data php occ maintenance:mode --off

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *