Critical error while upgrading to 4.7.0

The upgrade to Matomo 4.7.0 went to the following error while the database converting is running:

Kritischer Fehler während der Aktualisierung:
/srv/www/vhosts/ Error trying to execute the migration ‘ALTER TABLE matomo_changes ADD UNIQUE KEY unique_plugin_version_title (plugin_name, version, title);’. The error was: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

Hello Martin,

I had the same issue this morning and just solved it with a simple command ! :slight_smile:
Try to update the limit with this command :

SET @@global.innodb_large_prefix = 1;

(You need to have accès to your database)

And if you want to push the migration yourself :

USE matomo; //(replace matomo by your database name)
SET @@global.innodb_large_prefix = 1;
ALTER TABLE `matomo_changes` ADD UNIQUE KEY unique_plugin_version_title (`plugin_name`, `version`, `title`);

Hope it will solve your problem,

Hi Ronan, I still get this error after trying your code

#1709 - Index column size too large. The maximum column size is 767 bytes.

Hi Marcel,

What is your MySQL version ?
Is your table in using INNODB engine ?


Hi Ronan, yes, InnoDB

  • Server version: 5.5.68-MariaDB - MariaDB Server

I asked my host to upgrade to 5.7 but they advised against it as it can break other stuff on my server. Unbelievable that the Matomo updater don’t check this things upfront. I can’t do anything in Matomo right now as it’s stuk on the update progress

my host also advises me to upgrade to 5.7
So I will create a 5.7 database, import the 5.5 and see.

Maybe you could try to download your database, fix it on a local environement and then reupload ?
(By fixing it, I would say to try again to fix the limit issue)

I don’t think MariaDB 5.7 will fix your problem, I had the exact same issue with MariaDB 5.7 and fixed it with the command lines above.

For security reasons, you need to update your database version, but it’s not the cause of your problem right now.


This sounds like the same issue as reported here:

I’ll report back here once more is known about it.

Version 4.7.1 is available now and fixed this issue.