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

Install with Matomo 4.3.1 fails #23

Closed mwithheld closed 2 years ago

mwithheld commented 3 years ago

Using this script following your Dockerfile in Issue #21

git clone https://github.com/matomo-org/matomo.git
cd matomo/
git checkout 4.3.1

git submodule init
git submodule update;
rm -rf .git;
chmod +x ./console

curl -sS https://getcomposer.org/installer | php;
php composer.phar install

git clone https://github.com/nodeone/extratools.git plugins/ExtraTools
./console plugin:activate ExtraTools

./console matomo:install

I get this error

./console matomo:install
Are you really sure you would like to install Matomo - if you have an installation already, it will be wiped? y
ERROR [2021-05-27 19:33:20] 1914235  Uncaught exception: Error: Class 'Symfony\Component\Process\Process' not found in matomo/plugins/ExtraTools/Lib/Drop.php:32
Stack trace:
#0 matomo/plugins/ExtraTools/Commands/InstallMatomo.php(233): Piwik\Plugins\ExtraTools\Lib\Drop->execute()
#1 matomo/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(257): Piwik\Plugins\ExtraTools\Commands\InstallMatomo->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 matomo/vendor/symfony/console/Symfony/Component/Console/Application.php(874): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 matomo/vendor/symfony/console/Symfony/Component/Console/Application.php(195): Symfony\Component\Console\Application->doRunCommand(Object(Piwik\Plugins\ExtraTools\Commands\InstallMatomo), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 [internal function]: Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 matomo/core/Console.php(130): call_user_func(Array, Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 matomo/core/Access.php(673): Piwik\Console->Piwik\{closure}()
#7 matomo/core/Console.php(131): Piwik\Access::doAsSuperUser(Object(Closure))
#8 matomo/core/Console.php(82): Piwik\Console->doRunImpl(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 matomo/vendor/symfony/console/Symfony/Component/Console/Application.php(126): Piwik\Console->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 matomo/console(32): Symfony\Component\Console\Application->run()
#11 {main}
Uncaught exception in matomo/plugins/ExtraTools/Lib/Drop.php line 32:
Class 'Symfony\Component\Process\Process' not found

It seems to me that dependency is no longer included

[urchin@tabby matomo]$ fgrep -ir 'Symfony\Component\Process' *
Binary file composer.phar matches
plugins/ExtraTools/Lib/Backup.php:use Symfony\Component\Process;
plugins/ExtraTools/Lib/Backup.php:use Symfony\Component\Process\Exception\ProcessFailedException;
plugins/ExtraTools/Lib/Defaults.php:use Symfony\Component\Process;
plugins/ExtraTools/Lib/Defaults.php:use Symfony\Component\Process\Exception\ProcessFailedException;
plugins/ExtraTools/Lib/ConfigManipulation.php:use Symfony\Component\Process;
plugins/ExtraTools/Lib/ConfigManipulation.php:use Symfony\Component\Process\Exception\ProcessFailedException;
plugins/ExtraTools/Lib/User.php:use Symfony\Component\Process;
plugins/ExtraTools/Lib/User.php:use Symfony\Component\Process\Exception\ProcessFailedException;
plugins/ExtraTools/Lib/Import.php:use Symfony\Component\Process;
plugins/ExtraTools/Lib/Import.php:use Symfony\Component\Process\Exception\ProcessFailedException;
plugins/ExtraTools/Lib/Create.php:use Symfony\Component\Process;
plugins/ExtraTools/Lib/Create.php:use Symfony\Component\Process\Exception\ProcessFailedException;
plugins/ExtraTools/Lib/Drop.php:use Symfony\Component\Process;
plugins/ExtraTools/Lib/Drop.php:use Symfony\Component\Process\Exception\ProcessFailedException;
tests/travis/generator/vendor/symfony/console/Tests/Helper/ProcessHelperTest.php:use Symfony\Component\Process\Process;
tests/travis/generator/vendor/symfony/console/Helper/ProcessHelper.php:use Symfony\Component\Process\Exception\ProcessFailedException;
tests/travis/generator/vendor/symfony/console/Helper/ProcessHelper.php:use Symfony\Component\Process\Process;
tests/travis/generator/vendor/symfony/console/Helper/ProcessHelper.php:use Symfony\Component\Process\ProcessBuilder;
tests/travis/generator/vendor/symfony/console/Shell.php:use Symfony\Component\Process\ProcessBuilder;
tests/travis/generator/vendor/symfony/console/Shell.php:use Symfony\Component\Process\PhpExecutableFinder;
vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php:use Symfony\Component\Process\Exception\LogicException;
vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php:use Symfony\Component\Process\Exception\ProcessFailedException;
vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php:use Symfony\Component\Process\Exception\RuntimeException;
vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php:use Symfony\Component\Process\PhpExecutableFinder;
vendor/symfony/console/Symfony/Component/Console/Tests/Helper/ProcessHelperTest.php:use Symfony\Component\Process\Process;
vendor/symfony/console/Symfony/Component/Console/Helper/ProcessHelper.php:use Symfony\Component\Process\Exception\ProcessFailedException;
vendor/symfony/console/Symfony/Component/Console/Helper/ProcessHelper.php:use Symfony\Component\Process\Process;
vendor/symfony/console/Symfony/Component/Console/Helper/ProcessHelper.php:use Symfony\Component\Process\ProcessBuilder;
vendor/symfony/console/Symfony/Component/Console/Shell.php:use Symfony\Component\Process\ProcessBuilder;
vendor/symfony/console/Symfony/Component/Console/Shell.php:use Symfony\Component\Process\PhpExecutableFinder;
vendor/sebastian/diff/tests/Output/Integration/UnifiedDiffOutputBuilderIntegrationTest.php:use Symfony\Component\Process\Process;
vendor/sebastian/diff/tests/Output/Integration/StrictUnifiedDiffOutputBuilderIntegrationTest.php:use Symfony\Component\Process\Process;
vendor/sebastian/diff/tests/Utils/UnifiedDiffAssertTraitIntegrationTest.php:use Symfony\Component\Process\Process;
vendor/composer/ca-bundle/src/CaBundle.php:use Symfony\Component\Process\PhpProcess;
vendor/composer/ca-bundle/src/CaBundle.php:        if (!class_exists('Symfony\Component\Process\PhpProcess')) {

Exactly the same error happens if I use https://builds.matomo.org/matomo-latest.tar.gz and unzip it.

As long as I specified the correct version, adding that component got me past the error and to the "Enter password:" prompt:

composer require symfony/process:~2.6.0

./console matomo:install
Are you really sure you would like to install Matomo - if you have an installation already, it will be wiped? y
Enter password:
mysqladmin: connect ...
jorgeuos commented 3 years ago

Hi, Thanks for a very good explanation. I was planning on test the new release today, but time flew by. Hopefully we'll look into it first thing tomorrow, if not tonight. Br, Jorge

jorgeuos commented 2 years ago

Hi again,

I've been on parental leave and just noticed that I hadn't replied.

This has been documented in the README#dependencies

However, I think it should work straight outta the box, since "symfony/console": "~2.6.0", is in require section nowadays.

Could be a PHP config constraint that doesn't look in Subnamespaces, I have a fix for that in 4.x-dev-fixes.

/Jorge