# Error: PHP Notice: Undefined index: in Mautic\_Install/app/bundles/CampaignBundle/Executioner/Logger/EventLogger.php on line 138

**URL:** <https://forum.mautic.org/t/error-php-notice-undefined-index-in-mautic-install-app-bundles-campaignbundle-executioner-logger-eventlogger-php-on-line-138/12937>\
**Category:** Product Support\
**Created:** [February 20, 2020, 2:38am UTC](https://forum.mautic.org/t/error-php-notice-undefined-index-in-mautic-install-app-bundles-campaignbundle-executioner-logger-eventlogger-php-on-line-138/12937 "2020-02-20T02:38:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)\
**Post date:** [February 20, 2020, 2:38am UTC](https://forum.mautic.org/t/error-php-notice-undefined-index-in-mautic-install-app-bundles-campaignbundle-executioner-logger-eventlogger-php-on-line-138/12937/1 "2020-02-20T02:38:24Z")

</div>

**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-

---

<div class="post-metadata">

**Author:** ![ekke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ekke/32/296_2.png) [@ekke](https://forum.mautic.org/u/ekke)\
**Post date:** [February 20, 2020, 7:59am UTC](https://forum.mautic.org/t/error-php-notice-undefined-index-in-mautic-install-app-bundles-campaignbundle-executioner-logger-eventlogger-php-on-line-138/12937/2 "2020-02-20T07:59:29Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [October 28, 2020, 6:20pm UTC](https://forum.mautic.org/t/error-php-notice-undefined-index-in-mautic-install-app-bundles-campaignbundle-executioner-logger-eventlogger-php-on-line-138/12937/3 "2020-10-28T18:20:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![symbinc](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/symbinc/32/5356_2.png) [@symbinc](https://forum.mautic.org/u/symbinc)\
**Post date:** [November 1, 2021, 12:08pm UTC](https://forum.mautic.org/t/error-php-notice-undefined-index-in-mautic-install-app-bundles-campaignbundle-executioner-logger-eventlogger-php-on-line-138/12937/4 "2021-11-01T12:08:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [November 2, 2021, 7:30pm UTC](https://forum.mautic.org/t/error-php-notice-undefined-index-in-mautic-install-app-bundles-campaignbundle-executioner-logger-eventlogger-php-on-line-138/12937/5 "2021-11-02T19:30:14Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![symbinc](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/symbinc/32/5356_2.png) [@symbinc](https://forum.mautic.org/u/symbinc)\
**Post date:** [November 3, 2021, 6:32am UTC](https://forum.mautic.org/t/error-php-notice-undefined-index-in-mautic-install-app-bundles-campaignbundle-executioner-logger-eventlogger-php-on-line-138/12937/6 "2021-11-03T06:32:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)\
**Post date:** [November 25, 2021, 1:35pm UTC](https://forum.mautic.org/t/error-php-notice-undefined-index-in-mautic-install-app-bundles-campaignbundle-executioner-logger-eventlogger-php-on-line-138/12937/7 "2021-11-25T13:35:23Z")

</div>

> [@mikew](#):
>
> update data schema (can’t remember the url command line)

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

---

<div class="post-metadata">

**Author:** ![kote.isaev](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/kote.isaev/32/646_2.png) [@kote.isaev](https://forum.mautic.org/u/kote.isaev)\
**Post date:** [December 23, 2021, 10:08am UTC](https://forum.mautic.org/t/error-php-notice-undefined-index-in-mautic-install-app-bundles-campaignbundle-executioner-logger-eventlogger-php-on-line-138/12937/8 "2021-12-23T10:08:15Z")

</div>

> [@EJL](#):
>
> doctrine:schema:update --force

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

```auto
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'                                

```
