Socket.io disconnecting on Ngrok & local

The rasa webchat integration was working fine from the past 18 days. Now after restarting the server, the socket.io started disconnecting on the ngrok server and local too.

rasa run -m models --enable-api --cors “*” --debug

Error on local server

2020-05-28 13:20:28 DEBUG    rasa.core.channels.socketio  - User 20b6ae2f4224424fbbce1648252fc68c connected to socketIO endpoint.
2020-05-28 13:20:29 DEBUG    rasa.core.channels.socketio  - User 20b6ae2f4224424fbbce1648252fc68c disconnected from socketIO endpoint.

Error with Ngrok

websockets.exceptions.ConnectionClosed: WebSocket connection is closed: code = 1005 (no status code [internal]), no reason

Hey @anuragchaudhary, would you mind sharing your credentials.yml file? (Omitting any sensitive data, of course).

What happens if you restart the ngrok server?

the contents of credentials.yml are as follows

rest:

socketio:
  user_message_evt: user_uttered
  bot_message_evt: bot_uttered
  session_persistence: true

I couldn’t see any problem with ngrok server

HTTP Requests                                                                                                                           
-------------                                                                                                                           
                                                                                                                                        
POST /socket.io/               200 OK                                                                                                   
POST /socket.io/               200 OK                                                                                                   
GET  /socket.io/               101 Switching Protocols                                                                                  
GET  /socket.io/               200 OK                                                                                                   
POST /socket.io/               200 OK                                                                                                   
GET  /socket.io/               200 OK     

detailed error msg

2020-06-03 18:38:26 DEBUG    rasa.core.channels.socketio  - User 3ab421154fbe44fc8bd225bf500fee7e connected to socketIO endpoint.
2020-06-03 18:38:27 DEBUG    rasa.core.channels.socketio  - User 3ab421154fbe44fc8bd225bf500fee7e connected to socketIO endpoint.
2020-06-03 18:38:27 DEBUG    rasa.core.channels.socketio  - User 3ab421154fbe44fc8bd225bf500fee7e disconnected from socketIO endpoint.
[2020-06-03 18:38:28 +0530] [6019] [ERROR] Exception occurred while handling uri: 'ws://093b6272bdb9.ngrok.io/socket.io/?EIO=3&transport=websocket&sid=3ab421154fbe44fc8bd225bf500fee7e'
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/sanic/app.py", line 942, in handle_request
    response = await response
  File "/usr/local/lib/python3.7/site-packages/engineio/asyncio_server.py", line 241, in handle_request
    packets = await socket.handle_get_request(environ)
  File "/usr/local/lib/python3.7/site-packages/engineio/asyncio_socket.py", line 89, in handle_get_request
    return await getattr(self, '_upgrade_' + transport)(environ)
  File "/usr/local/lib/python3.7/site-packages/engineio/asyncio_socket.py", line 128, in _upgrade_websocket
    return await ws(environ)
  File "/usr/local/lib/python3.7/site-packages/engineio/async_drivers/sanic.py", line 122, in __call__
    await self.handler(self)
  File "/usr/local/lib/python3.7/site-packages/engineio/asyncio_socket.py", line 152, in _websocket_handler
    pkt = await ws.wait()
  File "/usr/local/lib/python3.7/site-packages/engineio/async_drivers/sanic.py", line 131, in wait
    data = await self._sock.recv()
  File "/usr/local/lib/python3.7/site-packages/websockets/protocol.py", line 434, in recv
    yield from self.ensure_open()
  File "/usr/local/lib/python3.7/site-packages/websockets/protocol.py", line 658, in ensure_open
    ) from self.transfer_data_exc
websockets.exceptions.ConnectionClosed: WebSocket connection is closed: code = 1005 (no status code [internal]), no reason

error logs while using the localhost

2020-06-03 18:48:05 DEBUG    rasa.core.channels.socketio  - User ff98dd5ffd214df2859e3862402851be connected to socketIO endpoint.
2020-06-03 18:48:06 DEBUG    rasa.core.channels.socketio  - User ff98dd5ffd214df2859e3862402851be connected to socketIO endpoint.
2020-06-03 18:48:06 DEBUG    rasa.core.channels.socketio  - User ff98dd5ffd214df2859e3862402851be disconnected from socketIO endpoint.
2020-06-03 18:48:11 DEBUG    rasa.core.channels.socketio  - User b4e29ab8ce7444178a21bd63bdf4f015 connected to socketIO endpoint.
2020-06-03 18:48:11 DEBUG    rasa.core.channels.socketio  - User b4e29ab8ce7444178a21bd63bdf4f015 connected to socketIO endpoint.
2020-06-03 18:48:11 DEBUG    rasa.core.channels.socketio  - User b4e29ab8ce7444178a21bd63bdf4f015 disconnected from socketIO endpoint.

Any update on this issue? @anuragchaudhary . If so please guide.