# Installing plugin breaks console

**URL:** <https://forum.mautic.org/t/installing-plugin-breaks-console/17831>\
**Category:** Product Support\
**Tags:** development\
**Created:** [January 18, 2021, 3:45pm UTC](https://forum.mautic.org/t/installing-plugin-breaks-console/17831 "2021-01-18T15:45:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bas](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bas/32/547_2.png) [@bas](https://forum.mautic.org/u/bas)\
**Post date:** [January 18, 2021, 3:45pm UTC](https://forum.mautic.org/t/installing-plugin-breaks-console/17831/1 "2021-01-18T15:45:33Z")

</div>

**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](https://github.com/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.

---

<div class="post-metadata">

**Author:** ![bas](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bas/32/547_2.png) [@bas](https://forum.mautic.org/u/bas)\
**Post date:** [January 19, 2021, 7:59am UTC](https://forum.mautic.org/t/installing-plugin-breaks-console/17831/2 "2021-01-19T07:59:13Z")

</div>

After some more testing I found the reason of it breaking. It has to do with the origin of the Mautic installation. When you install it using a downloaded zip and then install the plugin using composer, it does not work, but when you clone the repo (I cloned tag 2.16.3 to test) from Github, it works without any problems.

I think this has to do with the vendor map which is included in the zip download, but is not included in the git clone.

When updating Mautic 2 you get warned about using a cloned version, in stead of a downloaded one. Is there a way to download Mautic using the zip, but still install plugins using composer?

---

<div class="post-metadata">

**Author:** ![DavidSchargel](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/davidschargel/32/2287_2.png) [@DavidSchargel](https://forum.mautic.org/u/DavidSchargel)\
**Post date:** [January 19, 2021, 2:07pm UTC](https://forum.mautic.org/t/installing-plugin-breaks-console/17831/3 "2021-01-19T14:07:48Z")

</div>

> [@bas](#):
>
> I think this has to do with the vendor map which is included in the zip download, but is not included in the git clone.

What happens if you run `composer update`?

---

<div class="post-metadata">

**Author:** ![DavidSchargel](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/davidschargel/32/2287_2.png) [@DavidSchargel](https://forum.mautic.org/u/DavidSchargel)\
**Post date:** [January 19, 2021, 2:21pm UTC](https://forum.mautic.org/t/installing-plugin-breaks-console/17831/4 "2021-01-19T14:21:45Z")

</div>

Also, try using composer v1 and not the current release. I’m not familiar with the error message you’re seeing, but it’s worth a try.

---

<div class="post-metadata">

**Author:** ![bas](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bas/32/547_2.png) [@bas](https://forum.mautic.org/u/bas)\
**Post date:** [January 19, 2021, 3:07pm UTC](https://forum.mautic.org/t/installing-plugin-breaks-console/17831/5 "2021-01-19T15:07:58Z")

</div>

Ah, didn’t even think of that… But unfortunately, it didn’t work. It resulted in this, which cleared the whole vendor map of all the dependencies:  
Loading composer repositories with package information  
Updating dependencies (including require-dev)  
Package operations: 0 installs, 0 updates, 142 removals

I use composer1.10.19. When using composer 2 I get different errors, so decided against trying to get that to work 😃 .

Thanks for the idea. But I think I’ll recommend my client to just install the plugin with the folder itself.

Might be an idea for Mautic to include the composer.json and composer.lock files in the build zip. I think (will test this later) this will also fix my problem. The only thing I wonder is if that is excluded with a reason?

---

<div class="post-metadata">

**Author:** ![DavidSchargel](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/davidschargel/32/2287_2.png) [@DavidSchargel](https://forum.mautic.org/u/DavidSchargel)\
**Post date:** [January 19, 2021, 3:13pm UTC](https://forum.mautic.org/t/installing-plugin-breaks-console/17831/6 "2021-01-19T15:13:38Z")

</div>

You might want to follow the Composer Initiative that was announced at Mauticon 2020. I don’t have the JIRA/Confluence links though the Slack Channel can be found at: [https://mautic.slack.com/archives/C01E8F6T2HM](https://mautic.slack.com/archives/C01E8F6T2HM)
