Installation of plugins is broken in Mautic package
-
I tried to install Mautic plugins from the marketplace:
- <YOURDOMAIN>/s/marketplace/detail/cronfig/mautic-cronfig and
- <YOURDOMAIN>/s/marketplace/detail/acquia/mc-cs-plugin-custom-objects
Installation fails, even after enabling required option "Update Mautic through Composer [BETA]", which is required for this to work.
Relevant log messages:
[2023-12-30 02:07:19] mautic.ERROR: Installation of plugin through Composer has failed: [] {"hostname":"REDACTED","pid":2156} [2023-12-30 02:07:40] mautic.WARNING: PHP Warning - require(/run/mautic/var/cache/pro_/ContainerZbFAU4B/getSwiftmailer_EmailSender_ListenerService.php): failed to open stream: No such file or directory - in file /run/mautic/var/cache/pro_/ContainerZbFAU4B/appAppKernelProdContainer.php - at line 2346 {"file":"getSwiftmailer_EmailSender_ListenerService.php","lazyLoad":true} {"hostname":"REDACTED","pid":2156} [2023-12-30 02:07:40] mautic.ERROR: PHP Notice: require(): Failed opening required '/run/mautic/var/cache/pro_/ContainerZbFAU4B/getSwiftmailer_EmailSender_ListenerService.php' (include_path='.:/usr/share/php') - in file /run/mautic/var/cache/pro_/ContainerZbFAU4B/appAppKernelProdContainer.php - at line 2346 [] {"hostname":"REDACTED","pid":2156} [2023-12-30 02:07:40] mautic.WARNING: PHP Warning - Cannot modify header information - headers already sent by (output started at /app/code/vendor/symfony/http-foundation/Response.php:1238) - in file /app/code/app/bundles/CoreBundle/ErrorHandler/ErrorHandler.php - at line 481 {"error":{"inline":null,"type":64,"message":"The site is currently offline due to encountering an error. If the problem persists, please contact the system administrator. System administrators, check server logs for errors.","logMessage":null,"line":2346,"file":"/run/mautic/var/cache/pro_/ContainerZbFAU4B/appAppKernelProdContainer.php","trace":[{"namespace":"","short_class":"","class":"","type":"","function":"","file":"/run/mautic/var/cache/pro_/ContainerZbFAU4B/appAppKernelProdContainer.php","line":2346,"args":[]}],"context":[],"showExceptionMessage":false,"previous":null},"inTemplate":false,"isAjax":true,"dataArray":{"errors":[{"message":"The site is currently offline due to encountering an error. If the problem persists, please contact the system administrator. System administrators, check server logs for errors.","code":500,"type":null}]}} {"hostname":"REDACTED","pid":2156} [2023-12-30 02:07:40] mautic.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Notice: require(): Failed opening required '/run/mautic/var/cache/pro_/ContainerZbFAU4B/getSwiftmailer_EmailSender_ListenerService.php' (include_path='.:/usr/share/php') - in file /run/mautic/var/cache/pro_/ContainerZbFAU4B/appAppKernelProdContainer.php - at line 2346 [] {"hostname":"REDACTED","pid":2156} [2023-12-30 02:16:26] mautic.ERROR: Installation of plugin through Composer has failed: [] {"hostname":"REDACTED","pid":2708} [2023-12-30 02:16:45] mautic.WARNING: PHP Warning - require(/run/mautic/var/cache/pro_/ContainerURpx9i3/getSwiftmailer_EmailSender_ListenerService.php): failed to open stream: No such file or directory - in file /run/mautic/var/cache/pro_/ContainerURpx9i3/appAppKernelProdContainer.php - at line 2346 {"file":"getSwiftmailer_EmailSender_ListenerService.php","lazyLoad":true} {"hostname":"REDACTED","pid":2708} [2023-12-30 02:16:45] mautic.ERROR: PHP Notice: require(): Failed opening required '/run/mautic/var/cache/pro_/ContainerURpx9i3/getSwiftmailer_EmailSender_ListenerService.php' (include_path='.:/usr/share/php') - in file /run/mautic/var/cache/pro_/ContainerURpx9i3/appAppKernelProdContainer.php - at line 2346 [] {"hostname":"REDACTED","pid":2708} [2023-12-30 02:16:45] mautic.WARNING: PHP Warning - Cannot modify header information - headers already sent by (output started at /app/code/vendor/symfony/http-foundation/Response.php:1238) - in file /app/code/app/bundles/CoreBundle/ErrorHandler/ErrorHandler.php - at line 481 {"error":{"inline":null,"type":64,"message":"The site is currently offline due to encountering an error. If the problem persists, please contact the system administrator. System administrators, check server logs for errors.","logMessage":null,"line":2346,"file":"/run/mautic/var/cache/pro_/ContainerURpx9i3/appAppKernelProdContainer.php","trace":[{"namespace":"","short_class":"","class":"","type":"","function":"","file":"/run/mautic/var/cache/pro_/ContainerURpx9i3/appAppKernelProdContainer.php","line":2346,"args":[]}],"context":[],"showExceptionMessage":false,"previous":null},"inTemplate":false,"isAjax":true,"dataArray":{"errors":[{"message":"The site is currently offline due to encountering an error. If the problem persists, please contact the system administrator. System administrators, check server logs for errors.","code":500,"type":null}]}} {"hostname":"REDACTED","pid":2708} [2023-12-30 02:16:45] mautic.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Notice: require(): Failed opening required '/run/mautic/var/cache/pro_/ContainerURpx9i3/getSwiftmailer_EmailSender_ListenerService.php' (include_path='.:/usr/share/php') - in file /run/mautic/var/cache/pro_/ContainerURpx9i3/appAppKernelProdContainer.php - at line 2346 [] {"hostname":"REDACTED","pid":2708} [2023-12-30 02:17:37] mautic.ERROR: Installation of plugin through Composer has failed: [] {"hostname":"REDACTED","pid":2708} [2023-12-30 02:17:55] mautic.WARNING: PHP Warning - require(/run/mautic/var/cache/pro_/ContainerJ96qeYb/getSwiftmailer_EmailSender_ListenerService.php): failed to open stream: No such file or directory - in file /run/mautic/var/cache/pro_/ContainerJ96qeYb/appAppKernelProdContainer.php - at line 2346 {"file":"getSwiftmailer_EmailSender_ListenerService.php","lazyLoad":true} {"hostname":"REDACTED","pid":2708} [2023-12-30 02:17:55] mautic.ERROR: PHP Notice: require(): Failed opening required '/run/mautic/var/cache/pro_/ContainerJ96qeYb/getSwiftmailer_EmailSender_ListenerService.php' (include_path='.:/usr/share/php') - in file /run/mautic/var/cache/pro_/ContainerJ96qeYb/appAppKernelProdContainer.php - at line 2346 [] {"hostname":"REDACTED","pid":2708} [2023-12-30 02:17:55] mautic.WARNING: PHP Warning - Cannot modify header information - headers already sent by (output started at /app/code/vendor/symfony/http-foundation/Response.php:1238) - in file /app/code/app/bundles/CoreBundle/ErrorHandler/ErrorHandler.php - at line 481 {"error":{"inline":null,"type":64,"message":"The site is currently offline due to encountering an error. If the problem persists, please contact the system administrator. System administrators, check server logs for errors.","logMessage":null,"line":2346,"file":"/run/mautic/var/cache/pro_/ContainerJ96qeYb/appAppKernelProdContainer.php","trace":[{"namespace":"","short_class":"","class":"","type":"","function":"","file":"/run/mautic/var/cache/pro_/ContainerJ96qeYb/appAppKernelProdContainer.php","line":2346,"args":[]}],"context":[],"showExceptionMessage":false,"previous":null},"inTemplate":false,"isAjax":true,"dataArray":{"errors":[{"message":"The site is currently offline due to encountering an error. If the problem persists, please contact the system administrator. System administrators, check server logs for errors.","code":500,"type":null}]}} {"hostname":"REDACTED","pid":2708} [2023-12-30 02:17:55] mautic.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Notice: require(): Failed opening required '/run/mautic/var/cache/pro_/ContainerJ96qeYb/getSwiftmailer_EmailSender_ListenerService.php' (include_path='.:/usr/share/php') - in file /run/mautic/var/cache/pro_/ContainerJ96qeYb/appAppKernelProdContainer.php - at line 2346 [] {"hostname":"REDACTED","pid":2708}
Is this related to the architecture of the Mautic image? Are required paths within the read only space? Could it be, that the cache and plugins directory are not writable?
-
Mautic plug-in marketplace requires Composer installation. Right now this is quite broken/difficult to manage.
It will be default/only way in Mautic v5, so I've been just waiting for the dust to settle.
-
-
@dsp76 Currently, the only option is the good old "download zip and upload it". Alternatively, you can also wget it. For the first way:
As a user with the correct role, switch to the settings view of your mautic instance on Cloudron.
Switch to File Manager
From here to plugins
And then upload your zip.
Go to the Terminal (see the first screenshot or use the shortcut directly from the file manager window), change the directory to Plugins (cd /app/data/plugins/). Unzip the zip file, delete it and change the owner of the new files (chown -R www-data: NewUploadedPluginBundle).
It is recommended to clear the cache (https://docs.cloudron.io/apps/mautic/ sudo -E -u www-data php /app/code/bin/console cache:clear)
That's what I remember from my last plugin installation. If I've forgotten something important, feel free to add it here.
-
Yes, because Composer is a beast in combination with a read-only file system.
-
Then we seem to require support by the cloudron team to get one or the other Amazon AWS SES plugin added by default to the Mautic Package (https://forum.cloudron.io/topic/10885/3rd-party-email-transports-on-mautic-5/19?_=1712869768070) and also other plugins.
... which is a bit of a problem, as it would increase the maintenance effort for Cloudron (core updates + plugin updates = package updates). On the other hand, if there is no real solution Mautic users on cloudron may be locked out from future developments in the marketplace as well.
Do you see a solution? Would it maybe require to have a Mautic Dev package - same as with the WordPress Dev package, which contains managed images, but are not read only for the core files?
-
@dsp76 yeah, marketplace does not work well in cloudron packaging context.
To me, using "composer" is equivalent to managing a development environment. It modifies dependencies and you are on your own for future update of mautic and the plugin. At this point, you are making the sysadmin ... a developer. I think if people want to go down this route, the LAMP app is the preferred approach. WordPress dev is really no different than LAMP but with WordPress pre-installed.
In some ecosystems, like WordPress, you can just download release bundles and upload it into a plugin directory. This approach would be preferred instead of making the user run composer and having the dependencies of mautic itself changed. Does mautic support simply uploading plugins?
-
G girish referenced this topic on
-
Yes - it works for plugins, that don't require composer to run. So I guess whenever someone needs to have more than just "standard" setup - LAMP is the way to go.
I don't quite understand, that the included E-Mail transport in Mautic for AWS is now so basic compared to the features before (no API access, no bounce handling) and for real use we now need a composer based plugin.
At the end all Mautic installs I managed or suggested to clients in the past included AWS SES with API and proper bounce handling. It means that Mautic on Cloudron is not making things easier anymore for future prospects - which is in no way meant to be complaining about Cloudron, just about the situation.
-
@dsp76 yeah, I am not sure why all these are "plugins" . It seems like it should part of the basic software. But let me set aside my rant on plugins for the moment
In general, you can always run composer on your laptop/somewhere and upload the result, no?
Let me try experiment with the approach mautic has taken and get back.
-
@girish I will need to check with our devs. I fear that the composer requires some write access in protected directories - so if it changes or adds something, for instance in the /vendor directory, this will be in the protected environment in Cloudron, right?
Looking forward to your experiences. Thanks a lot!
(I promoted the Cloudron approach in a recent community call in D/A/CH... so I could imagine there are some people watching the progress too. No pressure
)
-
D dsp76 referenced this topic on
-
@girish no that won't work, as the installation needs the central composer.json and also update it. It also loads more directories into the vendor directory, which is read-only in Cloudron. Did you come to some conclusion with your experiments?
Looks to me like the Mautic plugin concept doesn't work well with the Cloudron way of things.
Potential Scenarios:
- Plugins should be installed with composer, a lot of directories and the central composer.json would need to be writable... not good.
- Cloudron Mautic image would have some basic required plugins preinstalled, how to decide which? For me it would be (AWS)Mail, Custom Objects, Multi Domain plugins. Probably it would need to be different mailers. But this would increase maintenance, as plugins may have urgent updates outside of release cycles of Mautic.
- Cloudron set up like WordPress (Dev) - like a preinstall but without continuous updates of core (because that would kill customizations). A little improvement, as the initial installation is fine and working (at least causing 50% of Mautic beginners trouble otherwise).
- Cloudron self maintained on LAMP stack. Almost all the benefits of Cloudron lost.
Which other options did I miss?
-
@dsp76 I think your analysis is spot on. I don't really have a solution. I think people who want to use custom plugins/marketplace will have to use the LAMP app and install mautic themselves.
Just my 2c . As it stands, mautic's marketplace/plugin mechanism is untenable. Basically, a plugin can have random requirements, and it can change the dependencies that mautic was actually tested and released with. If you install multiple plugins.. forget updates, even the installation is at best in an unknown state and one has to go with "it worked when i clicked around". I doubt Mautic upstream devs have the resources to debug such setups. Indeed, I don't know who this system is intended for. I am not part of Mautic community, so I might be completely missing the point of plugins.
About the actual plugins themselves:
- Multi Domain plugins does not work with Mautic 5 .
- For the AWS bounce processing, this thread suggests some plugins. Those plugins don't even have 5 stars. In fact, one of them has 0 stars. I think pre-bundling such code is out of question.
- Custom Objects - is actually maintained. And tbh, it's the only plugin which is developed in entire Mautic it seems
Maybe because this is also by the authors of Mautic.
This is not a critique of Mautic, we use Mautic ourselves. Just that one has to limit oneself to using it without plugins.
-
I've been trying to install Mautic via the LAMP app and it seems like it won't work. Has anyone been able to do this successfully?
-
@Dave-Swift I did. I needed to tweak composer a bit. I think I needed to change some environment variable, as composer did expect to write to a read only directory. I wanted to look it up in my shell history, but thats empty now...
-
Thanks @dsp76. I figured it was something like that.
It would be great to have a one-click Mautic Dev install, like we have for WordPress!
-
@dsp76 said in Installation of plugins is broken in Mautic package:
@Dave-Swift I did. I needed to tweak composer a bit. I think I needed to change some environment variable, as composer did expect to write to a read only directory. I wanted to look it up in my shell history, but thats empty now...
So, how does it sounds like until now would that be sustainable?
And, is it just me or it seems like since Mautic 5 and Cloudron 8.x it is incredibly slooow to save things in configuration sometimes it takes up to a minute?
And I run A BIG server. Anyone has noticed such thing or would be aware of the reason for this slow configuration saving? -
@micmc said in Installation of plugins is broken in Mautic package:
And, is it just me or it seems like since Mautic 5 and Cloudron 8.x it is incredibly slooow to save things in configuration sometimes it takes up to a minute?
Can you maybe open a separate thread about this? Are you able to reproduce this with the demo instance?