Digitalist-Open-Cloud / Matomo-Plugin-ExtraTools

ExtraTools is a plugin for Matomo, which provides some console commands.
https://digitalist.cloud/
GNU General Public License v3.0
26 stars 12 forks source link

Running "matomo:install" without "--force" fails: "getHelper can not be used" #41

Closed mbrodala closed 1 month ago

mbrodala commented 1 month ago

The matomo:install command uses the internal getHelper() API which is forbidden since Matomo 5.0.0:

https://github.com/Digitalist-Open-Cloud/Matomo-Plugin-ExtraTools/blob/48ac99c572e4717a26b999de79f036ae12edee2c/Commands/InstallMatomo.php#L221

The error:

$ ./console matomo:install ... -vvv
ERROR     [2024-10-08 12:43:28] 53  Uncaught exception: /var/www/html/core/Plugin/ConsoleCommand.php(349): getHelper can not be used [Query: , CLI mode: 1]

In ConsoleCommand.php line 349:

  [LogicException]           
  getHelper can not be used  

Exception trace:
  at /var/www/html/core/Plugin/ConsoleCommand.php:349
 Piwik\Plugin\ConsoleCommand->getHelper() at /var/www/html/plugins/ExtraTools/Commands/InstallMatomo.php:221
 Piwik\Plugins\ExtraTools\Commands\InstallMatomo->doExecute() at /var/www/html/core/Plugin/ConsoleCommand.php:109
 Piwik\Plugin\ConsoleCommand->execute() at /var/www/html/vendor/symfony/console/Command/Command.php:298
 Symfony\Component\Console\Command\Command->run() at /var/www/html/core/Plugin/ConsoleCommand.php:124
 Piwik\Plugin\ConsoleCommand->run() at /var/www/html/vendor/symfony/console/Application.php:1040
 Symfony\Component\Console\Application->doRunCommand() at /var/www/html/vendor/symfony/console/Application.php:301
 Symfony\Component\Console\Application->doRun() at /var/www/html/core/Console.php:113
 Piwik\Console->originDoRun() at n/a:n/a
 call_user_func() at /var/www/html/core/Console.php:152
 Piwik\Console->Piwik\{closure}() at /var/www/html/core/Access.php:672
 Piwik\Access::doAsSuperUser() at /var/www/html/core/Console.php:153
 Piwik\Console->doRunImpl() at /var/www/html/core/Console.php:92
 Piwik\Console->doRun() at /var/www/html/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at /var/www/html/console:32

See https://github.com/matomo-org/matomo/pull/20596

mikkeschiren commented 1 month ago

Thanks for the report - I will look into it, and pull requests are welcome!