Problem with multiple user using Telegram

Hi everyone, I’m quite new with RASA. I’m trying to build a chatbot to answer FAQ for the recent emergency in Italy. The system recognise the question then uses elastic search to find the most similar one. Furthermore we need to have an explicit consent to the use of personal data from the user before answering any question. The system works fine when tested using rasa shell, but when we run it on Telegram and we try to access in multiple user there are always unexpected loop of answer or question.

This is the stories.md: stories.md (2.4 KB)

This is the domain.yml: domain.yml (3.4 KB)

And this is the config.yml: config.yml (668 Bytes)

And this is the log of the problem we have during on line testing:

> | 46630 | 92df6f8e1bffb30a5bd34a909d830a4b | user      | 1586430000 | corona_question | NULL                        | {"event": "user", "timestamp": 1586425569.4796462, "text": "eh Sono possibili importazioni di animali o di prodotti di origine animale dalla Cina?", "parse_data": {"intent": {"name": "corona_question", "confidence": 0.9999810457229614}, "entities": [], "intent_ranking": [{"name": "corona_question", "confidence": 0.9999810457229614}, {"name": "goodbye", "confidence": 1.0039554581453558e-05}, {"name": "greet", "confidence": 7.22525055607548e-06}, {"name": "out_of_scope", "confidence": 1.7575149513504584e-06}], "text": "eh Sono possibili importazioni di animali o di prodotti di origine animale dalla Cina?"}, "input_channel": "telegram", "message_id": "3912f8530d474dfebfd3fd888e149c01", "metadata": {}}                                                                                                                                                                                                                                                                                                                              |
> | 46631 | 92df6f8e1bffb30a5bd34a909d830a4b | action    | 1586430000 | NULL            | utter_ask_consent           | {"event": "action", "timestamp": 1586425569.5413973, "name": "utter_ask_consent", "policy": "policy_1_KerasPolicy", "confidence": 0.5638370513916016}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
> | 46632 | 92df6f8e1bffb30a5bd34a909d830a4b | bot       | 1586430000 | NULL            | NULL                        | {"event": "bot", "timestamp": 1586425569.5414143, "text": "Per utilizzare questo servizio, leggi l\u2019informativa sulla privacy a questo link https://futuremedia.fbk.eu/informativa-privacy-salbot-coronavirus.html e clicca /do_il_consenso per acconsentire al trattamento dei tuoi dati.", "data": {"elements": null, "quick_replies": null, "buttons": null, "attachment": null, "image": null, "custom": null}, "metadata": {}}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
> | 46633 | 92df6f8e1bffb30a5bd34a909d830a4b | action    | 1586430000 | NULL            | action_restart              | {"event": "action", "timestamp": 1586425569.6637053, "name": "action_restart", "policy": "policy_1_KerasPolicy", "confidence": 0.9977224469184875}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
> | 46634 | 92df6f8e1bffb30a5bd34a909d830a4b | restart   | 1586430000 | NULL            | NULL                        | {"event": "restart", "timestamp": 1586425569.6637208}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
> | 46635 | 92df6f8e1bffb30a5bd34a909d830a4b | action    | 1586430000 | NULL            | action_listen               | {"event": "action", "timestamp": 1586425569.6639788, "name": "action_listen", "policy": null, "confidence": 1.0}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
> | 46745 | 92df6f8e1bffb30a5bd34a909d830a4b | user      | 1586430000 | start           | NULL                        | {"event": "user", "timestamp": 1586425617.271904, "text": "/start", "parse_data": {"text": "/start", "intent": {"name": "start", "confidence": 1.0}, "intent_ranking": [{"name": "start", "confidence": 1.0}], "entities": []}, "input_channel": "telegram", "message_id": "1c8a09b8147749d3b2a2f8d2ff77991b", "metadata": {}}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
> | 46746 | 92df6f8e1bffb30a5bd34a909d830a4b | action    | 1586430000 | NULL            | utter_ask_consent           | {"event": "action", "timestamp": 1586425617.3346903, "name": "utter_ask_consent", "policy": "policy_1_KerasPolicy", "confidence": 0.922694206237793}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
> | 46747 | 92df6f8e1bffb30a5bd34a909d830a4b | bot       | 1586430000 | NULL            | NULL                        | {"event": "bot", "timestamp": 1586425617.3347154, "text": "Per utilizzare questo servizio, leggi l\u2019informativa sulla privacy a questo link https://futuremedia.fbk.eu/informativa-privacy-salbot-coronavirus.html e clicca /do_il_consenso per acconsentire al trattamento dei tuoi dati.", "data": {"elements": null, "quick_replies": null, "buttons": null, "attachment": null, "image": null, "custom": null}, "metadata": {}}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
> | 46748 | 92df6f8e1bffb30a5bd34a909d830a4b | action    | 1586430000 | NULL            | action_restart              | {"event": "action", "timestamp": 1586425617.5155272, "name": "action_restart", "policy": "policy_1_KerasPolicy", "confidence": 0.9998152852058411}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
> | 46749 | 92df6f8e1bffb30a5bd34a909d830a4b | restart   | 1586430000 | NULL            | NULL                        | {"event": "restart", "timestamp": 1586425617.5155427}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
> | 46750 | 92df6f8e1bffb30a5bd34a909d830a4b | action    | 1586430000 | NULL            | action_listen               | {"event": "action", "timestamp": 1586425617.5158045, "name": "action_listen", "policy": null, "confidence": 1.0}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
> | 46803 | 92df6f8e1bffb30a5bd34a909d830a4b | user      | 1586430000 | do_il_consenso  | NULL                        | {"event": "user", "timestamp": 1586425633.0546782, "text": "/do_il_consenso", "parse_data": {"text": "/do_il_consenso", "intent": {"name": "do_il_consenso", "confidence": 1.0}, "intent_ranking": [{"name": "do_il_consenso", "confidence": 1.0}], "entities": []}, "input_channel": "telegram", "message_id": "d5a705430a7b46bdb9ff243c3cc3423d", "metadata": {}}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
> | 46804 | 92df6f8e1bffb30a5bd34a909d830a4b | action    | 1586430000 | NULL            | utter_ask_consent           | {"event": "action", "timestamp": 1586425633.1172972, "name": "utter_ask_consent", "policy": "policy_1_KerasPolicy", "confidence": 0.3697848916053772}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
> | 46805 | 92df6f8e1bffb30a5bd34a909d830a4b | bot       | 1586430000 | NULL            | NULL                        | {"event": "bot", "timestamp": 1586425633.117314, "text": "Per utilizzare questo servizio, leggi l\u2019informativa sulla privacy a questo link https://futuremedia.fbk.eu/informativa-privacy-salbot-coronavirus.html e clicca /do_il_consenso per acconsentire al trattamento dei tuoi dati.", "data": {"elements": null, "quick_replies": null, "buttons": null, "attachment": null, "image": null, "custom": null}, "metadata": {}}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
> | 46806 | 92df6f8e1bffb30a5bd34a909d830a4b | action    | 1586430000 | NULL            | action_restart              | {"event": "action", "timestamp": 1586425633.2486467, "name": "action_restart", "policy": "policy_1_KerasPolicy", "confidence": 0.9992877840995789}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
> | 46807 | 92df6f8e1bffb30a5bd34a909d830a4b | restart   | 1586430000 | NULL            | NULL                        | {"event": "restart", "timestamp": 1586425633.2486613}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
> | 46808 | 92df6f8e1bffb30a5bd34a909d830a4b | action    | 1586430000 | NULL            | action_listen               | {"event": "action", "timestamp": 1586425633.2489166, "name": "action_listen", "policy": null, "confidence": 1.0}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
> | 46809 | 92df6f8e1bffb30a5bd34a909d830a4b | user      | 1586430000 | do_il_consenso  | NULL                        | {"event": "user", "timestamp": 1586425638.237026, "text": "/do_il_consenso", "parse_data": {"text": "/do_il_consenso", "intent": {"name": "do_il_consenso", "confidence": 1.0}, "intent_ranking": [{"name": "do_il_consenso", "confidence": 1.0}], "entities": []}, "input_channel": "telegram", "message_id": "f4d6b4c37998448da9017b877d1849b5", "metadata": {}}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
> | 46810 | 92df6f8e1bffb30a5bd34a909d830a4b | action    | 1586430000 | NULL            | utter_ask_consent           | {"event": "action", "timestamp": 1586425638.2998157, "name": "utter_ask_consent", "policy": "policy_1_KerasPolicy", "confidence": 0.3697848916053772}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
> | 46811 | 92df6f8e1bffb30a5bd34a909d830a4b | bot       | 1586430000 | NULL            | NULL                        | {"event": "bot", "timestamp": 1586425638.2998326, "text": "Per utilizzare questo servizio, leggi l\u2019informativa sulla privacy a questo link https://futuremedia.fbk.eu/informativa-privacy-salbot-coronavirus.html e clicca /do_il_consenso per acconsentire al trattamento dei tuoi dati.", "data": {"elements": null, "quick_replies": null, "buttons": null, "attachment": null, "image": null, "custom": null}, "metadata": {}}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
> | 46812 | 92df6f8e1bffb30a5bd34a909d830a4b | action    | 1586430000 | NULL            | action_restart              | {"event": "action", "timestamp": 1586425638.4326527, "name": "action_restart", "policy": "policy_1_KerasPolicy", "confidence": 0.9992877840995789}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
> | 46813 | 92df6f8e1bffb30a5bd34a909d830a4b | restart   | 1586430000 | NULL            | NULL                        | {"event": "restart", "timestamp": 1586425638.4326677}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
> | 46814 | 92df6f8e1bffb30a5bd34a909d830a4b | action    | 1586430000 | NULL            | action_listen               | {"event": "action", "timestamp": 1586425638.4329216, "name": "action_listen", "policy": null, "confidence": 1.0}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
> | 46855 | 92df6f8e1bffb30a5bd34a909d830a4b | user      | 1586430000 | greet           | NULL                        | {"event": "user", "timestamp": 1586425645.0254683, "text": "ciao?", "parse_data": {"intent": {"name": "greet", "confidence": 0.5837719440460205}, "entities": [], "intent_ranking": [{"name": "greet", "confidence": 0.5837719440460205}, {"name": "goodbye", "confidence": 0.33033597469329834}, {"name": "out_of_scope", "confidence": 0.059241458773612976}, {"name": "corona_question", "confidence": 0.026650656014680862}], "text": "ciao?"}, "input_channel": "telegram", "message_id": "a6b0410518504c3fbe61a666cad9ad41", "metadata": {}}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
> | 46856 | 92df6f8e1bffb30a5bd34a909d830a4b | action    | 1586430000 | NULL            | utter_ask_consent           | {"event": "action", "timestamp": 1586425645.0872, "name": "utter_ask_consent", "policy": "policy_1_KerasPolicy", "confidence": 0.8774756789207458}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
> | 46857 | 92df6f8e1bffb30a5bd34a909d830a4b | bot       | 1586430000 | NULL            | NULL                        | {"event": "bot", "timestamp": 1586425645.0872173, "text": "Per utilizzare questo servizio, leggi l\u2019informativa sulla privacy a questo link https://futuremedia.fbk.eu/informativa-privacy-salbot-coronavirus.html e clicca /do_il_consenso per acconsentire al trattamento dei tuoi dati.", "data": {"elements": null, "quick_replies": null, "buttons": null, "attachment": null, "image": null, "custom": null}, "metadata": {}}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
> | 46858 | 92df6f8e1bffb30a5bd34a909d830a4b | action    | 1586430000 | NULL            | action_restart              | {"event": "action", "timestamp": 1586425645.2266245, "name": "action_restart", "policy": "policy_1_KerasPolicy", "confidence": 0.9998444318771362}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
> | 46859 | 92df6f8e1bffb30a5bd34a909d830a4b | restart   | 1586430000 | NULL            | NULL                        | {"event": "restart", "timestamp": 1586425645.2266407}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
> | 46860 | 92df6f8e1bffb30a5bd34a909d830a4b | action    | 1586430000 | NULL            | action_listen               | {"event": "action", "timestamp": 1586425645.226892, "name": "action_listen", "policy": null, "confidence": 1.0}

In this case after a question the system start asking for personal data consent and keep doing this. As you can see from the weird stories.md we already tried many possible solution to avoid loop in the conversation but they keep happening.

Is this related to Telegram? To multiple users? To the fact we are using ngrok? Thank you for any possible advice

Hi @Simone,

thanks for the detailed information in the question! That really helps debugging :pray:
Do you know by what the second do_il_consenso is triggered? Is it the user pressing a button twice? There definitely shouldn’t be a difference between the input channels :thinking:

Hi @Simone and @Tobias_Wochinger,

I have been experiencing the issue a lot where button presses on Telegram lead to multiple sends

I’ve attached a screenshot. In this example the user only pressed “all right” once but Telegram sends it several times.

Unfortunately I was not able to figure out why (no errors or particular condition I could recognize). It does make the combination of RASA, Telegram and buttons essentially unusable though.

Mhm, do you mean the Telegram API calls the Rasa Open Source endpoint multiple times?

Exactly

I don’t know if you already solved your issue but Telegram sends the responde multiple times when Telegram doesn’t get a response. I don’t know how are you developing the Rasa server but looks like it is too slow for telegram.

Maybe this is the issue.

Hi @darich10 and thanks for your input.

I don’t think that is the explanation (I’ve seen repeats within a second).

@Tobias_Wochinger I’ve been finding ways to workaround the issue which I’ve commented on here:

Maybe it can help with a proper fix.

sorry to add this. But since May i posted a complain in github and since them my rasa never work well with telegram , I am using version 1.10.10 now and the loop with messages continues. I hope someone in RASA could fix this . Regards.