# Inaccurate email stats

**URL:** <https://forum.mautic.org/t/inaccurate-email-stats/32017>\
**Category:** Product Support\
**Created:** [May 9, 2024, 6:42am UTC](https://forum.mautic.org/t/inaccurate-email-stats/32017 "2024-05-09T06:42:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mchojrin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mchojrin/32/10159_2.png) [@mchojrin](https://forum.mautic.org/u/mchojrin)\
**Post date:** [May 9, 2024, 6:42am UTC](https://forum.mautic.org/t/inaccurate-email-stats/32017/1 "2024-05-09T06:42:42Z")

</div>

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:

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

---

<div class="post-metadata">

**Author:** ![marcus42](https://avatars.discourse-cdn.com/v4/letter/m/ac91a4/32.png) [@marcus42](https://forum.mautic.org/u/marcus42)\
**Post date:** [May 9, 2024, 1:24pm UTC](https://forum.mautic.org/t/inaccurate-email-stats/32017/2 "2024-05-09T13:24:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mchojrin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mchojrin/32/10159_2.png) [@mchojrin](https://forum.mautic.org/u/mchojrin)\
**Post date:** [May 9, 2024, 3:30pm UTC](https://forum.mautic.org/t/inaccurate-email-stats/32017/3 "2024-05-09T15:30:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![marcus42](https://avatars.discourse-cdn.com/v4/letter/m/ac91a4/32.png) [@marcus42](https://forum.mautic.org/u/marcus42)\
**Post date:** [May 9, 2024, 4:06pm UTC](https://forum.mautic.org/t/inaccurate-email-stats/32017/4 "2024-05-09T16:06:42Z")

</div>

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

Also,  
Who is the owner of that crontab?

---

<div class="post-metadata">

**Author:** ![mchojrin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mchojrin/32/10159_2.png) [@mchojrin](https://forum.mautic.org/u/mchojrin)\
**Post date:** [May 9, 2024, 6:06pm UTC](https://forum.mautic.org/t/inaccurate-email-stats/32017/5 "2024-05-09T18:06:46Z")

</div>

> [@marcus42](#):
>
> Having an event timeline with timestamps or similar would probably help isolating the problem.

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

> [@marcus42](#):
>
> Who is the owner of that crontab?

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

---

<div class="post-metadata">

**Author:** ![marcus42](https://avatars.discourse-cdn.com/v4/letter/m/ac91a4/32.png) [@marcus42](https://forum.mautic.org/u/marcus42)\
**Post date:** [May 9, 2024, 6:33pm UTC](https://forum.mautic.org/t/inaccurate-email-stats/32017/6 "2024-05-09T18:33:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mchojrin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mchojrin/32/10159_2.png) [@mchojrin](https://forum.mautic.org/u/mchojrin)\
**Post date:** [May 15, 2024, 9:37am UTC](https://forum.mautic.org/t/inaccurate-email-stats/32017/7 "2024-05-15T09:37:39Z")

</div>

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

Thanks for your help.
