Update Matomo 4.16.0 -> 5.0.0 error

Hello!

I tried to update Matomo from version 4.16.0 to 5.0.0 after going through the " The Manual Three-Step Update" descriped in " Update Matomo FAQ - On-Premise - Matomo Analytics Platform" with command
“./path_to_matomo_dir/console -core:update” with root rights.

Immediatly after running the command I got the console message
“PHP Fatal error: Cannot override final method Piwik\Plugin\ConsoleCommand::execute() in /var/www/swa_matomo/public/plugins/CoreConsole/Commands/GenerateAngularComponent.php on line 27”.

We are using Debian Version 11.8 and PHP Version 8.1.26.

Does anyone know what causes this message?
How can we solve this Error?

Thank you!

I hit this same error. As the site I use Matomo on doesn’t really rely on Matomo, I decided to take the risk and try and fix it. First, I unzipped matomo.zip somewhere else and then compared the two and Matomo 4 seems to have a lot of extra files that Matomo 5 does not.

So, after I did:

rm plugins/CoreConsole/Commands/GenerateAngularComponent.php
rm plugins/CoreConsole/Commands/GenerateAngularDirective.php

I could then get:

./console diagnostics:unexpected-files
./console diagnostics:unexpected-files --delete

to run and clean out all the v4 junk and then:

./console core:update

ran as well.

I think the Matomo folks need to add those lines to the instructions.

Note, even after this, when I went into System Check, it still found more files to delete in the File Integrity check.

1 Like

It works!
Thank you very much :smiley:!

Here is the corresponding issue on GitHub: https://github.com/matomo-org/matomo/issues/21718

1 Like