Multiple responses against single message in FB Messenger

I have developed a Rasa Bot and linked that bot with Facebook Messenger. My bot works perfectly fine. In recent days I am facing an issue in which I receive multiple webhooks against a single message and RASA shows multiple responses against a single message. This happens randomly not on every chat. But happens mostly when a new user tries to send a message through FB. My deployment is getting delayed due to this issue and I am unable to find and issue. Any help will be appreciated. Thanks.

I would start by putting a debug message in the facebook channel code to confirm whether you are getting duplicate posts from facebook.

Okay let me try this.

I have a rasa folder in which I am running all these codes. Can you show me where to edit this file ? I am using Ubuntu 18.04.

Hello I managed to locate the rasa core files. but whan I am changing those files I am not seeing any change in my logs. Second against one message messenger is sending 3 POST request.

pip show rasa will show you the location of your Rasa install and you should be modifying the file facebook channel file in that location. You would then restart rasa and see your new debug messages in the log. If you’re running the docker-compose setup, you should see the messages with docker-compse logs -f rasa-production.

How to restart rasa in Ubuntu ?

docker-compose restart

Hi I just tested the complete theory. After adding multiple logger.warning in the rasa core files. The logs are not showing anything while I add a tail. I restarted using docker-compose restart. But my logs are not showing up. I am doing this tests on RASA X.

Really needed your help on this.

Make sure you start starting rasa with the --debug option so logger.debug messages are written.

Hi Stephen,

web have similar problem with the Slack connector

Here is the link to the forum thread

We had been debugging and we can see how Rasa is sending multiple times the same message. I added the logger.debug on the send_text_message function.

we can see some errors coming from and

If you would like more info from our side, let me know

all the best

Do we have any solution for this as we are also facing the same issue.

the problem comes from FB messenger

show me the actions and story file

I’m running into a similar problem with Telegram. How did you solve it? How did you debug where the problem was coming from? thanks so much!

This issue actually exists in RASA. Sometime the Rasa X docker which is receiving the curl, respond with some delay for some unknown reason. Due to which such medium like fb, telegram retry the request. In that regard the response gets duplicate.

MY SOLUTION- What I have done is I just created a new webhook receiver on my custom server and receive all request from fb, telegram on that server. I have established a queue there and put all request there but make sure it doesn’t get duplicate. By doing that so I managed to solve this issue.

This is just my solution to the problem after spending a week. Other solutions are also welcome.

I hope that I help you guys. Thanks

1 Like

Hi @omerraheem just wanted to ask, what parameter did you check to make sure you won’t have duplicates? was it the “mid” from the payload from fb messenger?

Thank You.