# Official rasa chat widget - socket.io connection refused

**URL:** <https://forum.rasa.com/t/official-rasa-chat-widget-socket-io-connection-refused/50281>\
**Category:** Rasa Open Source\
**Created:** [December 26, 2021, 4:01pm UTC](https://forum.rasa.com/t/official-rasa-chat-widget-socket-io-connection-refused/50281 "2021-12-26T16:01:03Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![rafa21](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/rafa21/32/18713_2.png) [@rafa21](https://forum.rasa.com/u/rafa21)\
**Post date:** [December 26, 2021, 4:01pm UTC](https://forum.rasa.com/t/official-rasa-chat-widget-socket-io-connection-refused/50281/1 "2021-12-26T16:01:03Z")

</div>

Hi, I am totally new to Rasa and trying to use the Rasa Chat widget described [here](https://rasa.com/docs/rasa/connectors/your-own-website/#chat-widget)

I get this error [http://localhost/socket.io/?EIO=4&transport=polling&t=NttRrl2](http://localhost/socket.io/?EIO=4&transport=polling&t=NttRrl2) net::ERR\_CONNECTION\_REFUSED

My credentials has: ![c1](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/3X/a/e/ae5bb7f604c4e34235de4b2a54a3e1fc65cd32f6.png)

My index.html has: ![c2](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/3X/8/5/85fc770453cf42a8020c88eed8bd2c0832a849ff.png)

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [December 27, 2021, 4:15pm UTC](https://forum.rasa.com/t/official-rasa-chat-widget-socket-io-connection-refused/50281/2 "2021-12-27T16:15:43Z")

</div>

Hi @rafa21 and welcome to the forum 🙂

No worries will solve this together. Please can you share your `rasa --version`.

@rafa21 can you please update this “[http://localhost:5005](http://localhost:5005)”

@rafa21 are you using rasa open-source or rasa x? It local installation or server-side?

@rafa21 which command you are using to run the rasa?

---

<div class="post-metadata">

**Author:** ![rafa21](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/rafa21/32/18713_2.png) [@rafa21](https://forum.rasa.com/u/rafa21)\
**Post date:** [December 27, 2021, 5:09pm UTC](https://forum.rasa.com/t/official-rasa-chat-widget-socket-io-connection-refused/50281/3 "2021-12-27T17:09:45Z")

</div>

Dear @nik202Thank you so much for your help

> Rasa Version : 3.0.3 Minimum Compatible Version: 3.0.0 Rasa SDK Version : 3.0.2 Rasa X Version : None Python Version : 3.8.8 Operating System : macOS-10.14.6-x86\_64-i386-64bit

I am running rasa as:

> rasa run -m models --enable-api --cors “\*”

And using Flask for the web.

I had tried changing port and I get: rasa-chat:2 GET [http://localhost:5005/socket.io/?EIO=4&transport=polling&t=NtyrcHo](http://localhost:5005/socket.io/?EIO=4&transport=polling&t=NtyrcHo) 500 (Internal Server Error)

And on the rasa console I now get:

> 2021-12-27 14:04:19 INFO root - Starting Rasa server on [http://0.0.0.0:5005](http://0.0.0.0:5005) 2021-12-27 14:04:23 INFO rasa.core.processor - Loading model models/20211225-183322-fundamental-skate.tar.gz… 2021-12-27 14:04:41 WARNING rasa.shared.utils.common - The UnexpecTED Intent Policy is currently experimental and might change or be removed in the future 🔬 Please share your feedback on it in the forum ([http://forum.rasa.com](http://forum.rasa.com)) to help us make this feature ready for production. 2021-12-27 14:04:49 INFO root - Rasa server is up and running. The WebSocket transport is not available, you must install a WebSocket server that is compatible with your async mode to enable it. See the documentation for details. (further occurrences of this error will be logged with level INFO) [2021-12-27 14:04:50 -0300] [48212] [ERROR] Exception occurred while handling uri: ‘[http://localhost:5005/socket.io/?EIO=4&transport=polling&t=NtysXFC](http://localhost:5005/socket.io/?EIO=4&transport=polling&t=NtysXFC)’ Traceback (most recent call last): File “handle\_request”, line 83, in handle\_request class Sanic(BaseSanic, metaclass=TouchUpMeta): File “/Users/rafa/opt/anaconda3/envs/installingrasa/lib/python3.8/site-packages/engineio/asyncio\_server.py”, line 308, in handle\_request return await self.\_make\_response(r, environ) File “/Users/rafa/opt/anaconda3/envs/installingrasa/lib/python3.8/site-packages/engineio/asyncio\_server.py”, line 376, in \_make\_response response = make\_response( File “/Users/rafa/opt/anaconda3/envs/installingrasa/lib/python3.8/site-packages/engineio/async\_drivers/sanic.py”, line 102, in make\_response return HTTPResponse(body=payload, content\_type=content\_type, TypeError: ‘NoneType’ object is not callable [2021-12-27 14:04:55 -0300] [48212] [ERROR] Exception occurred while handling uri: ‘[http://localhost:5005/socket.io/?EIO=4&transport=polling&t=NtysYcD](http://localhost:5005/socket.io/?EIO=4&transport=polling&t=NtysYcD)’ Traceback (most recent call last): File “handle\_request”, line 83, in handle\_request class Sanic(BaseSanic, metaclass=TouchUpMeta): File “/Users/rafa/opt/anaconda3/envs/installingrasa/lib/python3.8/site-packages/engineio/asyncio\_server.py”, line 308, in handle\_request return await self.\_make\_response(r, environ) File “/Users/rafa/opt/anaconda3/envs/installingrasa/lib/python3.8/site-packages/engineio/asyncio\_server.py”, line 376, in \_make\_response response = make\_response( File “/Users/rafa/opt/anaconda3/envs/installingrasa/lib/python3.8/site-packages/engineio/async\_drivers/sanic.py”, line 102, in make\_response return HTTPResponse(body=payload, content\_type=content\_type, TypeError: ‘NoneType’ object is not callable [2021-12-27 14:05:01 -0300] [48212] [ERROR] Exception occurred while handling uri: ‘[http://localhost:5005/socket.io/?EIO=4&transport=polling&t=Ntysa2L](http://localhost:5005/socket.io/?EIO=4&transport=polling&t=Ntysa2L)’ Traceback (most recent call last): File “handle\_request”, line 83, in handle\_request class Sanic(BaseSanic, metaclass=TouchUpMeta): File “/Users/rafa/opt/anaconda3/envs/installingrasa/lib/python3.8/site-packages/engineio/asyncio\_server.py”, line 308, in handle\_request return await self.\_make\_response(r, environ) File “/Users/rafa/opt/anaconda3/envs/installingrasa/lib/python3.8/site-packages/engineio/asyncio\_server.py”, line 376, in \_make\_response response = make\_response( File “/Users/rafa/opt/anaconda3/envs/installingrasa/lib/python3.8/site-packages/engineio/async\_drivers/sanic.py”, line 102, in make\_response return HTTPResponse(body=payload, content\_type=content\_type, TypeError: ‘NoneType’ object is not callable

---

<div class="post-metadata">

**Author:** ![rafa21](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/rafa21/32/18713_2.png) [@rafa21](https://forum.rasa.com/u/rafa21)\
**Post date:** [December 27, 2021, 5:17pm UTC](https://forum.rasa.com/t/official-rasa-chat-widget-socket-io-connection-refused/50281/4 "2021-12-27T17:17:34Z")

</div>

@nik202 I wonder if the problem is my flask code:

```auto
from flask import Flask, render_template, request, jsonify
import os,sys,requests, json
from random import randint
app = Flask( __name__ )
@app.route('/')
def home():
  return render_template('index.html')

@app.route('/parse',methods=['POST', 'GET'] )
def extract():
  text=str(request.form.get('value1'))
  payload = json.dumps({"sender": "Rasa","message": text})
  headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
  response = requests.request("POST", url="http://localhost:5005/webhooks/rest/webhook", headers=headers, data=payload)
  response=response.json()
  resp=[]
  for i in range(len(response)):
    try:
      resp.append(response[i]['text'])
    except:
      continue
  result=resp
  return render_template('index.html', result=result,text=text)
if __name__ == " __main__":
  app.run(debug=True)

```

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [December 27, 2021, 9:46pm UTC](https://forum.rasa.com/t/official-rasa-chat-widget-socket-io-connection-refused/50281/5 "2021-12-27T21:46:23Z")

</div>

@rafa21 No this is not related to flask this is much related to socketIO and Sanic version issue.

Can you please see this thread [Rasa 3.0 error socket.io - #13 by nik202](http://forum.rasa.com/t/rasa-3-0-error-socket-io/50061/13) and try update the versions for the mention packages, please take care of all the dependencies issue (red color) some can be rasa-sdk and some can be sanic.

@rafa21 If you still face some issue please let me know please.

**Trick Suggested to check your code:**

If you think that you have some issue with flask, you can create the new rasa environment and try install rasa and rasa-sdk to 2.8.1 respectively and then try run the rasa and flask. You will get the clear result. [_please don’t perform this suggestion in current working environment for that please follow the above mention thread and suggestion_] Thanks.

I wish this will solve your issue as earliest.

---

<div class="post-metadata">

**Author:** ![rafa21](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/rafa21/32/18713_2.png) [@rafa21](https://forum.rasa.com/u/rafa21)\
**Post date:** [December 27, 2021, 11:47pm UTC](https://forum.rasa.com/t/official-rasa-chat-widget-socket-io-connection-refused/50281/6 "2021-12-27T23:47:27Z")

</div>

Dear @nik202I tried following your instructions and update all the list according to requirements, but according to pi some are incompatible. I added it in your other thread:

> [@Rasa 3.0 error socket.io](http://forum.rasa.com/t/rasa-3-0-error-socket-io/50061/28):
>
> Hi @nik202 The versions you list seem to be incompatible according to pip: rasa 3.0.2 requires sanic-routing\<0.8.0,\>=0.7.2, but you have sanic-routing 0.7.0 which is incompatible. sanic 21.6.0 requires sanic-routing==0.7.0, but you have sanic-routing 0.7.2 which is incompatible. When I run pip install sanic==21.6.0 Sanic-Cors==1.0.0 sanic-jwt==1.7.0 sanic-plugin-toolkit==1.2.0 Sanic-Plugins-Framework==0.9.5 sanic-routing==0.7.0 I get ERROR: Cannot install sanic-cors==1.0.0, sanic-plugin-t…

I tried doing

```auto
pip uninstall rasa
pip install rasa==3.0.2

```

but I stll get

```auto
 Rafaels-MacBook-Air:sample-web-wa rafa$ rasa --version
Rasa Version : 3.0.3
Minimum Compatible Version: 3.0.0
Rasa SDK Version : 3.0.2
Rasa X Version : None
Python Version : 3.8.8

```

---

<div class="post-metadata">

**Author:** ![rafa21](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/rafa21/32/18713_2.png) [@rafa21](https://forum.rasa.com/u/rafa21)\
**Post date:** [December 28, 2021, 2:00am UTC](https://forum.rasa.com/t/official-rasa-chat-widget-socket-io-connection-refused/50281/7 "2021-12-28T02:00:32Z")

</div>

Hi @nik202I uninstalled all the packages and installed them with the depraceted option so it does not check versions and it worked

thank you! rafa

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [December 28, 2021, 3:04pm UTC](https://forum.rasa.com/t/official-rasa-chat-widget-socket-io-connection-refused/50281/8 "2021-12-28T15:04:46Z")

</div>

@rafa21 Great Rafal 👍 Can you share the rasa current version and all related packages with version for the other readers.

Please can you update the topic category to rasa open source from Getting started with rasa.

Thanks. Nik

---

<div class="post-metadata">

**Author:** ![rafa21](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/rafa21/32/18713_2.png) [@rafa21](https://forum.rasa.com/u/rafa21)\
**Post date:** [December 28, 2021, 4:26pm UTC](https://forum.rasa.com/t/official-rasa-chat-widget-socket-io-connection-refused/50281/9 "2021-12-28T16:26:16Z")

</div>

Hi @nik202

Thanks for your help To go down the Rasa version I had to uninstall the one I had, and all the sanic libraries, then reinstall with the --use-deprecated=legacy-resolver option

Now that it works, I am now using:

```auto
Rasa Version : 3.0.2
Minimum Compatible Version: 3.0.0
Rasa SDK Version : 3.0.2
Rasa X Version : None
Python Version : 3.8.8

```

```auto
sanic 21.6.0
Sanic-Cors 1.0.0
sanic-jwt 1.7.0
sanic-plugin-toolkit 1.2.0
Sanic-Plugins-Framework 0.9.5
sanic-routing 0.7.0

```

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [December 28, 2021, 4:27pm UTC](https://forum.rasa.com/t/official-rasa-chat-widget-socket-io-connection-refused/50281/10 "2021-12-28T16:27:44Z")

</div>

@rafa21 Thanks for the feedback. I request you to please close this thread as a solution for others and for your reference and good luck!
