Multiple custom action messages not showing in Rasa X

I’m finding in Rasa X that if I have multiple messages in a custom action (i.e., two separate lines of dispatcher.utter_message), only one message is shown in Rasa X, but both are shown in other channels. Is this something on my end which stops the second message from showing?

I want to utter two separate responses in two separate texts. It works when I deploy it using telegram, however, it does not in Rasa X or even when I share with test users.

Rasa Version : 2.2.9 Rasa SDK Version : 2.2.0 Rasa X Version : 0.35.1 Python Version : 3.8.0

Example custom action:

class ActionOriginFunction(Action):

def name(self) -> Text:
	return "action_origin_function"

def run(self, dispatcher, tracker, domain):
	dispatcher.utter_message(template="utter_origin_story")
	dispatcher.utter_message(template="utter_function_understand")
	return []
1 Like

Hey @Liam, that’s odd! I just tried to reproduce using your versions and both messages came through for me when running locally.

Do you have more to your actual custom action than what’s above? Also are you seeing any errors in your action server logs? Lastly, are you running Rasa X in local mode, in a cluster, or in docker compose?

Hi @desmarchris, that is the complete code for that custom action. That code is the same for other custom actions (with name and message template differences) and no other custom action displays both messages in Rasa X.

I am using Rasa X locally. Using ‘rasa run action --debug’ does not provide any errors and the custom action shows up as working perfectly fine, yet only the first message template is shown.

Hmm I was also running locally, so that should rule out any environment issues…

I double checked with some others on the Rasa team too and we aren’t aware of anything that should be causing this. My only thought is to double check spelling / syntax… are your message templates named the same in your domain file? Can you try creating a new one from scratch in your current bot, and if that still fails try a new bot with rasa init and seeing if you can reproduce on your side?

Hi Chris, sorry for the late response. I decided to create a new environment, however, I can no longer install Rasa X locally. For some reason, pip is struggling to find compatible versions of specific files. I’ve left the command “pip3 install rasa-x --extra-index-url Simple Index” running for over 40 minutes before cancelling the script.

It doesn’t matter whether I install the most recent Rasa version or the version I specified above, I run into the same issues. Shown below, for example, is what continuously occurs.

INFO: pip is looking at multiple versions of sanic-cors to determine which version is compatible with other requirements. This could take a while. INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. If you want to abort this run, you can press Ctrl + C to do so. To improve how pip performs, tell us what happened here: https://pip.pypa.io/surveys/backtracking INFO: pip is looking at multiple versions of httptools to determine which version is compatible with other requirements. This could take a while. Collecting httptools>=0.0.10 Using cached httptools-0.1.0-cp38-cp38-win_amd64.whl (97 kB) Using cached httptools-0.0.13.tar.gz (104 kB) Using cached httptools-0.0.12.tar.gz (103 kB) Using cached httptools-0.0.11.tar.gz (99 kB) Using cached httptools-0.0.10.tar.gz (98 kB) INFO: pip is looking at multiple versions of rfc3986 to determine which version is compatible with other requirements. This could take a while. INFO: pip is looking at multiple versions of rfc3986[idna2008] to determine which version is compatible with other requirements. This could take a while. INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. If you want to abort this run, you can press Ctrl + C to do so. To improve how pip performs, tell us what happened here: https://pip.pypa.io/surveys/backtracking INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. If you want to abort this run, you can press Ctrl + C to do so. To improve how pip performs, tell us what happened here: https://pip.pypa.io/surveys/backtracking INFO: pip is looking at multiple versions of h11 to determine which version is compatible with other requirements. This could take a while. Collecting h11<0.10,>=0.8 Using cached h11-0.8.1-py2.py3-none-any.whl (55 kB) Using cached h11-0.8.0-py2.py3-none-any.whl (55 kB) INFO: pip is looking at multiple versions of httptools to determine which version is compatible with other requirements. This could take a while. INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. If you want to abort this run, you can press Ctrl + C to do so. To improve how pip performs, tell us what happened here: https://pip.pypa.io/surveys/backtracking INFO: pip is looking at multiple versions of aiofiles to determine which version is compatible with other requirements. This could take a while. Collecting aiofiles>=0.3.0 Using cached aiofiles-0.5.0-py3-none-any.whl (11 kB) Using cached aiofiles-0.4.0-py3-none-any.whl (9.2 kB) Using cached aiofiles-0.3.2-py3-none-any.whl (9.9 kB) Using cached aiofiles-0.3.1-py3-none-any.whl (9.2 kB) Using cached aiofiles-0.3.0-py3-none-any.whl (9.2 kB) INFO: pip is looking at multiple versions of h11 to determine which version is compatible with other requirements. This could take a while. INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. If you want to abort this run, you can press Ctrl + C to do so. To improve how pip performs, tell us what happened here: https://pip.pypa.io/surveys/backtracking INFO: pip is looking at multiple versions of sniffio to determine which version is compatible with other requirements. This could take a while. Collecting sniffio Using cached sniffio-1.1.0-py3-none-any.whl (4.5 kB) Using cached sniffio-1.0.0-py3-none-any.whl (4.4 kB) INFO: pip is looking at multiple versions of aiofiles to determine which version is compatible with other requirements. This could take a while. INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. If you want to abort this run, you can press Ctrl + C to do so. To improve how pip performs, tell us what happened here: https://pip.pypa.io/surveys/backtracking INFO: pip is looking at multiple versions of httpcore to determine which version is compatible with other requirements. This could take a while. Collecting httpcore==0.11.* Using cached httpcore-0.11.0-py3-none-any.whl (52 kB)

no worries Liam! That’s because of an updated Pip version. If you downgrade to pip 20.2 that should fix the dependency issue: pip install --upgrade pip==20.2

More context on why that happens: python - PIP install rasa-x takes forever - Stack Overflow

Thank you! Okay, so I have recreated the virtual environment and unfortunately I am still running into the same problems. Rasa X is still not showing the second message, yet Telegram does (which indicates that the syntax is valid). I really have no idea what is happening.

are you able to send me a repo or zip of your bot so I can try to reproduce?

I’ve just made a new public repo and removed some sensitive info.

Let me know what you find

@desmarchris i have the same issue as well.

Rasa X utters all the messages correctly whereas it skips some of the utterances.

Please find the logs below for the same:

WARNING:rasax.community.services.event_consumers.event_consumer:Saving event failed due to an ‘IntegrityError’. This means that the event is already stored in the database. The event data was ‘{“sender_id”: “2c7da67126d1494883acab672745bbae”, “event”: “bot”, “timestamp”: 1614161381.3632638, “text”: “Bot has completed the process Successfully!!”, “data”: {“elements”: null, “quick_replies”: null, “buttons”: null, “attachment”: null, “image”: null, “custom”: null}, “metadata”: {}}’. (sqlite3.IntegrityError) UNIQUE constraint failed: conversation_event.conversation_id, conversation_event.timestamp, conversation_event.type_name [SQL: INSERT INTO conversation_event (conversation_id, type_name, timestamp, intent_name, action_name, slot_name, slot_value, policy, is_flagged, data, evaluation, rasa_environment) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]

WARNING:rasax.community.services.event_consumers.event_consumer:Saving event failed due to an ‘IntegrityError’. This means that the event is already stored in the database. The event data was ‘{“sender_id”: “2c7da67126d1494883acab672745bbae”, “event”: “bot”, “timestamp”: 1614161381.3632638, “text”: null, “data”: {“elements”: null, “quick_replies”: null, “buttons”: null, “attachment”: “some url here”, “image”: null, “custom”: null}, “metadata”: {}}’. (sqlite3.IntegrityError) UNIQUE constraint failed: conversation_event.conversation_id, conversation_event.timestamp, conversation_event.type_name [SQL: INSERT INTO conversation_event (conversation_id, type_name, timestamp, intent_name, action_name, slot_name, slot_value, policy, is_flagged, data, evaluation, rasa_environment) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]

Bot is supposed to utter the above highlighted messages in rasa x. but it skipped and closed the chat whereas these messages are displayed in cmd interface without any issue.

I have these utter_messages in def submit() of Forms

@Saraa_m From what I can gather, those warnings are due to event saving failures from running Rasa X locally rather than the custom actions.

Also, what do you mean by it closed the chat?

It ended the chat without uttering the above given messages. I had multiple utter_messages in def submit() of FormAction where only the first one gets displayed and no other messages are displayed.

@Liam ok so it’s not anything with your repo… I just set it up locally and am seeing both messages come through. I had to remove your db files to get rasa x to run. Also I retrained the model if you want to retry that piece too.

I would try cloning your repo and reinstalling after removing the db files (separate deployment to make sure logs are kept). If this works for you, then I think something in the tracker could be corrupting this and I will open an issue.

Unfortunately, it still isn’t working. I have come across other similar issues on the forums and found that everyone who has had similar issues were using Rasa X locally on Windows 10. I am also getting similar warnings as Saraswathi above. When you performed the quick test, were you using Windows 10 OS or Linux?

UPDATE: I believe it is a Windows issue when using Rasa X. I have no problems on a Linux virtual machine (using GCP).

@Liam did you manage to solve it? I´m having the same problem: when using more than one dispatcher.utter_message in a custom action it only prompts the last message.

I´m also using Windows.

@themrcesi Hiya. Unfortunately, I did not solve it when using Windows. I created a Linux virtual machine on Google Cloud Server and that worked. So, I assume Rasa X does not display multiple messages when using Windows. Deep searching found that Rasa X assumes Windows acts in the same way as a Linux machine, which contributes to the problem.

When using Rasa X locally, I connected it to Telegram and all the messages appeared. If using Telegram locally, conversations won’t be saved to Rasa X but you can interact with the chatbot easily. You’ll need to use ngrok to set up Telegram and use it locally. Go through this page if you would like to set up custom channels.

@Liam I am having the same issue on Rasa X on Windows 10 Local Mode installation. Is there any update on this from RASA. I tried searching in forums but I don’t see any recent post about solving the issue.

Hi @slkjain, I switched to using a linux virtual machine so I am unsure whether Rasa X has been updated to fix that issue. Read my previous post about using Telegram instead for local usage on windows!

Hi @Liam Do you know how to inform rasa about this issue? Sorry I am new to Rasa and not sure how to get an update from rasa folks.

I tried rasa x on WSL2 Ubuntu but couldn’t make it work. The telegram solution does not provide me all the Rasa x features hence that is of limited utility.

Thanks for your help.