Inaccurate email stats

My Mautic version is: 5.0.4
My PHP version is: 8.1.28
My Database type and version is: 10.11.2-MariaDB-1

My problem is:

I send a weekly newsletter which I usually write in advance and schedule for sending later. The sending is done through my gmail account.

Lately, I noticed that the stats say the sent count is 400 but I checked my gmail account and clearly see it’s close to the 2000 I expected.

I have recently made the upgrade from v4 to v5 as a fresh install and have set the cronjobs to be conservative in order not to drown the server. Here’s my cronjob config:

SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
BASH_ENV=/tmp/cron.env

0,15,30,45 * * * * php /var/www/html/bin/console mautic:segments:update --batch-limit=100 2>&1 | tee /tmp/stdout
5,20,35,50 * * * * php /var/www/html/bin/console mautic:campaigns:update --batch-limit=100 2>&1 | tee /tmp/stdout
10,25,40,55 * * * * php /var/www/html/bin/console mautic:campaigns:trigger --batch-limit=100 2>&1 | tee /tmp/stdout
2,17,32,47 * * * * php /var/www/html/bin/console mautic:messages:send 2>&1 | tee /tmp/stdout

3,18,33,48 * * * * php /var/www/html/bin/console messenger:consume email --limit=50 --memory-limit=128M --time-limit=180 2>&1 | tee /tmp/stdout
4,19,34,49 * * * * php /var/www/html/bin/console mautic:email:fetch --message-limit=10 2>&1 | tee /tmp/stdout

6,21,36,51 * * * * php /var/www/html/bin/console mautic:broadcasts:send --limit=100 --batch=50 2>&1 | tee /tmp/stdout

9 5 10 * * php /var/www/html/bin/console mautic:unusedip:delete 2>&1 | tee /tmp/stdout
11 5 12 6 * php /var/www/html/bin/console mautic:maintenance:cleanup -g --days-old=365 2>&1 | tee /tmp/stdout

Any idea why this could be and how I can fix it? Thanks!

These errors are showing in the log:

Steps I have tried to fix the problem:

F5 or CTRL+SHFT+R will probably fix your locally cached HTML page.

Thanks for your help. I’m afraid the problem is still there… it’s not restricted to a particular computer. I believe there’s a misconfiguration at the server side

Having an event timeline with timestamps or similar would probably help isolating the problem.

Also,
Who is the owner of that crontab?

I’m not sure I understand what you mean by an “event timeline”… how could I get that?

It’s root. I’m running under docker.

Using root and running it, using any excuse to motivate its use, is a bad idea. Just don’t do it. There are NULL reason to use root for Mautic.

Remove all your crontab related to Mautic, manually purge your cache using the “rm -Rf” as root, log out - and don’t use it again to manage any PHP app.

Once done, set up your crontab for your web user (probably www-data).

For the “Why?”
Using root to run crontab will create root owned files. Those files are write-protected. So when your www-data will try to update those root generated files, it will fail.

1 Like

I just realized I was wrong in my appreciation, www-data is actually the user running the cron-jobs.

Thanks for your help.