Your software
My Mautic version is: v5.0.0-rc1
My PHP version is: 8.1.29
My Database type and version is: 10.6.18-MariaDB
Hosted with Amazon EC2 + Ubuntu 22.04
Your problem
My problem is: I don’t know if the warning from the log below is related, but twice now after sending a segment email (once pressing “Send” and another time scheduling to send 10 min in advance), Mautic freezes and seemingly is stuck in an infinite loop, as shown by my Amazon EC2 CPU Utilization spiking to 100% and staying there until I shutdown the instance.
However, the emails seemingly are sending correctly since they’re getting delivered.
I’m using code mode with raw HTML emails, which include a greeting that looks like this…
Hey {contactfield=firstname|there}
The only solution has been to stop/restart my EC2 instance, otherwise the UI is completely down. Embedded images in the emails are also broken when this happens, since they are hosted via the assets on my Mautic instance.
These errors are showing in the log:
mautic.WARNING: PHP Warning - Undefined array key “firstname” - in file /var/www/html/mautic/docroot/app/bundles/LeadBundle/Helper/TokenHelper.php - at line 84
Google search shows 0 results for this warning message.
Steps I have tried to fix the problem:
I don’t know if the warning message is related or if this issue stems purely from PHP settings, but I changed my php.ini settings from /etc/php/8.1/cli
to include the following:
memory_limit = 512M
max_execution_time = 300
max_input_time = 300
max_input_vars = 10000
post_max_size = 50M
upload_max_filesize = 50M
opcache.enable=1
opcache.enable_cli=1
opcache.memory_consumption=256
opcache.max_accelerated_files=20000
opcache.max_wasted_percentage=10
opcache.revalidate_freq=0
opcache.save_comments=1
realpath_cache_size = 4096K
realpath_cache_ttl = 600
However, I didn’t sync these settings within php.ini in the apache2 folder. Should they be the same? The problem seems like it’s happening after the actual act of sending via Amazon SES API, and not via something I’m doing on the browser.
Do you have a page that recommends what PHP settings to use? Can you manage these PHP.ini settings via composer or is this something that needs to be done manually? I really don’t understand the whole process of maintaining composer, even though I used it to install things while getting Mautic setup.
Right now I have the following cron job to queue scheduled broadcasts:
php /var/www/html/mautic/bin/console mautic:broadcasts:send
And I think the actual sending is done through a daemon that I setup below:
/usr/bin/php /var/www/html/mautic/bin/console messenger:consume email hit failed --time-limit=3600
The entire cron/daemon setup is quite confusing and I feel like the documentation on how to get setup could be more clear. Consider me at the point where I asked AI lots of questions, followed lots of tutorials and threw a bunch of stuff at the wall to get the working setup to stick, but I have a really hard time understanding what’s happening behind the scenes or even formulating questions correctly (hence the rambling).
Any help or advice is appreciated. I go back and forth between “Mautic is awesome” and “Mautic is so ungodly complicated that I’ll never get it working without issues”!