Mautic Community Forums

The tasks in campaigns are pending

Your software
Linux ubuntu
My Mautic version is: 2.15.3
My PHP version is: 7.2.24

Your problem
Hello guys.
I’m a newbie and I installed Mautic recently and I can’t figure out how get my campaign working.
1- I create a segment
2- I create a campaign with that segment and I set next step as send email
3- Then I create a contact (for testing) and add to the segment
but it doesn’t send the emails, when I visit the campaign, go to task tap, I see the sending email is pending

I have read every article on cron job available on the internet still no idea what I am doing wrong. here are my cron job. Please help me if you can. thanks.

15 * * * * root php /var/www/html/app/console mautic:webhooks:process
10 * * * * root php /var/www/html/app/console mautic:leadlists:update
10 * * * * root php /var/www/html/app/console mautic:campaigns:update
10 * * * * root php /var/www/html/app/console mautic:campaigns:trigger

          • root php /var/www/html/app/console mautic:email:process
          • php /var/www/html/console mautic:emails:send
          • php /var/www/html/app/console mautic:messages:send

Have you connected an email service?

yes, I use sendgrid API - I can send segmented emails (manually). but nothing works automatically/

Ok, i can also see that your crons all run at the same time, it might cause them to overlap. try to stagger them and see if it helps:

0,15,30,45* * * * <— mautic:segments:update
5,20,35,50* * * * <— mautic:campaigns:update
10,25,40,55* * * * <— mautic:campaigns:trigger

or even chain them:
php /var/www/html/app/console mautic:leadlists:update && php /var/www/html/app/console mautic:campaigns:update && php /var/www/html/app/console mautic:campaigns:trigger

thank you so much!
should be like
0,15,30,45 * * * * php /var/www/html/app/console mautic:leadlists:update && php /var/www/html/app/console mautic:campaigns:update && php /var/www/html/app/console mautic:campaigns:trigger
or:
0,15,30,45 * * * * php /var/www/html/app/console mautic:leadlists:update && php /var/www/html/app/console mautic:campaigns:update && php /var/www/html/app/console mautic:campaigns:trigger
or

          • php /var/www/html/app/console mautic:leadlists:update && php /var/www/html/app/console mautic:campaigns:update && php /var/www/html/app/console mautic:campaigns:trigger

If you chain them, it can be like this:
*/5 * * * * php /var/www/html/app/console mautic:leadlists:update && php /var/www/html/app/console mautic:campaigns:update && php /var/www/html/app/console mautic:campaigns:trigger

nw

still not working, I don’t know why :disappointed: I even created a new campaign

Is there anything in the error log? did you try to run the crons manually?

yes it works manually - just trying to find out a way to get work with cron job


I get an enteral mail like this

finally I found the solution! I had to add –env=prod to each command

1 Like