Fail to load webchat bot on webpage using ngrok

Hi,
I am sorry, :expressionless: but I am still having some troubles when trying to make the bot available to colleagues:
So, I do the following steps:

  1. I start the rasa action sever rasa run actions --port 5056
  2. I start rasa rasa run -m models --enable-api --cors β€œ*” --debug
  3. I authentificate ngrok
  4. when rasa is up and running I, then I start ngrok http 5005
  5. I log in to the Wordpress-Website, open the Insert Header and Footer-Plugin and within the html-code I change the socketUrl to whatever ngrok gives me: socketUrl: β€œhttps://xxxx-xxx-xxx.ngrok.io”
  6. save the changes and visit the website

However, usually it does not work immediately, meaning that only I can see the bot, but neither of my colleagues can. So I either restart rasa rasa or ngrok or both several times until then suddeny it works. :woman_shrugging: basically, I just try to restart without a plan… :confused:

Did I miss something here? Do you have an idea where the problem might come from and what I could do about it?

I see the following error in the terminal:

2022-02-28 11:27:09 DEBUG    rasa.core.channels.socketio  - User dCa-QI5Y_wypWq40AAAB connected to socketIO endpoint.
[2022-02-28 11:27:09 +0100] [8140] [ERROR] Exception occurred while handling uri: 'ws://1899-85-16-177-56.ngrok.io/socket.io/?EIO=4&transport=websocket&sid=eO6NznrVqsYUJgfSAAAA'
Traceback (most recent call last):
  File "C:\Users\viowa\anaconda3\envs\lovis\lib\site-packages\sanic\server\protocols\websocket_protocol.py", line 119, in websocket_handshake
    subprotocols = list(subprotocols)
  File "C:\Users\viowa\anaconda3\envs\lovis\lib\typing.py", line 261, in inner
    return func(*args, **kwds)
  File "C:\Users\viowa\anaconda3\envs\lovis\lib\typing.py", line 682, in __getitem__
    params = tuple(_type_check(p, msg) for p in params)
  File "C:\Users\viowa\anaconda3\envs\lovis\lib\typing.py", line 682, in <genexpr>
    params = tuple(_type_check(p, msg) for p in params)
  File "C:\Users\viowa\anaconda3\envs\lovis\lib\typing.py", line 149, in _type_check
    raise TypeError(f"{msg} Got {arg!r:.100}.")
TypeError: Parameters to generic types must be types. Got 0.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "handle_request", line 83, in handle_request
    class Sanic(BaseSanic, metaclass=TouchUpMeta):
  File "C:\Users\viowa\AppData\Roaming\Python\Python38\site-packages\engineio\asyncio_server.py", line 271, in handle_request
    packets = await socket.handle_get_request(environ)
  File "C:\Users\viowa\AppData\Roaming\Python\Python38\site-packages\engineio\asyncio_socket.py", line 89, in handle_get_request
    return await getattr(self, '_upgrade_' + transport)(environ)
  File "C:\Users\viowa\AppData\Roaming\Python\Python38\site-packages\engineio\asyncio_socket.py", line 142, in _upgrade_websocket
    return await ws(environ)
  File "C:\Users\viowa\AppData\Roaming\Python\Python38\site-packages\engineio\async_drivers\sanic.py", line 118, in __call__
    self._sock = await protocol.websocket_handshake(request)
  File "C:\Users\viowa\anaconda3\envs\lovis\lib\site-packages\sanic\server\protocols\websocket_protocol.py", line 132, in websocket_handshake
    raise ServerError(msg, status_code=500)
sanic.exceptions.ServerError: Failed to open a WebSocket connection.
See server log for more information.

2022-02-28 11:27:10 DEBUG    rasa.core.lock_store  - Issuing ticket for conversation 'dCa-QI5Y_wypWq40AAAB'.
2022-02-28 11:27:10 DEBUG    rasa.core.lock_store  - Acquiring lock for conversation 'dCa-QI5Y_wypWq40AAAB'.
2022-02-28 11:27:10 DEBUG    rasa.core.lock_store  - Acquired lock for conversation 'dCa-QI5Y_wypWq40AAAB'.
2022-02-28 11:27:10 DEBUG    rasa.core.tracker_store  - Can't retrieve tracker matching sender id 'dCa-QI5Y_wypWq40AAAB' from SQL storage. Returning `None` instead.
2022-02-28 11:27:10 DEBUG    rasa.core.tracker_store  - Can't retrieve tracker matching sender id 'dCa-QI5Y_wypWq40AAAB' from SQL storage. Returning `None` instead.

When it finally is up and running, then it works like a charm… for days and days :slightly_smiling_face:

Thanks for helping me out over and over again, :blush: ciao