Memory exhausted error despite memory setting of -1

Your software

My PHP version is : 7.4.24

My MariaDB version is : 10.3

These errors are showing in the Mautic log :slight_smile:

[2021-11-01 09:48:03] mautic.NOTICE: Doctrine\DBAL\Exception\SyntaxErrorException: An exception occurred while executing ‘REPLACE INTO mau_campaign_lead_event_failed_log( log_id, date_added, reason) SELECT id, :dateAdded as date_added, :message as reason from mau_campaign_lead_event_log WHERE is_scheduled = 1 AND lead_id = :contactId AND campaign_id = :campaignId AND rotation = :rotation’: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘:dateAdded as date_added, :message as reason from mau_campaign_lead_event_log…’ at line 2 (uncaught exception) at /path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 98 while running console command mautic:segments:update

[2021-11-01 09:48:03] mautic.WARNING: Command mautic:segments:update exited with status code 1

[2021-11-01 09:49:02] mautic.ERROR: CAMPAIGN: An exception occurred while executing ‘REPLACE INTO mau_campaign_lead_event_failed_log( log_id, date_added, reason) SELECT id, :dateAdded as date_added, :message as reason from mau_campaign_lead_event_log WHERE is_scheduled = 1 AND lead_id = :contactId AND campaign_id = :campaignId AND rotation = :rotation’: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘:dateAdded as date_added, :message as reason from mau_campaign_lead_event_log…’ at line 2

[2021-11-01 00:29:05] console.CRITICAL: Error thrown while running command “mautic:segments:update”. Message: “An exception occurred while executing ‘INSERT INTO mau_campaign_leads (date_added, manually_removed, manually_added, date_last_exited, rotation, campaign_id, lead_id) VALUES (?, ?, ?, ?, ?, ?, ?)’ with params [“2021-10-31 13:29:05”, 0, 0, null, 1, 3, “15388”]: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘3-15388’ for key ‘PRIMARY’” {“exception”:"[object] (Doctrine\DBAL\Exception\UniqueConstraintViolationException(code: 0): An exception occurred while executing ‘INSERT INTO mau_campaign_leads (date_added, manually_removed, manually_added, date_last_exited, rotation, campaign_id, lead_id) VALUES (?, ?, ?, ?, ?, ?, ?)’ with params [“2021-10-31 13:29:05”, 0, 0, null, 1, 3, “15388”]:\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘3-15388’ for key ‘PRIMARY’ at /path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:74, Doctrine\DBAL\Driver\PDO\Exception(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘3-15388’ for key ‘PRIMARY’ at /path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘3-15388’ for key ‘PRIMARY’ at /path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:112)",“command”:“mautic:segments:update”,“message”:“An exception occurred while executing ‘INSERT INTO mau_campaign_leads (date_added, manually_removed, manually_added, date_last_exited, rotation, campaign_id, lead_id) VALUES (?, ?, ?, ?, ?, ?, ?)’ with params [“2021-10-31 13:29:05”, 0, 0, null, 1, 3, “15388”]:\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘3-15388’ for key ‘PRIMARY’”}

[2021-11-01 09:48:03] console.CRITICAL: Error thrown while running command “mautic:segments:update”. Message: “An exception occurred while executing ‘REPLACE INTO mau_campaign_lead_event_failed_log( log_id, date_added, reason) SELECT id, :dateAdded as date_added, :message as reason from mau_campaign_lead_event_log WHERE is_scheduled = 1 AND lead_id = :contactId AND campaign_id = :campaignId AND rotation = :rotation’: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘:dateAdded as date_added, :message as reason from mau_campaign_lead_event_log…’ at line 2” {“exception”:"[object] (Doctrine\DBAL\Exception\SyntaxErrorException(code: 0): An exception occurred while executing ‘REPLACE INTO mau_campaign_lead_event_failed_log( log_id, date_added, reason)\nSELECT id, :dateAdded as date_added, :message as reason from mau_campaign_lead_event_log\nWHERE is_scheduled = 1 AND lead_id = :contactId AND campaign_id = :campaignId AND rotation = :rotation’:\n\nYou have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘:dateAdded as date_added, :message as reason from mau_campaign_lead_event_log…’ at line 2 at /path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:98, Doctrine\DBAL\Driver\Mysqli\Exception\ConnectionError(code: 0): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘:dateAdded as date_added, :message as reason from mau_campaign_lead_event_log…’ at line 2 at /path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/Exception/ConnectionError.php:19)",“command”:“mautic:segments:update”,“message”:“An exception occurred while executing ‘REPLACE INTO mau_campaign_lead_event_failed_log( log_id, date_added, reason)\nSELECT id, :dateAdded as date_added, :message as reason from mau_campaign_lead_event_log\nWHERE is_scheduled = 1 AND lead_id = :contactId AND campaign_id = :campaignId AND rotation = :rotation’:\n\nYou have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘:dateAdded as date_added, :message as reason from mau_campaign_lead_event_log…’ at line 2”}

[2021-11-01 09:48:03] mautic.NOTICE: Doctrine\DBAL\Exception\SyntaxErrorException: An exception occurred while executing ‘REPLACE INTO mau_campaign_lead_event_failed_log( log_id, date_added, reason) SELECT id, :dateAdded as date_added, :message as reason from mau_campaign_lead_event_log WHERE is_scheduled = 1 AND lead_id = :contactId AND campaign_id = :campaignId AND rotation = :rotation’: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘:dateAdded as date_added, :message as reason from mau_campaign_lead_event_log…’ at line 2 (uncaught exception) at /path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 98 while running console command mautic:segments:update

[2021-11-01 09:48:03] mautic.WARNING: Command mautic:segments:update exited with status code 1

[2021-11-01 09:49:02] mautic.ERROR: CAMPAIGN: An exception occurred while executing ‘REPLACE INTO mau_campaign_lead_event_failed_log( log_id, date_added, reason) SELECT id, :dateAdded as date_added, :message as reason from mau_campaign_lead_event_log WHERE is_scheduled = 1 AND lead_id = :contactId AND campaign_id = :campaignId AND rotation = :rotation’: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘:dateAdded as date_added, :message as reason from mau_campaign_lead_event_log…’ at line 2

[2021-11-01 00:29:05] console.CRITICAL: Error thrown while running command “mautic:segments:update”. Message: “An exception occurred while executing ‘INSERT INTO mau_campaign_leads (date_added, manually_removed, manually_added, date_last_exited, rotation, campaign_id, lead_id) VALUES (?, ?, ?, ?, ?, ?, ?)’ with params [“2021-10-31 13:29:05”, 0, 0, null, 1, 3, “15388”]: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘3-15388’ for key ‘PRIMARY’” {“exception”:"[object] (Doctrine\DBAL\Exception\UniqueConstraintViolationException(code: 0): An exception occurred while executing ‘INSERT INTO mau_campaign_leads (date_added, manually_removed, manually_added, date_last_exited, rotation, campaign_id, lead_id) VALUES (?, ?, ?, ?, ?, ?, ?)’ with params [“2021-10-31 13:29:05”, 0, 0, null, 1, 3, “15388”]:\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘3-15388’ for key ‘PRIMARY’ at /path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:74, Doctrine\DBAL\Driver\PDO\Exception(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘3-15388’ for key ‘PRIMARY’ at /path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘3-15388’ for key ‘PRIMARY’ at /path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:112)",“command”:“mautic:segments:update”,“message”:“An exception occurred while executing ‘INSERT INTO mau_campaign_leads (date_added, manually_removed, manually_added, date_last_exited, rotation, campaign_id, lead_id) VALUES (?, ?, ?, ?, ?, ?, ?)’ with params [“2021-10-31 13:29:05”, 0, 0, null, 1, 3, “15388”]:\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘3-15388’ for key ‘PRIMARY’”}

[2021-11-01 09:48:03] console.CRITICAL: Error thrown while running command “mautic:segments:update”. Message: “An exception occurred while executing ‘REPLACE INTO mau_campaign_lead_event_failed_log( log_id, date_added, reason) SELECT id, :dateAdded as date_added, :message as reason from mau_campaign_lead_event_log WHERE is_scheduled = 1 AND lead_id = :contactId AND campaign_id = :campaignId AND rotation = :rotation’: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘:dateAdded as date_added, :message as reason from mau_campaign_lead_event_log…’ at line 2” {“exception”:"[object] (Doctrine\DBAL\Exception\SyntaxErrorException(code: 0): An exception occurred while executing ‘REPLACE INTO mau_campaign_lead_event_failed_log( log_id, date_added, reason)\nSELECT id, :dateAdded as date_added, :message as reason from mau_campaign_lead_event_log\nWHERE is_scheduled = 1 AND lead_id = :contactId AND campaign_id = :campaignId AND rotation = :rotation’:\n\nYou have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘:dateAdded as date_added, :message as reason from mau_campaign_lead_event_log…’ at line 2 at /path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:98, Doctrine\DBAL\Driver\Mysqli\Exception\ConnectionError(code: 0): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘:dateAdded as date_added, :message as reason from mau_campaign_lead_event_log…’ at line 2 at /path/to/mlr/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/Exception/ConnectionError.php:19)",“command”:“mautic:segments:update”,“message”:“An exception occurred while executing ‘REPLACE INTO mau_campaign_lead_event_failed_log( log_id, date_added, reason)\nSELECT id, :dateAdded as date_added, :message as reason from mau_campaign_lead_event_log\nWHERE is_scheduled = 1 AND lead_id = :contactId AND campaign_id = :campaignId AND rotation = :rotation’:\n\nYou have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘:dateAdded as date_added, :message as reason from mau_campaign_lead_event_log…’ at line 2”}

Your problem

My problem is :

Apart from the errors above, when the send campaign cron runs, I get a memory exhausted error.

local Php ini already has the following:

display_errors = Off

max_execution_time = 14400

max_input_time = 14400

max_input_vars = 3000

memory_limit = -1

post_max_size = 64M

session.gc_maxlifetime = 86400

session.save_path = “/var/cpanel/php/sessions/ea-php74”

upload_max_filesize = 64M

zlib.output_compression = On

session.gc_probability = 1

session.gc_divisor = 1000

allow_url_fopen = Off

enable_dl = Off

file_uploads = On

Steps I have tried to fix the problem :

I tried adding a php directive to force -1 memory allocation in the Classloader file (due to error below), but it seems to then just time out or something.

In ClassLoader.php line 572:

Error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 65536 bytes)

Hello!
How often are you running your cronjobs? Is there a chance that a cronjob can’t finish and the same one is started again?
Joey