# Delayed actions are not being executed

**URL:** <https://forum.mautic.org/t/delayed-actions-are-not-being-executed/31995>\
**Category:** Product Support\
**Created:** [May 7, 2024, 12:32pm UTC](https://forum.mautic.org/t/delayed-actions-are-not-being-executed/31995 "2024-05-07T12:32:56Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![renanwilliam](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/renanwilliam/32/11843_2.png) [@renanwilliam](https://forum.mautic.org/u/renanwilliam)\
**Post date:** [May 7, 2024, 12:32pm UTC](https://forum.mautic.org/t/delayed-actions-are-not-being-executed/31995/1 "2024-05-07T12:32:56Z")

</div>

**Your software**  
My Mautic version is: 5.0.4  
My PHP version is: 8.1.28  
My Database type and version is: MySQL 8.2.0

**Your problem**  
I have a campaign that leads are entering when they enter the segment and receive the first email. Then there is an action that should be carried out within 2 days, which sends a follow-up email. This email is never sent and I don’t understand why.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/6/6ddc35f50318e1f57648d9fb41df131c1a6da7e2.jpeg)  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/5/50db7ebf88804e91ced2d2a538ff170315376548.jpeg)

Taking a contact as an example, I can see that he receives the welcome email on April 30th and today, May 7th, he does not receive the follow-up email 1.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/7/7cbee43dc752e30903842cf96122d44bfd907337.jpeg)

Any guesses as to what it could be?

**These errors are showing in the log:**  
There are no errors in the log.

**Steps I have tried to fix the problem:**  
I checked the cron jobs and ran the commands manually:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/c/c9d4174fd97a37d26af16a08d427837fd44b14f5.png)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/0/0967484c234b257e23fcba49a73c8b674fbfe7df.png)

---

<div class="post-metadata">

**Author:** ![renanwilliam](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/renanwilliam/32/11843_2.png) [@renanwilliam](https://forum.mautic.org/u/renanwilliam)\
**Post date:** [May 10, 2024, 12:45pm UTC](https://forum.mautic.org/t/delayed-actions-are-not-being-executed/31995/2 "2024-05-10T12:45:05Z")

</div>

any thoughts?

---

<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 10, 2024, 1:34pm UTC](https://forum.mautic.org/t/delayed-actions-are-not-being-executed/31995/3 "2024-05-10T13:34:05Z")

</div>

Probably not all but very likely most of your headaches come from that  
(and best advice you’ll ever find on each and every PHP based web app forum, including this one):  
Don’t use root

Steps to resolve:

1. Remove all your Mautic cronjobs from your root crontab
2. Wipe clean your cache folder using the rm -Rf cmd while root
3. log out from the root account (you won’t ever need it anymore to manage your web app)
4. log in as your web user (if a shell is available, otherwise sudo yourself and assign the cronjobs to that user crontab using the crontab “-u” argument)

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [May 10, 2024, 1:47pm UTC](https://forum.mautic.org/t/delayed-actions-are-not-being-executed/31995/4 "2024-05-10T13:47:41Z")

</div>

Hi,  
The last executed event is, that the person is kicked out from the campaign, right?

---

<div class="post-metadata">

**Author:** ![renanwilliam](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/renanwilliam/32/11843_2.png) [@renanwilliam](https://forum.mautic.org/u/renanwilliam)\
**Post date:** [May 10, 2024, 1:50pm UTC](https://forum.mautic.org/t/delayed-actions-are-not-being-executed/31995/5 "2024-05-10T13:50:42Z")

</div>

I not using root for cronjobs, just used to run this example manually.  
I’m using the Docker oficial image, the user is www-data.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/d/d3a9b940714121f9a5e358fe5fbdb10013737081.png)  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/f/fb2b1074186ebb05e055cab0980fb73233b6caf7.png)  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/6/6312c167c3d5c1fcf6b8fa795febf430faa8d83c.png)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/2/2b1cd1f76bd82ea9660927e682d037bfe3a02a4f.png)

---

<div class="post-metadata">

**Author:** ![renanwilliam](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/renanwilliam/32/11843_2.png) [@renanwilliam](https://forum.mautic.org/u/renanwilliam)\
**Post date:** [May 10, 2024, 1:55pm UTC](https://forum.mautic.org/t/delayed-actions-are-not-being-executed/31995/6 "2024-05-10T13:55:35Z")

</div>

Yes the user has kicked out from another campaing (“Definição de estágio padrão”).  
But the campaing “Jornada Padrão” is active.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/7/709109cb42772d4b0004a541f5ff6f4fe65cba07.jpeg)

Campaign “Definição de estágio padrão” just put the contact in a default stage.

The campaign “Jornada Padrão” is a default journey for all users.

---

<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 10, 2024, 2:02pm UTC](https://forum.mautic.org/t/delayed-actions-are-not-being-executed/31995/7 "2024-05-10T14:02:15Z")

</div>

Great!

Make sure to clean your cache - otherwise you may face issues\*\*

---

<div class="post-metadata">

**Author:** ![renanwilliam](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/renanwilliam/32/11843_2.png) [@renanwilliam](https://forum.mautic.org/u/renanwilliam)\
**Post date:** [May 17, 2024, 6:44pm UTC](https://forum.mautic.org/t/delayed-actions-are-not-being-executed/31995/8 "2024-05-17T18:44:08Z")

</div>

any additional thoughts?

---

<div class="post-metadata">

**Author:** ![renanwilliam](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/renanwilliam/32/11843_2.png) [@renanwilliam](https://forum.mautic.org/u/renanwilliam)\
**Post date:** [May 27, 2024, 4:18pm UTC](https://forum.mautic.org/t/delayed-actions-are-not-being-executed/31995/9 "2024-05-27T16:18:23Z")

</div>

Found the problem: it’s related with my RabbitMQ queue settings:

When the action is executed , throws an error `vhost mautic/messages not found` when trying to send any e-mail using queue:  
[![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/0/0d9338802c036f0062ca02d6af948696c58bfb2d.png)](https://private-user-images.githubusercontent.com/19995615/334156269-b0c8d20a-965f-4f81-8641-cdf0045a2cf1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTY4MjY4MjgsIm5iZiI6MTcxNjgyNjUyOCwicGF0aCI6Ii8xOTk5NTYxNS8zMzQxNTYyNjktYjBjOGQyMGEtOTY1Zi00ZjgxLTg2NDEtY2RmMDA0NWEyY2YxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNTI3VDE2MTUyOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThlZWQwY2NhNjBlMDY4NzI4ZWNmMDA1YjllNjUyYWRjYmM4OWYzODIzNjhhN2Q2ZGNkZDNkOTRlODBmZDhiODUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.AkA4dlPtnUFBeuFbQs_P7B-arkJfhGl69nVZLtJsVbE)

Looks like this PR is settings a /messages at the end of of MAUTIC\_MESSENGER\_DSN\_EMAIL and MAUTIC\_MESSENGER\_DSN\_HIT variables, that causes the problem.

These settings works:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/d/dcea059a0b16ac2224b34a0998635463f4e9bb95.png)

> <https://github.com/mautic/docker-mautic/pull/265>
>
> the default RabbitMQ vhost is named \`/\`, which is encoded to \`%2F\`
> 
> See https:…//www.cloudamqp.com/blog/what-is-a-rabbitmq-vhost.html#:~:text=When%20configuring%20RabbitMQ%2C%20at%20least,to%20create%20a%20new%20vhost. and https://symfony.com/doc/current/messenger.html#amqp-transport 
> 
> There is a bug in Mautic 5 (still figuring out what's going on), that prevents storing the \`%2F\` value when saving the settings via the UI.
> 
> This PR provides a workaround, by renaming the default RabbitMQ vhost from \`/\` to \`mautic\`
> 
> 
> To test this PR:
> \* go to the \`rabbitmq-worker\` example dir
> \`\`\`
> ❯ cd examples/rabbitmq-worker
> \`\`\`
> \* start the example
> \`\`\`
> ❯ docker compose up -d
> \`\`\`
> \* install Mautic via the UI or CLI
> \*\*UI\*\*
> go to http://localhost:8003
>    
> \*\*CLI\*\*
> \`\`\`
> docker compose exec -u www-data -w /var/www/html mautic\_web php ./bin/console mautic:install http://localhost:8003 -f --admin\_email=admin@example.com --admin\_password=mautic
> \* verify the output of the worker container and check if the queue processing started
> \`\`\`
> ❯ docker compose logs mautic\_worker --no-log-prefix -n100 | grep "\[OK\] Consuming messages from"
> ...
> \[OK\] Consuming messages from transport "failed".
> \[OK\] Consuming messages from transport "email".
> \[OK\] Consuming messages from transport "hit".
> \[OK\] Consuming messages from transport "hit".
> \[OK\] Consuming messages from transport "failed".
> \[OK\] Consuming messages from transport "email".
> 
> ...
> \`\`\`

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/1X/43c63600fe51440378769136903f1fa2a9a34102.png) [@system](https://forum.mautic.org/u/system)\
**Post date:** [May 29, 2024, 4:18am UTC](https://forum.mautic.org/t/delayed-actions-are-not-being-executed/31995/10 "2024-05-29T04:18:27Z")

</div>

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.
