Your software
My Mautic version is: 2.16.4 (but it looks like it also doesn’t work in 3.2.2, although I haven’t tested it yet)
My PHP version is: PHP 7.2.34
My Database type and version is: MySQL 5.7.32
My Composer version is: 1.10.19
Your problem
My problem is: After resetting my MacBook I had to reinstall Mautic. After a clean install of Mautic (using the zip downloaded from Github), the console works. But when I install (using composer) a small extension I wrote (which works on other servers with the same Mautic version and php7.2.21, haven’t tested 7.2.34 yet) the console doesn’t work anymore and I get the error shown below. (This is logged to the terminal, not the log file).
The plugin I wrote is GitHub - bastolen/mautic-message-extension, which has no other dependencies then mautic/composer-plugin
.
The error points to MauticApiBundle, which is located just fine by VS Code with app/bundles/ApiBundle/MauticApiBundle.php
as reletive path.
These errors are showing in the log:
PHP Fatal error: Uncaught Error: Class ‘Mautic\ApiBundle\MauticApiBundle’ not found in /Users/bastolen/git/mautic/mautic2/app/AppKernel.php:160
Stack trace:
#0 /Users/bastolen/git/mautic/mautic2/vendor/symfony/http-kernel/Kernel.php(431): AppKernel->registerBundles()
#1 /Users/bastolen/git/mautic/mautic2/app/AppKernel.php(264): Symfony\Component\HttpKernel\Kernel->initializeBundles()
#2 /Users/bastolen/git/mautic/mautic2/vendor/symfony/framework-bundle/Console/Application.php(62): AppKernel->boot()
#3 /Users/bastolen/git/mautic/mautic2/vendor/symfony/console/Application.php(117): Symfony\Bundle\FrameworkBundle\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /Users/bastolen/git/mautic/mautic2/app/console(43): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 {main}
thrown in /Users/bastolen/git/mautic/mautic2/app/AppKernel.php on line 160
Fatal error: Uncaught Error: Class ‘Mautic\ApiBundle\MauticApiBundle’ not found in /Users/bastolen/git/mautic/mautic2/app/AppKernel.php:160
Stack trace:
#0 /Users/bastolen/git/mautic/mautic2/vendor/symfony/http-kernel/Kernel.php(431): AppKernel->registerBundles()
#1 /Users/bastolen/git/mautic/mautic2/app/AppKernel.php(264): Symfony\Component\HttpKernel\Kernel->initializeBundles()
#2 /Users/bastolen/git/mautic/mautic2/vendor/symfony/framework-bundle/Console/Application.php(62): AppKernel->boot()
#3 /Users/bastolen/git/mautic/mautic2/vendor/symfony/console/Application.php(117): Symfony\Bundle\FrameworkBundle\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /Users/bastolen/git/mautic/mautic2/app/console(43): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 {main}
thrown in /Users/bastolen/git/mautic/mautic2/app/AppKernel.php on line 160
Steps I have tried to fix the problem:
Reinstalling PHP, Composer and Mautic.