Select Page

PROBLEM 1

I am using Amazon SES. Clicking on “Test Connection” under Configuration->Email Settings gave me an error

"Connection could not be established with host email-smtp.us-west-2.amazonaws.com [Connection refused #111] Log data: ++ Starting Mautic\EmailBundle\Swiftmailer\Transport\AmazonTransport !! Connection could not be established with host email-smtp.us-west-2.amazonaws.com [Connection refused #111] (code: 0)
++ Starting Mautic\EmailBundle\Swiftmailer\Transport\AmazonTransport !! Connection could not be established with host email-smtp.us-west-2.amazonaws.com [Connection refused #111] (code: 0)"

Seems by default Mautic tries to connect to Amazon servers through port 2587 which is not always allowed by the hosting company.

Two options:

  1. Go to the AmazonTransport.php file
    (under app/bundles/EmailBundle/Swiftmailer/Transport)
    and change
    parent::__construct($host, 2587, ‘tls’);
    to
    parent::__construct($host, 587, ‘tls’);
    Off course with a Mautic update chances are this file will be overwritten
  2. Use the SMTP way for Amazon
  3. Aks hosting provider to allow portnumber: 2587
    (whitelist it in the firewall rules)

PROBLEM 2

When clicking through on a specific Segment, nothing was showing up.
Eg. https://<your mautic install>/s/segments/view/3

In the logs I saw:

[2021-04-02 07:25:27] mautic.WARNING: PHP Warning - require(/home/sites/15b/0/044537327/mautic_public/app/cache/prod/doctrine/orm/Proxies/__CG__MauticCategoryBundleEntityCategory.php): failed to open stream: No such file or directory - in file /home/sites/15b/0/044537327/mautic_public/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php - at line 209 {"className":"Mautic\\CategoryBundle\\Entity\\Category","classMetadata":"[object] (Doctrine\\ORM\\Mapping\\ClassMetadata: Doctrine\\ORM\\Mapping\\ClassMetadataInfo@000000004c438f130000000035d4683d)","proxyClassName":"Proxies\\__CG__\\Mautic\\CategoryBundle\\Entity\\Category","fileName":"/home/sites/15b/0/044537327/mautic_public/app/cache/prod/doctrine/orm/Proxies/__CG__MauticCategoryBundleEntityCategory.php"} []
[2021-04-02 07:25:27] mautic.WARNING: PHP Warning - require(/home/sites/15b/0/044537327/mautic_public/app/cache/prod/doctrine/orm/Proxies/__CG__MauticCategoryBundleEntityCategory.php): failed to open stream: No such file or directory - in file /home/sites/15b/0/044537327/mautic_public/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php - at line 209 {"className":"Mautic\\CategoryBundle\\Entity\\Category","classMetadata":"[object] (Doctrine\\ORM\\Mapping\\ClassMetadata: Doctrine\\ORM\\Mapping\\ClassMetadataInfo@000000004c438f130000000035d4683d)","proxyClassName":"Proxies\\__CG__\\Mautic\\CategoryBundle\\Entity\\Category","fileName":"/home/sites/15b/0/044537327/mautic_public/app/cache/prod/doctrine/orm/Proxies/__CG__MauticCategoryBundleEntityCategory.php"} []
[2021-04-02 07:25:27] mautic.ERROR: PHP Notice: require(): Failed opening required '/home/sites/15b/0/044537327/mautic_public/app/cache/prod/doctrine/orm/Proxies/__CG__MauticCategoryBundleEntityCategory.php' (include_path='.:/usr/share/pear') - in file /home/sites/15b/0/044537327/mautic_public/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php - at line 209 [] []
[2021-04-02 07:25:27] mautic.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Notice: require(): Failed opening required '/home/sites/15b/0/044537327/mautic_public/app/cache/prod/doctrine/orm/Proxies/__CG__MauticCategoryBundleEntityCategory.php' (include_path='.:/usr/share/pear') - in file /home/sites/15b/0/044537327/mautic_public/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php - at line 209 [] []
[2021-04-02 07:25:27] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalErrorException: "Compile Error: require(): Failed opening required '/home/sites/15b/0/044537327/mautic_public/app/cache/prod/doctrine/orm/Proxies/__CG__MauticCategoryBundleEntityCategory.php' (include_path='.:/usr/share/pear')" at /home/sites/15b/0/044537327/mautic_public/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php line 209 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalErrorException(code: 0): Compile Error: require(): Failed opening required '/home/sites/15b/0/044537327/mautic_public/app/cache/prod/doctrine/orm/Proxies/__CG__MauticCategoryBundleEntityCategory.php' (include_path='.:/usr/share/pear') at /home/sites/15b/0/044537327/mautic_public/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php:209)"} []

Clearing the cache /rebuilding did not work.
After cache was rebuilt, I indeed did not see the file __CG__MauticCategoryBundleEntityCategory.php


However this special command did the job:

php app/console cache:warmup --env=prod