Your software
My Mautic version is: 3.3.4
My PHP version is: 7.3.11
My Database type and version is: 10.5.9-MariaDB
Your problem
Many users in a campaign properly trigger the email send event, but never get an email sent (it’s not just that it doesn’t get delivered it’s never even queued up and there is no record in the email_stats table)
We have a campaign that looks like this
Many users seem to have the conditions trigger correctly and get the event for ‘Win Back Trial First Email’ scheduled which looks like this
However only a small fraction of these users actually get the email, the majority of contacts stop there and ‘freeze’ because they don’t go to the next event in the campaign. We can modify the campaign so that events aren’t dependent on the email before, but why is the first email being trigger but not actually scheduled for the majority of users? I realize it’s a marketing email as well, but none of these users have been sent this email before so there is no reason for that to be a reason for it not being sent.
Stuck User
Expected Results
Errors:
There are no errors in the logs related to these or the campaign_lead_event_failed_log table.
Steps to fix problem:
I saw a few posts about Add --batch-limit=10
flag to your mautic:campaigns:trigger
CRON job so I’ve tried that now, but they all seem to be related to older versions of Mautic and not 3.3.4
opened 12:23AM - 03 Jun 18 UTC
closed 11:13PM - 13 Feb 20 UTC
bug
What type of report is this:
| Q | A
| ---| ---
| Bug report? | Y
| Featu… re request? |
| Enhancement? |
## Description:
Hello!
I like Mautic SO MUCH because of its incredible and free open source system opportunities and thank everyone who worked on its development and who works on its improvement now.
Unfortunately, I have got stuck into the problem when trying to **send emails** using **Campaigns**.
I create any campaign, set there some settings with Launch Campaign Builder for **immediate/not immediate** (in some minutes/hours, for example) email sending (it does not have a metter, the problem exists in both variants), choose "**Marketing**" email type to send, choose the needed **Contacts Segment**, publish the campaign and wait.
The contacts are not adding momentally, I need to wait for 5-10 minutes (think that's because of cron jobs set for certain time). After the contacts are added I still wait but nothing happens - no emails are sent to contacts.
**The most strange for me is that in some hours I look through the campaign statistics and see that 0 tasks are pending and all (in this case - 2) tasks ARE COMPLETED!** But there aren't still any emails on my test email contact adresses....
![bug1](https://user-images.githubusercontent.com/39866898/40881781-d04300d6-66d8-11e8-9e01-724005c21831.jpg)
It looks like everyting might have been sent, but there are no emails in my contact email adresses.
**The test emails** from "Emails" menu are sent properly.
I've checked the "**Spam**" folders in my test email accounts for this campaign - nothing too.
I have created **lots of campaigns**, I also **cloned campaigns** - still the same.
I have even changed the PHP version from 7.1 to 7.0 - it also didn't help.
I entered the "**Queue**" in "**How should email be handled?**".
And
**Path to the email queue directory**
%kernel.root_dir%/spool
**Message limit for queue processing**
nothing here
**Time limit for queue processing**
nothing here
**Recovery timeout for resending failed messages**
30
**Clear timeout for deleted failed messages.**
1800
My service to send mail through
**PHP Mail** and I'd like it to work for Mautic.
All of my Mautic cron jobs are:
```
"0,30 | * | * | * | * | /usr/local/bin/php /home/*/*/app/console mautic:email:fetch > /home/*/*/app/console.log 2>&1
0,30 | * | * | * | * | /usr/local/bin/php /home/*/*/app/console mautic:social:monitoring > /home/*/*/app/console.log 2>&1 |
0,30 | * | * | * | * | /usr/local/bin/php /home/*/*/app/console mautic:webhooks:process > /home/*/*/app/console.log 2>&1 |
0 | 0 | 1 | * | * | /usr/local/bin/php /home/*/*/app/console mautic:iplookup:download > /home/*/*/app/console.log 2>&1 |
0,15,30,45 | * | * | * | * | /usr/local/bin/php /home/*/*/app/console mautic:segments:update > /home/*/*/app/console.log 2>&1 |
5,20,35,50 | * | * | * | * | /usr/local/bin/php /home/*/*/app/console mautic:campaigns:rebuild > /home/*/*/app/console.log 2>&1 |
10,25,40,55 | * | * | * | * | /usr/local/bin/php /home/*/*/app/console mautic:campaigns:trigger > /home/*/*/app/console.log 2>&1 |
0,30 | * | * | * | * | /usr/local/bin/php /home/*/*/app/console mautic:emails:send > /home/*/*/app/console.log 2>&1 |
0,30 | * | * | * | * | /usr/local/bin/php /home/*/*/app/console mautic:messages:send > /home/*/*/app/console.log 2>&1"
```
## If a bug:
| Q | A
| --- | ---
| Mautic version | 2.13.1
| PHP version | 7.0,7.1 (used both, the same problem)
### Steps to reproduce:
1. Create new Campaign
2. Set up any Marketing Email for any time (immediate or in some minutes/hours/etc. - it does not metter)
3. Publish Campaign.
### Log errors:
[2018-06-02 21:05:27] mautic.WARNING: IP LOOKUP: The file "/home/*/*/app/cache/prod/../ip_data/GeoLite2-City.mmdb" does not exist or is not readable. [] []
[2018-06-03 01:22:54] mautic.NOTICE: PHP Notice - Undefined index: company - in file /home/*/*/app/bundles/LeadBundle/Views/Lead/grid_card.html.php - at line 44 [] []
I also created file console.log where gather the cron reports. The information renews there everytime, now I see there this kind of information:
"Triggering events for campaign 5
Triggering first level events
0 total events(s) to be processed in batches of 100
0 event(s) executed
Triggering scheduled events
0 total events(s) to be processed in batches of 100
0 event(s) executed
Triggering 'non-action' events
0 event(s) executed
Triggering events for campaign 6
Triggering first level events
0 total events(s) to be processed in batches of 100
0 event(s) executed
Triggering scheduled events
0 total events(s) to be processed in batches of 100
0 event(s) executed
Triggering 'non-action' events
0 event(s) executed
Triggering events for campaign 7
Triggering first level events
0 total events(s) to be processed in batches of 100
0 event(s) executed
Triggering scheduled events
0 total events(s) to be processed in batches of 100
0 event(s) executed
Triggering 'non-action' events
0 event(s) executed
Triggering events for campaign 8
Triggering first level events
0 total events(s) to be processed in batches of 100
0 event(s) executed
Triggering scheduled events
0 total events(s) to be processed in batches of 100
0 event(s) executed
Triggering 'non-action' events
0 event(s) executed"
**I've suffered all the day long, trying to find the decision, but still have the problem.
Can you help me to fix it? Thank you so much.**
Adding --batch-limit=10 flag to mautic:campaigns:trigger job seems to have fixed the issue (at least for the last 3 days). Is this not something we can trigger an error for if it is failing / running out of resources so it doesn’t process every job in the batch? This has been causing issue for awhile without us knowing because no errors are thrown.