I have Rasa Open Source set up on an instance of Google Cloud - Compute Engine with a fixed IP. I am trying to set up an interface to it using the Rasa Chat Widget. I have set up a Socket Channel in my configuration and I have created firewall rules in my Google instance. However, the channel does not launch, and I cannot connect to it from my the Chat Widget. I am not sure what I am missing?
By launch do you mean that you don’t see the /socket.io endpoint when rasa starts?
Here’s an example from a 3.x bot of mine, showing that my /socket channel has started. Enable --debug and make sure you are seeing the channel start. Sounds like it isn’t starting which would mean that your credentials.yml file is not being read in the compute engine instance.
2022-03-30 03:26:42 DEBUG rasa.core.utils - Available web server routes:
/webhooks/twilio_voice GET Twilio_voice_webhook.health
/webhooks/twilio_voice/webhook POST Twilio_voice_webhook.receive
/conversations/<conversation_id:path>/messages POST add_message
/conversations/<conversation_id:path>/tracker/events POST append_events
/auth POST auth_bp.AuthenticateEndpoint
/auth/me GET auth_bp.RetrieveUserEndpoint
/auth/verify GET auth_bp.VerifyEndpoint
/webhooks/rest GET custom_webhook_RestInput.health
/webhooks/rest/webhook POST custom_webhook_RestInput.receive
/model/test/intents POST evaluate_intents
/model/test/stories POST evaluate_stories
/conversations/<conversation_id:path>/execute POST execute_action
/domain GET get_domain
/socket.io POST handle_request
/ GET hello
/model PUT load_model
/model/parse POST parse
I also wrote a recent blog post on an easy way to test the Rasa socket.io channel.
@stephens Thanks for your message, this is very helpful! I can see now my socket.io channel is running
2022-04-04 12:11:30 DEBUG rasa.core.utils - Available web server routes:
/webhooks/rasa GET custom_webhook_RasaChatInput.health
/webhooks/rasa/webhook POST custom_webhook_RasaChatInput.receive
/webhooks/rest GET custom_webhook_RestInput.health
/webhooks/rest/webhook POST custom_webhook_RestInput.receive
/socket.io POST handle_request
/ GET hello
/webhooks/socketio GET socketio_webhook.health
But I am just getting the message:
"The client is using an unsupported version of the Socket.IO or Engine.IO protocols"
I am using version 5.5.2 of python-socketio on my server, do you know what version I need to be compatible?
As an aside, I see from your blog post you have used botfront’s webchat, I am also trying to work with this product, but unlike the rasa widget when I embed webchat I don’t see anything on my webpage.
@stephens Thanks for the response! It does look like this incompatibility issue was part of Rasa 2.3 and 2.4, and can be resolved by upgrading. However, I am already using Rasa 2.8, so I am unsure what the issue is?
EDIT: I am also trying this with Rasa 3.1 to no avail.
EDIT 2: Okay, so running rasa with rasa run -m models --enable-api --cors "*" --debug specifically has addressed the websocket issue! However, I am not getting a new error:
Exception occurred while handling uri: 'ws://<ip address>:5005/socket.io/?EIO=4&transport=websocket&sid=<>'
Traceback (most recent call last):
File "handle_request", line 124, in handle_request
sanic.exceptions.ServerError: Invalid response type None (need HTTPResponse)
and I am getting no response from my bot.
correction my websocket is now connecting but the version incomaptaibility remains.
@arabellastrange have you seen my mentioned threads? This is related to sanic version compatibility with Rasa 3.X. I highly recommend seeing my suggested thread, you will get all your answers in that.
@nik202 I can’t really downgrade Sanic however, since Rasa 3.1 requires a minimum 21.13, see error below:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
rasa 3.1.0 requires sanic<21.13,>=21.12, but you have sanic 21.6.0 which is incompatible.
rasa 3.1.0 requires sanic-cors<3.0.0,>=2.0.0, but you have sanic-cors 1.0.0 which is incompatible.
rasa 3.1.0 requires sanic-routing<0.8.0,>=0.7.2, but you have sanic-routing 0.7.0 which is incompatible.
rasa-sdk 3.1.1 requires sanic<22.0.0,>=21.12.0, but you have sanic 21.6.0 which is incompatible.
rasa-sdk 3.1.1 requires Sanic-Cors<3.0.0,>=2.0.0, but you have sanic-cors 1.0.0 which is incompatible.
works for Rasa 3 but when I try to install it pip tells me I need sanic-routing==0.7.2 minimum for Rasa, which means I have to upgrade Sanic, because version 21.6.0 only supports up to 0.7.0. It seems Sanic==21.9.3 may be acceptable, but running rasa run -m models --debug --enable-api --cors "*" now returns
2022-04-07 14:33:42 DEBUG urllib3.connectionpool - Starting new HTTPS connection (1): o251570.ingest.sentry.io:443
TypeError: add() takes 3 positional arguments but 4 were given
2022-04-07 14:33:42 DEBUG urllib3.connectionpool - https://o251570.ingest.sentry.io:443 "POST /api/2801673/store/ HTTP/1.1" 200 41
@arabellastrange create the fresh conda env, installed the suggested thread version and use botfront widget and try to talk to the bot. If stuck, do let me know, please.
Trying to run my rasa model fails with the same error above:
python3.8 -m rasa run --model <model_name>.tar.gz --enable-api --cors --debug
File "/home/.local/lib/python3.8/site-packages/rasa/core/run.py", line 103, in configure_app
app = server.create_app(
File "/home/.local/lib/python3.8/site-packages/rasa/server.py", line 664, in create_app
async def handle_error_response(
File "/home/.local/lib/python3.8/site-packages/sanic/mixins/exceptions.py", line 36, in decorator
self._apply_exception_handler(future_exception)
File "/home/.local/lib/python3.8/site-packages/sanic/app.py", line 356, in _apply_exception_handler
self.error_handler.add(exception, handler.handler, route_names)
TypeError: add() takes 3 positional arguments but 4 were given
Running models with the default versions installed with Rasa 3.0 returns the same socket incompatibility issue discussed previously.
In my previous reply I have simply created a new server instance and reinstalled there, in this case I have deleted my environment and reinstalled everything from your attached requirements.txt and I have arrived at the same conflict:
The conflict is caused by:
The user requested sanic-routing==0.7.0
sanic 21.6.0 depends on sanic-routing==0.7.0
rasa 3.0.0 depends on sanic-routing<0.8.0 and >=0.7.2
I am considering reporting this as a bug on the git repo if you are able to possibly replicate this issue?