Closed hyzteric closed 11 months ago
Hi @hyzteric, thank you for raising the issue.
To be able to establish this is a true issue and not a one off or configuration specific issue, can you try if the same works/doesn't work on a different linux machine perhaps? I just tried following the same steps but didn't get any errors locally on a MacOS. Tried PHP 8.1, 8.2 and 8.3.
Is the above the only content in your config.ini.php
file or did you put anything extra there?
The file plugins/CoreConsole/Commands/GenerateAngularComponent.php
no longer exists in Matomo 5. Due to internal code changes in this major release old files might break Matomo. Like in this case. Removing it manually and should fix the problem.
Which version did you update from?
Here we should be likely adding another update script that will remove these files automatically should someone not removing it themselves to avoid upgrade issues.
I believe we've done this in the past and noticed this was necessary to avoid some update issues for some people. We could check which dimensions and commands were removed and remove those files manually maybe?
It's something we probably also want to document as part of our process so it won't be forgotten next time.
Ok so I did delete those two files (supposing it was the same issue for the second one) and it went through:
Upgrading from 4.16
@tsteur That wouldn't help for that specific scenario. When simply overwriting the installation with new files, old files can always cause issues. Removing them in an update script would work fine when updating through the UI. But on command line running any console command would fail due to the old files. So the update command would fail as well.
@sgiehl I based my update from this page : https://fr.matomo.org/faq/on-premise/update-matomo/ I think it would be great to add on that page a link to the changelogs where a specific section should be added with required manual operations when needed.
Also, I was not (and still am) not too sure if I could just remove the old directory, extract the new one and just copy my old config.ini.php over it. Would it break something? If not then I would do that next time. And maybe the update page should mention it too (https://fr.matomo.org/faq/on-premise/update-matomo/)
@hyzteric If you don't have any additional plugins installed that works without problems. If you have any those would be lost and would need to be reinstalled.
Thanks. That's what I thought so I'll stick to overwriting then.
Thanks for confirming that after manually removing the files you were able to finish the upgrade. Don't hesitate to open a new issue if you find any other (reproducible) bugs with Matomo 5.
This issue has been mentioned on Matomo forums. There might be relevant details there:
https://forum.matomo.org/t/update-matomo-4-16-0-5-0-0-error/54668/4
What happened?
I tried to upgrade to Matomo 5.0 and do it manually since I will do it on a high traffic website. When I wanted to run console commands, I got a PHP Fatal Error.
What should happen?
There should be no error when running the ./console help 😁
How can this be reproduced?
Download latest version
wget https://builds.matomo.org/matomo.zip
Extract it to "matomo/" directory
unzip -o matomo.zip
Set file ownership
chown -R apache:apache /var/web/matomo
Disable Matomo Tracking and web interface via config/config.ini.php,
Check for any obsolete files
=> PHP Fatal error: Cannot override final method Piwik\Plugin\ConsoleCommand::execute() in /var/web/matomo/plugins/CoreConsole/Commands/GenerateAngularComponent.php on line 27
Then I tried this :
./console help
=> PHP Fatal error: Cannot override final method Piwik\Plugin\ConsoleCommand::execute() in /var/web/matomo/plugins/CoreConsole/Commands/GenerateAngularComponent.php on line 27Then I put the backup back, run the same console command => No error
Matomo version
5.0
PHP version
8.1.25 (cli)
Server operating system
Rocky Linux 8.8
What browsers are you seeing the problem on?
Not applicable (e.g. an API call etc.)
Computer operating system
Windows 10
Relevant log output
No response
Validations