Plugin Installation error through marketplace

Your software
My Mautic version is: 4.4.9
My PHP version is: 7.4
My Database type and version is: Maria DB

Your problem
My problem is: Plugin installation from Marketplace fails every time

These errors are showing in the log:
[2023-06-28 07:52:34] mautic.ERROR: Installation of plugin through Composer has failed: {“hostname”:“ubuntu-s-1vcpu-2gb-blr1-01”,“pid”:28593}
[2023-06-28 07:53:06] mautic.ERROR: PHP Error: Maximum execution time of 30 seconds exceeded - in file /var/www/html/vendor/twig/twig/src/Loader/FilesystemLoader.php - at line 213 {“hostname”:“ubuntu-s-1vcpu-2gb-blr1-01”,“pid”:28593}
[2023-06-28 07:53:06] mautic.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Error: Maximum execution time of 30 seconds exceeded - in file /var/www/html/vendor/twig/twig/src/Loader/FilesystemLoader.php - at line 213 {“hostname”:“ubuntu-s-1vcpu-2gb-blr1-01”,“pid”:28593}
[2023-06-28 08:08:54] mautic.ERROR: Installation of plugin through Composer has failed: {“hostname”:“ubuntu-s-1vcpu-2gb-blr1-01”,“pid”:28597}
[2023-06-28 08:09:24] mautic.WARNING: PHP Warning - require(/var/www/html/docroot/var/cache/pro_/ContainerN6xetWx/getSwiftmailer_EmailSender_ListenerService.php): failed to open stream: No such file or directory - in file /var/www/html/docroot/var/cache/pro_/ContainerN6xetWx/appAppKernelProdContainer.php - at line 2338 {“file”:“getSwiftmailer_EmailSender_ListenerService.php”,“lazyLoad”:true} {“hostname”:“ubuntu-s-1vcpu-2gb-blr1-01”,“pid”:28597}
[2023-06-28 08:09:24] mautic.ERROR: PHP Notice: require(): Failed opening required ‘/var/www/html/docroot/var/cache/pro_/ContainerN6xetWx/getSwiftmailer_EmailSender_ListenerService.php’ (include_path=‘.:/usr/share/php’) - in file /var/www/html/docroot/var/cache/pro_/ContainerN6xetWx/appAppKernelProdContainer.php - at line 2338 {“hostname”:“ubuntu-s-1vcpu-2gb-blr1-01”,“pid”:28597}
[2023-06-28 08:09:24] mautic.WARNING: PHP Warning - Cannot modify header information - headers already sent by (output started at /var/www/html/vendor/symfony/http-foundation/Response.php:1239) - in file /var/www/html/docroot/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”:2338,“file”:“/var/www/html/docroot/var/cache/pro_/ContainerN6xetWx/appAppKernelProdContainer.php”,“trace”:[{“namespace”:“”,“short_class”:“”,“class”:“”,“type”:“”,“function”:“”,“file”:“/var/www/html/docroot/var/cache/pro_/ContainerN6xetWx/appAppKernelProdContainer.php”,“line”:2338,“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”:“ubuntu-s-1vcpu-2gb-blr1-01”,“pid”:28597}
[2023-06-28 08:09:24] mautic.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Notice: require(): Failed opening required ‘/var/www/html/docroot/var/cache/pro_/ContainerN6xetWx/getSwiftmailer_EmailSender_ListenerService.php’ (include_path=‘.:/usr/share/php’) - in file /var/www/html/docroot/var/cache/pro_/ContainerN6xetWx/appAppKernelProdContainer.php - at line 2338 {“hostname”:“ubuntu-s-1vcpu-2gb-blr1-01”,“pid”:28597}

Steps I have tried to fix the problem:
I couldnt make sense of it so i need help or guidance

I’m sorry that you hit this issue. The problem is that Composer can take time to install a package. It does many things in the background to ensure the plugin is compatible with all other packages and then downloading the package. All that can take more than 30 seconds. In your error message, there is:

Maximum execution time of 30 seconds exceeded

This means that in you php.ini configuration you have this directive:

https://www.php.net/manual/en/info.configuration.php#ini.max-execution-time

Set to 30 seconds, which is the default value.

There are 2 ways around it:

  1. Increase the max_execution_time config option to 1 minute or more.
  2. Use CLI to install the plugin as CLI have no time limits.

To install a plugin via CLI you run this command:
bin/console mautic:marketplace:install vendor/plugin

You’ll have to replace vendor/plugin with the plugin you want to install. This is visible now in the plugin detail page under the Repository value. So to shamelessly plug my plugin name, the Repository value is cronfig/mautic-cronfig. So the command to install the Cronfig plugin would look like this:

bin/console mautic:marketplace:install cronfig/mautic-cronfig

We obviously have to get this information to the marketplace UI and to the docs. If anyone could improve the user docs with this information and help the whole community, please update this doc:

https://mautic-documentation.readthedocs.io/en/5.x/marketplace/marketplace.html

1 Like

i tried changing the max execution time to 90 secs and tried again but this error in log showed up and installation failed:

[2023-06-28 10:28:42] mautic.ERROR: Installation of plugin through Composer has failed: {“hostname”:“ubuntu-s-1vcpu-2gb-blr1-01”,“pid”:38341}
[2023-06-28 10:29:15] mautic.WARNING: PHP Warning - require(/var/www/html/docroot/var/cache/pro_/ContainerObpVFnh/getSwiftmailer_EmailSender_ListenerService.php): failed to open stream: No such file or directory - in file /var/www/html/docroot/var/cache/pro_/ContainerObpVFnh/appAppKernelProdContainer.php - at line 2338 {“file”:“getSwiftmailer_EmailSender_ListenerService.php”,“lazyLoad”:true} {“hostname”:“ubuntu-s-1vcpu-2gb-blr1-01”,“pid”:38341}
[2023-06-28 10:29:15] mautic.ERROR: PHP Notice: require(): Failed opening required ‘/var/www/html/docroot/var/cache/pro_/ContainerObpVFnh/getSwiftmailer_EmailSender_ListenerService.php’ (include_path=‘.:/usr/share/php’) - in file /var/www/html/docroot/var/cache/pro_/ContainerObpVFnh/appAppKernelProdContainer.php - at line 2338 {“hostname”:“ubuntu-s-1vcpu-2gb-blr1-01”,“pid”:38341}
[2023-06-28 10:29:15] mautic.WARNING: PHP Warning - Cannot modify header information - headers already sent by (output started at /var/www/html/vendor/symfony/http-foundation/Response.php:1239) - in file /var/www/html/docroot/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”:2338,“file”:“/var/www/html/docroot/var/cache/pro_/ContainerObpVFnh/appAppKernelProdContainer.php”,“trace”:[{“namespace”:“”,“short_class”:“”,“class”:“”,“type”:“”,“function”:“”,“file”:“/var/www/html/docroot/var/cache/pro_/ContainerObpVFnh/appAppKernelProdContainer.php”,“line”:2338,“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”:“ubuntu-s-1vcpu-2gb-blr1-01”,“pid”:38341}
[2023-06-28 10:29:15] mautic.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Notice: require(): Failed opening required ‘/var/www/html/docroot/var/cache/pro_/ContainerObpVFnh/getSwiftmailer_EmailSender_ListenerService.php’ (include_path=‘.:/usr/share/php’) - in file /var/www/html/docroot/var/cache/pro_/ContainerObpVFnh/appAppKernelProdContainer.php - at line 2338 {“hostname”:“ubuntu-s-1vcpu-2gb-blr1-01”,“pid”:38341}

This looks like a cache issue. It cannot find some files in the var/cache folder. Try to delete the contents of the var/cache folder. The cache should regenerate itself on next request or command execution.

Also, after updating the php.ini file, you have to restart the server. Apache, Nginx or whatever server you use.

I did the restart for apache2 and after doing what you said i got this error in log and it failed again:
[2023-06-28 15:27:37] mautic.CRITICAL: Uncaught PHP Exception Mautic\MarketplaceBundle\Exception\ApiException: “cURL error 35: OpenSSL SSL_connect: Connection reset by peer in connection to packagist.org:443 (see libcurl - Error Codes) for https://packagist.org/search.json?page=1&per_page=1&type=mautic-plugin&q=mzagmajster/omnivery-mailer-bundle” at /var/www/html/docroot/app/bundles/MarketplaceBundle/Api/Connection.php line 50 {“exception”:“[object] (Mautic\MarketplaceBundle\Exception\ApiException(code: 0): cURL error 35: OpenSSL SSL_connect: Connection reset by peer in connection to packagist.org:443 (see libcurl - Error Codes) for https://packagist.org/search.json?page=1&per_page=1&type=mautic-plugin&q=mzagmajster/omnivery-mailer-bundle at /var/www/html/docroot/app/bundles/MarketplaceBundle/Api/Connection.php:50)”} {“hostname”:“ubuntu-s-1vcpu-2gb-blr1-01”,“pid”:40896}
[2023-06-28 15:28:29] mautic.ERROR: Installation of plugin through Composer has failed: {“hostname”:“ubuntu-s-1vcpu-2gb-blr1-01”,“pid”:40896}
[2023-06-28 15:29:00] mautic.WARNING: PHP Warning - require(/var/www/html/docroot/var/cache/pro_/ContainerO3DMpYF/getSwiftmailer_EmailSender_ListenerService.php): failed to open stream: No such file or directory - in file /var/www/html/docroot/var/cache/pro_/ContainerO3DMpYF/appAppKernelProdContainer.php - at line 2338 {“file”:“getSwiftmailer_EmailSender_ListenerService.php”,“lazyLoad”:true} {“hostname”:“ubuntu-s-1vcpu-2gb-blr1-01”,“pid”:40896}
[2023-06-28 15:29:00] mautic.ERROR: PHP Notice: require(): Failed opening required ‘/var/www/html/docroot/var/cache/pro_/ContainerO3DMpYF/getSwiftmailer_EmailSender_ListenerService.php’ (include_path=‘.:/usr/share/php’) - in file /var/www/html/docroot/var/cache/pro_/ContainerO3DMpYF/appAppKernelProdContainer.php - at line 2338 {“hostname”:“ubuntu-s-1vcpu-2gb-blr1-01”,“pid”:40896}
[2023-06-28 15:29:00] mautic.WARNING: PHP Warning - Cannot modify header information - headers already sent by (output started at /var/www/html/vendor/symfony/http-foundation/Response.php:1239) - in file /var/www/html/docroot/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”:2338,“file”:“/var/www/html/docroot/var/cache/pro_/ContainerO3DMpYF/appAppKernelProdContainer.php”,“trace”:[{“namespace”:“”,“short_class”:“”,“class”:“”,“type”:“”,“function”:“”,“file”:“/var/www/html/docroot/var/cache/pro_/ContainerO3DMpYF/appAppKernelProdContainer.php”,“line”:2338,“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”:“ubuntu-s-1vcpu-2gb-blr1-01”,“pid”:40896}
[2023-06-28 15:29:00] mautic.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Notice: require(): Failed opening required ‘/var/www/html/docroot/var/cache/pro_/ContainerO3DMpYF/getSwiftmailer_EmailSender_ListenerService.php’ (include_path=‘.:/usr/share/php’) - in file /var/www/html/docroot/var/cache/pro_/ContainerO3DMpYF/appAppKernelProdContainer.php - at line 2338 {“hostname”:“ubuntu-s-1vcpu-2gb-blr1-01”,“pid”:40896}

This seem to be some server config issue. I haven’t seen it yet. But if you Goole for

cURL error 35: OpenSSL SSL_connect: Connection reset by peer in connection

You get several ideas of what it could be and how to resolve it. Here is one of the anwers:

I created Adding marketplace command by escopecz · Pull Request #12529 · mautic/mautic · GitHub to add the command to the plugin detail page so users can just copy it, paste it to CLI and install without the issues that comes with the HTTP requests

I tried installing a plugin as a test to see if that works… I installed the basic helloworld plugin mentioned in the link you send above and this is what i got:
bin/console mautic:marketplace:install dennisameling/helloworld-bundle -vvv
Installing dennisameling/helloworld-bundle, this might take a while…
Error while installing this plugin.
Check the logs for more details or run again with the -vvv parameter.

After checking the logs on the mautic’s system config i got:
[2023-07-01 04:42:44] mautic.WARNING: Command mautic:marketplace:install exited with status code 1 {“hostname”:“ubuntu-s-1vcpu-2gb-blr1-01”,“pid”:22012}
[2023-07-01 04:42:55] mautic.WARNING: Command mautic:marketplace:install exited with status code 1 {“hostname”:“ubuntu-s-1vcpu-2gb-blr1-01”,“pid”:22041}

please help

[2023-07-03 04:38:06] mautic.WARNING: Command mautic:plugins:reload exited with status code 1 {“hostname”:“ubuntu-s-1vcpu-2gb-blr1-01”,“pid”:59180}
[2023-07-03 04:43:21] mautic.WARNING: Command mautic:marketplace:install exited with status code 2 {“hostname”:“ubuntu-s-1vcpu-2gb-blr1-01”,“pid”:59315}

Have you tried the hint that the command gave you? There is nothing I could suggest from the information you provided.