Problem with dispatcher.utter_message

Rasa version: 1.5.1

Issue :

Hi, I’m facing a problem with a basic custom action that should return “Hello world!” text.

I’m getting this :

server > Frame(fin=True, opcode=1, data=b'42["bot_uttered",{"attachment":{"type":"image","payload":{"src":"Hello world!"}}}]', rsv1=False, rsv2=False, rsv3=False)

And I get a blank image in my webChat since “type” : “image” in the uttered message.

Here is my custom action code :

from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher
from typing import Any, Text, Dict, List
from rasa_sdk.events import SlotSet

class MyCustomAction(Action) :

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

def run(self, dispatcher: CollectingDispatcher,
	    tracker: Tracker,
	    domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
    message = "Hello world!"
    dispatcher.utter_message(message)
    return []

Did I miss something ?

Hi @Abdessamad,

welcome to the community! Can you please update to the latest rasa-sdk version? if this is not possible, please specify the message as keyword argument:

    dispatcher.utter_message(text=message)

Thank you @Tobias_Wochinger, it worked !

I updated rasa-sdk and kept my first configuration with dispatcher.utter_message(message) and worked as well !

Hi @Tobias_Wochinger,

For me dispatcher.utter_message(“hello world!”) works well in Rasa but no message outputted in Rasa X (see below screenshot). Highlighted line is the place that we expect to see “hello world!”, but instead I am getting action name (i.e. “action_info_saved”) from actions.py file.

Rasa versions: 1.7 or 1.9 (I tried both) Rasa X version: 0.27.3

I also have the same error, didn’t worked out for me as well, have to downgrade the rasa x to 0.24.7 then it works

Thanks @svshubham01 for the reply. Problem is Rasa X 0.24.7 comes with Rasa 1.6, but we developed our bot using Rasa 1.7. So the bot did not work with Rasa X 0.24.7. Have you ever tried with higher Rasa X versions like 0.26 which comes with Rasa 1.7?

AV

can you show us your custom action?

Hi @svshubham01 ,

Very simple, I commented everything and just kept dispatcher.utter_message(“hello world”), see below. The whole custom actions works fine in Rasa but nothing in Rasa X :

from typing import Any, Text, Dict, List
from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher

class ActionInfoSaved(Action):

def name(self):
    return "action_info_saved"

def run(self, dispatcher, tracker, domain):
    dispatcher.utter_message("hello world") # for testing purpose
    # key = tracker.latest_message['entities'][0]       

    # if key['value'] is not None and key['entity']=='postal_code_pattern':
    #     dispatcher.utter_message("thanks, {} was saved, now how can I help you today?".format(key['value']))

    # elif key['value'] is not None and key['entity']=='first_name':
    #     dispatcher.utter_message("thanks, {} was saved, may I have your postal code please?".format(key['value']))          

    # else:
    #     dispatcher.utter_message("I did not get your point!")        

    return []

can you try this :- @amvas

message ="hello world"
dispatcher.utter_message(text=message)

Hi @svshubham01, thanks for the help. We solved this problem by upgrading Rasa X to 0.27.1.

But we got a new problem. Whenever I type a new message in " Talk to your bot" UI, I never get my answer back from bot (sometimes even my message disappears!). I did some investigations and noticed that in fact bot replies my messages but nothing shows up in UI. I found this simply by inspecting the network response in the browser (Chrome), see below image:

Is this a Rasa X UI problem? I appreciate any help from you too guys, @Tobias_Wochinger and @akelad

Mhm, this is very weird. I can’t reproduce it. Can you please share your logs of the rasa-production and the rasa-x container?

docker-compose.zip (978.1 KB) @Tobias_Wochinger, thanks for the reply. Please find attached log file (docker-compose) containing the logs from Rasa X docker restart up to my last interactions with bot (last few mins in the log). Original log file was huge, I removed some useless parts. Meanwhile: Rasa X version 0.27.1 and Rasa version 1.9 - I also attached the Rasa X UI screenshot.

it seems as would the action server sometimes fail on this message:

Also, your machine seems to run out of disk space:

Thanks @Tobias_Wochinger for the reply. For your first point, yes at the beginning we had problem with action server but we solved that. For second point, since out of space happened on worker server, so I believe it was during training a model directly on Rasa X, am I right? That was a test (normally we train the models locally in Rsa and upload it to Rasa X). Worker server is just for model training purpose, right? Can it affect UI? I’ll take a deeper look at the second point. But I think our problem is so close to this question asked in the forum:

Please give your thought. Thanks AV

No, it can’t affect anything in the UI

I’ll take a deeper look at the second point. But I think our problem is so close to this question asked in the forum:

nice work in digging that up. Are you also port-forwarding or using a proxy?