Server response not showing in rasa webchat

Responses are never shown on the Rasa widget chatwindow.

A. Server log shows that the user message (“hi”) is received from the webchat and a response is generated as shown in terminal:

2023-11-22 12:23:10 DEBUG    rasa.engine.runner.dask  - Running graph with inputs: {'__message__': [<rasa.core.channels.channel.UserMessage object at 0x000001E9C2272FE0>], '__tracker__': <rasa.shared.core.trackers.DialogueStateTracker object at 0x000001E9C22732E0>}, targets: ['run_RegexMessageHandler'] and ExecutionContext(model_id='462b77cd6f524726858f9b04c961bcb2', should_add_diagnostic_data=False, is_finetuning=False, node_name=None).
2023-11-22 12:23:11 DEBUG    rasa.core.processor  - [debug    ] processor.actions.log          action_name=utter_greet rasa_events=[BotUttered('Hey! How are you?', {"elements": null, "quick_replies": null, "buttons": null, "attachment": null, "image": null, "custom": null}, {"utter_action": "utter_greet"}, 1700644991.7104983)]

But even though the webchat widget registers the input message, the response is not printed. I’m not sure if the window for the socket closes before the response from the server could be captured or if something else is going on.

B. I’ve recreated this issue on the most basic setup I can try via:

  1. Opening an empty directory in vscode named ‘rasa’
  2. running pip install rasa
  3. running rasa init (accepting current directory as initialisation path and accepting model training)
  4. creating an index.html file with the widget script called

the html script is simply:

<html>
    <body>
        <div id="rasa-chat-widget" data-websocket-url="http://localhost:5005"></div>
        <script src="https://unpkg.com/@rasahq/rasa-chat" type="application/javascript"></script>
    </body>
</html>

C. for versioning, my rasa --version outputs:

Rasa Version      :         3.6.14
Minimum Compatible Version: 3.5.0
Rasa SDK Version  :         3.6.2
Python Version    :         3.10.11
Operating System  :         Windows-10-10.0.22621-SP0

The “main players” of my libraries in terms of SIO EIO and Sanic are versioned as:

python-engineio==4.8.0
python-socketio==5.10.0
rasa==3.6.14
rasa-sdk==3.6.2
sanic==21.12.2
Sanic-Cors==2.0.1
sanic-jwt==1.8.0
sanic-routing==0.7.2

I could provide a full list of libraries and their versions, but that’s 156 lines long and again was purely generated as a result of running pip install rasa

D. I edited none of the defaul init files with the exception of credentials.yml to define socketio

socketio:
 user_message_evt: user_uttered
 bot_message_evt: bot_uttered
 session_persistence: true

E. I ran the rasa server using the command:

rasa run --cors "*" --debug

I can note that the network handshake for a websocket is successful and I get my 101 message appropriately, and I can see the responses in the websocket for every “user_uttered” sent up to the socket, but never anything recieved down (it continuously probes for and up or down without sending or receiving anything, assuming i just leave it there after my message).

Should I be downgrading some versions to something in particular? Is there any known configuration for library versions deemed fully functioning across systems for my python version?

Take a look at the troubleshooting steps I posted here.

The endpoint is available and does allow traffic through it.

aporonaut@LEGION5-150223:/mnt/d/Admin/Documents/Projects/rasa$ curl --location --globoff 'http://<url>:5005/socket.io/?EIO=4&transport=polling&t=NHB_3lo'
0{"sid":"DXWRO4673xZKzRi7AAAB","upgrades":["websocket"],"pingTimeout":20000,"pingInterval":25000}

The debugger shows the following messages about web server routing and sockets:

2023-11-23 11:33:41 DEBUG    rasa.core.utils  - Available web server routes: 
/webhooks/rasa                                     GET                            rasa_core_no_api.custom_webhook_RasaChatInput.health
/webhooks/rasa/webhook                             POST                           rasa_core_no_api.custom_webhook_RasaChatInput.receive
/webhooks/rest                                     GET                            rasa_core_no_api.custom_webhook_RestInput.health
/webhooks/rest/webhook                             POST                           rasa_core_no_api.custom_webhook_RestInput.receive
/socket.io                                         GET                            rasa_core_no_api.handle_request
/                                                  GET                            rasa_core_no_api.hello
/webhooks/socketio                                 GET                            rasa_core_no_api.socketio_webhook.health
2023-11-23 11:33:41 INFO     root  - Starting Rasa server on http://0.0.0.0:5005

Again, note that outgoing messages work fine on the webchat through the socket, but messages meant to come in from the server are generated but never make it to the widget.

Same I am getting this D:\realrasa\virenv\lib\site-packages\rasa\core\channels\socketio.py:236: RuntimeWarning: coroutine ‘AsyncServer.enter_room’ was never awaited sio.enter_room(sid, data[“session_id”]) RuntimeWarning: Enable tracemalloc to get the object allocation traceback have you found any ways to solve this error