Amazon SES: test email sends, campaigns say they are sent, but nothing actually sends

Your software
My Mautic version is: 3.3.3
My PHP version is: 7.3.33
My Database type and version is: MariaDb

Your problem
My problem is:

As of about a week ago, emails stopped sending. Test email send and stats say the campaign is sent, but nothing get opened.

I checked with Amazon support, and the emails are not arriving at Amazon.

Totally weird. Test send in settings tab works fine also.

What could it be?

These errors are showing in the log:

Steps I have tried to fix the problem:

Hi, how is your email sending? immediatly or batch? (This can be checked in Email Settings)
If batch, can you plz check if you have anything in the var/spool folder in Mautic?
Also: do you have any errors in your log?

Joey

Hi,

Yes - it’s all in the spool folder!!! Why would that be?

Emails send via queue.

No change has been made to crons.

Errors as follows:

[2022-08-08 02:11:54] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\DeadlockException: “An exception occurred while executing ‘UPDATE mau_leads SET date_modified = ?, last_active = ? WHERE id = ?’ with params [“2022-08-08 02:11:54”, “2022-08-08 02:11:53”, “11152”]: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction” at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 34 {“exception”:“[object] (Doctrine\DBAL\Exception\DeadlockException(code: 0): An exception occurred while executing ‘UPDATE mau_leads SET date_modified = ?, last_active = ? WHERE id = ?’ with params ["2022-08-08 02:11:54", "2022-08-08 02:11:53", "11152"]:\n\nSQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:34, Doctrine\DBAL\Driver\PDOException(code: 40001): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:123, PDOException(code: 40001): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:121)”}

[2022-08-08 02:28:37] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\DeadlockException: “An exception occurred while executing ‘UPDATE mau_leads SET date_modified = ?, last_active = ? WHERE id = ?’ with params [“2022-08-08 02:28:37”, “2022-08-08 02:28:36”, “7211”]: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction” at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 34 {“exception”:“[object] (Doctrine\DBAL\Exception\DeadlockException(code: 0): An exception occurred while executing ‘UPDATE mau_leads SET date_modified = ?, last_active = ? WHERE id = ?’ with params ["2022-08-08 02:28:37", "2022-08-08 02:28:36", "7211"]:\n\nSQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:34, Doctrine\DBAL\Driver\PDOException(code: 40001): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:123, PDOException(code: 40001): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:121)”}

[2022-08-08 03:07:02] mautic.WARNING: MaxMind license key is required.

[2022-08-08 03:07:02] mautic.ERROR: Failed to fetch remote IP data: A string or UriInterface object must be provided, a “NULL” was provided.

[2022-08-08 03:07:02] mautic.WARNING: MaxMind license key is required.

[2022-08-08 03:35:46] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\DeadlockException: “An exception occurred while executing ‘UPDATE mau_leads SET date_modified = ?, last_active = ? WHERE id = ?’ with params [“2022-08-08 03:35:46”, “2022-08-08 03:35:45”, “20337”]: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction” at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 34 {“exception”:“[object] (Doctrine\DBAL\Exception\DeadlockException(code: 0): An exception occurred while executing ‘UPDATE mau_leads SET date_modified = ?, last_active = ? WHERE id = ?’ with params ["2022-08-08 03:35:46", "2022-08-08 03:35:45", "20337"]:\n\nSQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:34, Doctrine\DBAL\Driver\PDOException(code: 40001): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:123, PDOException(code: 40001): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:121)”}

[2022-08-08 04:07:02] mautic.WARNING: MaxMind license key is required.

[2022-08-08 04:07:02] mautic.ERROR: Failed to fetch remote IP data: A string or UriInterface object must be provided, a “NULL” was provided.

[2022-08-08 04:07:02] mautic.WARNING: MaxMind license key is required.

[2022-08-08 05:07:02] mautic.WARNING: MaxMind license key is required.

[2022-08-08 05:07:02] mautic.ERROR: Failed to fetch remote IP data: A string or UriInterface object must be provided, a “NULL” was provided.

[2022-08-08 05:07:02] mautic.WARNING: MaxMind license key is required.

[2022-08-08 06:07:01] mautic.WARNING: MaxMind license key is required.

[2022-08-08 06:07:01] mautic.ERROR: Failed to fetch remote IP data: A string or UriInterface object must be provided, a “NULL” was provided.

[2022-08-08 06:07:01] mautic.WARNING: MaxMind license key is required.

[2022-08-08 06:44:49] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\DeadlockException: “An exception occurred while executing ‘UPDATE mau_leads SET date_modified = ?, last_active = ? WHERE id = ?’ with params [“2022-08-08 06:44:49”, “2022-08-08 06:44:49”, “11283”]: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction” at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 34 {“exception”:“[object] (Doctrine\DBAL\Exception\DeadlockException(code: 0): An exception occurred while executing ‘UPDATE mau_leads SET date_modified = ?, last_active = ? WHERE id = ?’ with params ["2022-08-08 06:44:49", "2022-08-08 06:44:49", "11283"]:\n\nSQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:34, Doctrine\DBAL\Driver\PDOException(code: 40001): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:123, PDOException(code: 40001): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:121)”}

[2022-08-08 06:58:33] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\DeadlockException: “An exception occurred while executing ‘UPDATE mau_leads SET date_modified = ?, last_active = ? WHERE id = ?’ with params [“2022-08-08 06:58:33”, “2022-08-08 06:58:33”, “11283”]: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction” at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 34 {“exception”:“[object] (Doctrine\DBAL\Exception\DeadlockException(code: 0): An exception occurred while executing ‘UPDATE mau_leads SET date_modified = ?, last_active = ? WHERE id = ?’ with params ["2022-08-08 06:58:33", "2022-08-08 06:58:33", "11283"]:\n\nSQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:34, Doctrine\DBAL\Driver\PDOException(code: 40001): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:123, PDOException(code: 40001): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:121)”}

[2022-08-08 07:05:00] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\DeadlockException: “An exception occurred while executing ‘UPDATE mau_leads SET last_active = ? WHERE id = ?’ with params [“2022-08-08 07:05:00”, “16366”]: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction” at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 34 {“exception”:“[object] (Doctrine\DBAL\Exception\DeadlockException(code: 0): An exception occurred while executing ‘UPDATE mau_leads SET last_active = ? WHERE id = ?’ with params ["2022-08-08 07:05:00", "16366"]:\n\nSQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:34, Doctrine\DBAL\Driver\PDOException(code: 40001): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:123, PDOException(code: 40001): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:121)”}

[2022-08-08 07:07:02] mautic.WARNING: MaxMind license key is required.

[2022-08-08 07:07:02] mautic.ERROR: Failed to fetch remote IP data: A string or UriInterface object must be provided, a “NULL” was provided.

[2022-08-08 07:07:02] mautic.WARNING: MaxMind license key is required.

[2022-08-08 07:20:22] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\DeadlockException: “An exception occurred while executing ‘UPDATE mau_leads SET date_modified = ?, last_active = ? WHERE id = ?’ with params [“2022-08-08 07:20:22”, “2022-08-08 07:20:22”, “7908”]: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction” at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 34 {“exception”:“[object] (Doctrine\DBAL\Exception\DeadlockException(code: 0): An exception occurred while executing ‘UPDATE mau_leads SET date_modified = ?, last_active = ? WHERE id = ?’ with params ["2022-08-08 07:20:22", "2022-08-08 07:20:22", "7908"]:\n\nSQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:34, Doctrine\DBAL\Driver\PDOException(code: 40001): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:123, PDOException(code: 40001): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:121)”}

[2022-08-08 07:28:14] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\DeadlockException: “An exception occurred while executing ‘UPDATE mau_leads SET date_modified = ?, last_active = ? WHERE id = ?’ with params [“2022-08-08 07:28:14”, “2022-08-08 07:28:14”, “3617”]: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction” at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 34 {“exception”:“[object] (Doctrine\DBAL\Exception\DeadlockException(code: 0): An exception occurred while executing ‘UPDATE mau_leads SET date_modified = ?, last_active = ? WHERE id = ?’ with params ["2022-08-08 07:28:14", "2022-08-08 07:28:14", "3617"]:\n\nSQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:34, Doctrine\DBAL\Driver\PDOException(code: 40001): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:123, PDOException(code: 40001): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:121)”}

[2022-08-08 08:07:02] mautic.WARNING: MaxMind license key is required.

[2022-08-08 08:07:02] mautic.ERROR: Failed to fetch remote IP data: A string or UriInterface object must be provided, a “NULL” was provided.

[2022-08-08 08:07:02] mautic.WARNING: MaxMind license key is required.

[2022-08-08 09:07:01] mautic.WARNING: MaxMind license key is required.

[2022-08-08 09:07:01] mautic.ERROR: Failed to fetch remote IP data: A string or UriInterface object must be provided, a “NULL” was provided.

[2022-08-08 09:07:01] mautic.WARNING: MaxMind license key is required.

[2022-08-08 10:07:02] mautic.WARNING: MaxMind license key is required.

[2022-08-08 10:07:02] mautic.ERROR: Failed to fetch remote IP data: A string or UriInterface object must be provided, a “NULL” was provided.

[2022-08-08 10:07:02] mautic.WARNING: MaxMind license key is required.

[2022-08-08 10:27:35] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\DeadlockException: “An exception occurred while executing ‘UPDATE mau_leads SET date_modified = ?, last_active = ? WHERE id = ?’ with params [“2022-08-08 10:27:35”, “2022-08-08 10:27:35”, “1045”]: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction” at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 34 {“exception”:“[object] (Doctrine\DBAL\Exception\DeadlockException(code: 0): An exception occurred while executing ‘UPDATE mau_leads SET date_modified = ?, last_active = ? WHERE id = ?’ with params ["2022-08-08 10:27:35", "2022-08-08 10:27:35", "1045"]:\n\nSQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:34, Doctrine\DBAL\Driver\PDOException(code: 40001): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:123, PDOException(code: 40001): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:121)”}

[2022-08-08 11:07:01] mautic.WARNING: MaxMind license key is required.

[2022-08-08 11:07:01] mautic.ERROR: Failed to fetch remote IP data: A string or UriInterface object must be provided, a “NULL” was provided.

[2022-08-08 11:07:01] mautic.WARNING: MaxMind license key is required.

[2022-08-08 12:00:09] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\DeadlockException: “An exception occurred while executing ‘UPDATE mau_leads SET date_modified = ?, last_active = ? WHERE id = ?’ with params [“2022-08-08 12:00:09”, “2022-08-08 12:00:09”, “5979”]: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction” at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 34 {“exception”:“[object] (Doctrine\DBAL\Exception\DeadlockException(code: 0): An exception occurred while executing ‘UPDATE mau_leads SET date_modified = ?, last_active = ? WHERE id = ?’ with params ["2022-08-08 12:00:09", "2022-08-08 12:00:09", "5979"]:\n\nSQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:34, Doctrine\DBAL\Driver\PDOException(code: 40001): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:123, PDOException(code: 40001): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:121)”}

[2022-08-08 12:07:02] mautic.WARNING: MaxMind license key is required.

[2022-08-08 12:07:02] mautic.ERROR: Failed to fetch remote IP data: A string or UriInterface object must be provided, a “NULL” was provided.

[2022-08-08 12:07:02] mautic.WARNING: MaxMind license key is required.

What is your email sending cron look like?

          • php /home/path/to/mlr/bin/console mautic:broadcasts:send 2>&1 >> /home/path/to/mlr/mautic_logs/mautic.broadcasts.send.txt

8,28,48 * * * * php /home/path/to/mlr/bin/console mautic:segments:update 2>&1 >> /home/path/to/mlr/mautic_logs/mautic.segments.update.txt

9,29,49 * * * * php /home/path/to/mlr/bin/console mautic:campaigns:rebuild 2>&1 >> /home/path/to/mlr/mautic_logs/mautic.campaings.rebuild.txt

10,30,0 * * * * php /home/path/to/mlr/bin/console mautic:campaigns:trigger 2>&1 >> /home/path/to/mlr/mautic_logs/mautic.campaigns.trigger.txt

          • php /home/path/to/mlr/bin/console mautic:emails:send 2>&1 >> /home/path/to/mlr/mautic_logs/mautic.emails.send.txt

7 * * * * php /home/path/to/mlr/bin/console mautic:iplookup:download 2>&1 >> /home/path/to/mlr/mautic_logs/mautic.iplookup.download.txt

9,24,39,54 * * * * php /home/path/to/mlr/bin/console mautic:social:monitoring 2>&1 >> /home/path/to/mlr/mautic_logs/mautic.social.monitoring.txt

again, it’s all been working just fine until now.

I cleared out the spool folder, did a new test campaign and again it shows as sent, but the test emails are still in the spool folder.

Hmmm, O saw another post where they said to try swiftmailer:spool:send and it seems to have worked. But why would this all of a sudden be the case?

When I test again, I see this eror_log:

[08-Aug-2022 12:48:25 UTC] PHP Warning:  Module 'mysql' already loaded in Unknown on line 0
[08-Aug-2022 12:48:25 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /opt/cpanel/ea-php73/root/usr/lib64/php/modules/imagick.so (libMagickWand-6.Q16.so.6: cannot open shared object file: No such file or directory), /opt/cpanel/ea-php73/root/usr/lib64/php/modules/imagick.so.so (/opt/cpanel/ea-php73/root/usr/lib64/php/modules/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

ok, I fixed it. I believe the emails:send process was stuck and wouldn’t allow any more instances of that. Once I cleared it away it seems to be working again now. Thanks for pointing me in the right direction

Hi, great to hear. Better put a cap on the send, and run it more frequently. Here is a Mautic Lagos Meetup we addressed this issue:

1 Like