Error: PHP Notice: Undefined index: in Mautic_Install/app/bundles/CampaignBundle/Executioner/Logger/EventLogger.php on line 138

Your software
My Mautic version is:2.16
My PHP version is:7.2.27

Your problem
My problem is: Triggering events for campaign 16
Triggering events for newly added contacts
17828 total events(s) to be processed in batches of 50 contacts
200/17828 [>---------------------------] 1%PHP Notice: Undefined index: in /var/www/vhosts/Mautic_Install/app/bundles/CampaignBundle/Executioner/Logger/EventLogger.php on line 138

These errors are showing in the log: [2020-02-19 23:30:03] mautic.ERROR: CAMPAIGN: An exception occurred while executing ‘REPLACE INTO mauhu_campaign_lead_event_failed_log( log_id, date_added, reason) SELECT id, :dateAdded as date_added, :message as reason from mauhu_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 mauhu_campaign_lead_event_log ’ at line 2
[2020-02-19 23:45:02] mautic.NOTICE: Symfony\Component\Debug\Exception\FatalThrowableError: Call to undefined function Mautic\EmailBundle\MonitoredEmail\imap_search() (uncaught exception) at /var/www/vhosts/Mautic_Install/app/bundles/EmailBundle/MonitoredEmail/Mailbox.php line 570 while running console command mautic:email:fetch

AH01071: Got error ‘PHP message: RuntimeException: The Doctrine Proxy directory “/var/www/vhosts/Mautic_Install/app/cache/prod/doctrine/orm/Proxies” is not writeable for the current system user. - in file /var/www/vhosts/Mautic_Install/vendor/symfony/doctrine-bridge/CacheWarmer/ProxyCacheWarmer.php - at line 56’,

Steps I have tried to fix the problem: Cleared Cache - Increased PHP memory limit-

Could i be that you ran the clear cache as root (instead of sudo -u)? In that case you’d need to chown -R the cache directory to the webserver user (e.g. www-data)

I am getting similar errors when running a campaign using cron on command line:

PHP Notice: Undefined index: in /var/www/mautic/app/bundles/CampaignBundle/Executioner/Logger/EventLogger.php on line 127

Basically once this happens it does not let my other campaigns update or trigger.

Nothing in mautic.error log

@mikew, can I ask how you solved this? Running into same issue with campaigns not triggering after this error.

wow this was a year ago… I really do not know.

Some fail safe things to do:

  1. chown -R www-data:www-data /var/www/mautic
  2. rm -rf /var/www/mautic/var/cache/*
  3. update data schema (can’t remember the url command line)
1 Like

Figured that might be the case but worth a shot. Thanks for the reply and tips!

doctrine:schema:update --force Is the command to update schema

1 Like

The specified command cries out about inability to change columns at some OAuth related stuff:

An exception occurred while executing 'ALTER TABLE oauth2_accesstokens CHANGE client_id client_id INT UNSIGNED  
   NOT NULL, CHANGE user_id user_id INT UNSIGNED NOT NULL, CHANGE token token VARCHAR(191) NOT NULL, CHANGE expi  
  res_at expires_at BIGINT DEFAULT NULL, CHANGE scope scope VARCHAR(191) DEFAULT NULL':                           
                                                                                                                  
  SQLSTATE[HY000]: General error: 1832 Cannot change column 'client_id': used in a foreign key constraint 'FK_3A  
  18CA5A19EB6921'