Socket IO [ERROR] Exception occurred while handling uri: 'ws://localhost:5005/socket.io/?EIO=4&transport=websocket&sid=HKjcsdx8bMAgyrYaAAAC'

Dear all,

I have explained the issue and solutions which I tried. Please let me know if I missed sharing any important information.

pip version:

image

Rasa version:

image

Credentials.yml :

rest:
#  # you don't need to provide anything here - this channel doesn't
#  # require any credentials

socketio:
 user_message_evt: user_uttered
 bot_message_evt: bot_uttered
 session_persistence: false

# This entry is needed if you are using Rasa X. The entry represents credentials
# for the Rasa X "channel", i.e. Talk to your bot and Share with guest testers.
rasa:
  url: "http://localhost:5002/api"

endpoints.yml :

action_endpoint:
 url: "http://localhost:5055/webhook"

Note: I did not make any modifications to the config.yml file. Moreover, I saved the modified files and trained the model again.

After the setup, I used this command to run the rasa server:

rasa run -m models --enable-api --cors "*" --debug

It seems like Rasa connects to the socket io successfully, but it throws some exceptions as follows:

2022-01-26 17:30:01 INFO     root  - Starting Rasa server on http://0.0.0.0:5005
2022-01-26 17:30:01 DEBUG    rasa.core.utils  - Using the default number of Sanic workers (1).
c:\users\user\desktop\test\env\lib\site-packages\rasa\shared\core\slot_mappings.py:213: UserWarning: Slot auto-fill has been removed in 3.0 and replaced with a new explicit mechanism to set slots. Please refer to https://rasa.com/docs/rasa/domain#slots to learn more.
  rasa.shared.utils.io.raise_warning(
2022-01-26 17:30:01 DEBUG    urllib3.connectionpool  - Starting new HTTPS connection (1): api.segment.io:443
2022-01-26 17:30:02 DEBUG    urllib3.connectionpool  - https://api.segment.io:443 "POST /v1/track HTTP/1.1" 200 21
2022-01-26 17:30:02 DEBUG    rasa.core.tracker_store  - Connected to InMemoryTrackerStore.
2022-01-26 17:30:02 DEBUG    rasa.core.lock_store  - Connected to lock store 'InMemoryLockStore'.
2022-01-26 17:30:02 DEBUG    rasa.core.nlg.generator  - Instantiated NLG to 'TemplatedNaturalLanguageGenerator'.
2022-01-26 17:30:02 INFO     rasa.core.processor  - Loading model models\20220126-172739-unsolvable-texture.tar.gz...
2022-01-26 17:30:03 DEBUG    rasa.engine.storage.local_model_storage  - Extracted model to 'C:\Users\user\AppData\Local\Temp\tmpjyipiqn2'.
2022-01-26 17:30:03 DEBUG    rasa.engine.graph  - Node 'nlu_message_converter' loading 'NLUMessageConverter.load' and kwargs: '{}'.
2022-01-26 17:30:03 DEBUG    rasa.engine.graph  - Node 'run_WhitespaceTokenizer0' loading 'WhitespaceTokenizer.load' and kwargs: '{}'.
2022-01-26 17:30:03 DEBUG    rasa.engine.graph  - Node 'run_RegexFeaturizer1' loading 'RegexFeaturizer.load' and kwargs: '{}'.
2022-01-26 17:30:03 DEBUG    rasa.engine.storage.local_model_storage  - Resource 'train_RegexFeaturizer1' was requested for reading.
2022-01-26 17:30:03 DEBUG    rasa.engine.graph  - Node 'run_LexicalSyntacticFeaturizer2' loading 'LexicalSyntacticFeaturizer.load' and kwargs: '{}'.
2022-01-26 17:30:03 DEBUG    rasa.engine.storage.local_model_storage  - Resource 'train_LexicalSyntacticFeaturizer2' was requested for reading.
2022-01-26 17:30:03 DEBUG    rasa.engine.graph  - Node 'run_CountVectorsFeaturizer3' loading 'CountVectorsFeaturizer.load' and kwargs: '{}'.
2022-01-26 17:30:03 DEBUG    rasa.engine.storage.local_model_storage  - Resource 'train_CountVectorsFeaturizer3' was requested for reading.
2022-01-26 17:30:03 DEBUG    rasa.engine.graph  - Node 'run_CountVectorsFeaturizer4' loading 'CountVectorsFeaturizer.load' and kwargs: '{}'.
2022-01-26 17:30:03 DEBUG    rasa.engine.storage.local_model_storage  - Resource 'train_CountVectorsFeaturizer4' was requested for reading.
2022-01-26 17:30:03 DEBUG    rasa.engine.graph  - Node 'run_DIETClassifier5' loading 'DIETClassifier.load' and kwargs: '{}'.
2022-01-26 17:30:03 DEBUG    rasa.engine.storage.local_model_storage  - Resource 'train_DIETClassifier5' was requested for reading.
2022-01-26 17:30:03 DEBUG    rasa.utils.tensorflow.models  - Loading the model from C:\Users\user\AppData\Local\Temp\tmpwbhufgr6\train_DIETClassifier5\DIETClassifier.tf_model with finetune_mode=False...
2022-01-26 17:30:04 DEBUG    rasa.nlu.classifiers.diet_classifier  - You specified 'DIET' to train entities, but no entities are present in the training data. Skipping training of entities.
2022-01-26 17:30:04 DEBUG    rasa.nlu.classifiers.diet_classifier  - Following metrics will be logged during training:
2022-01-26 17:30:04 DEBUG    rasa.nlu.classifiers.diet_classifier  -   t_loss (total loss)
2022-01-26 17:30:04 DEBUG    rasa.nlu.classifiers.diet_classifier  -   i_acc (intent acc)
2022-01-26 17:30:04 DEBUG    rasa.nlu.classifiers.diet_classifier  -   i_loss (intent loss)
2022-01-26 17:30:10 DEBUG    rasa.utils.tensorflow.models  - Finished loading the model.
2022-01-26 17:30:10 DEBUG    rasa.engine.graph  - Node 'run_EntitySynonymMapper6' loading 'EntitySynonymMapper.load' and kwargs: '{}'.
2022-01-26 17:30:10 DEBUG    rasa.engine.storage.local_model_storage  - Resource 'train_EntitySynonymMapper6' was requested for reading.
2022-01-26 17:30:10 DEBUG    rasa.nlu.extractors.entity_synonyms  - Failed to load ABCMeta from model storage. Resource 'train_EntitySynonymMapper6' doesn't exist.
2022-01-26 17:30:10 DEBUG    rasa.engine.graph  - Node 'run_ResponseSelector7' loading 'ResponseSelector.load' and kwargs: '{}'.
2022-01-26 17:30:10 DEBUG    rasa.engine.storage.local_model_storage  - Resource 'train_ResponseSelector7' was requested for reading.
2022-01-26 17:30:10 DEBUG    rasa.nlu.classifiers.diet_classifier  - Failed to load ABCMeta from model storage. Resource 'train_ResponseSelector7' doesn't exist.
2022-01-26 17:30:10 DEBUG    rasa.engine.storage.local_model_storage  - Resource 'train_ResponseSelector7' was requested for reading.
2022-01-26 17:30:10 DEBUG    rasa.nlu.selectors.response_selector  - Failed to load ResponseSelector from model storage. Resource 'train_ResponseSelector7' doesn't exist.
2022-01-26 17:30:10 DEBUG    rasa.engine.graph  - Node 'run_FallbackClassifier8' loading 'FallbackClassifier.load' and kwargs: '{}'.
2022-01-26 17:30:10 DEBUG    rasa.engine.graph  - Node 'run_RegexMessageHandler' loading 'RegexMessageHandler.load' and kwargs: '{}'.
2022-01-26 17:30:10 DEBUG    rasa.engine.graph  - Node 'domain_provider' loading 'DomainProvider.load' and kwargs: '{}'.
2022-01-26 17:30:10 DEBUG    rasa.engine.storage.local_model_storage  - Resource 'domain_provider' was requested for reading.
2022-01-26 17:30:10 DEBUG    rasa.engine.graph  - Node 'run_MemoizationPolicy0' loading 'MemoizationPolicy.load' and kwargs: '{}'.
2022-01-26 17:30:10 DEBUG    rasa.engine.storage.local_model_storage  - Resource 'train_MemoizationPolicy0' was requested for reading.
2022-01-26 17:30:10 DEBUG    rasa.engine.graph  - Node 'run_RulePolicy1' loading 'RulePolicy.load' and kwargs: '{}'.
2022-01-26 17:30:10 DEBUG    rasa.engine.storage.local_model_storage  - Resource 'train_RulePolicy1' was requested for reading.
2022-01-26 17:30:10 DEBUG    rasa.engine.graph  - Node 'run_UnexpecTEDIntentPolicy2' loading 'UnexpecTEDIntentPolicy.load' and kwargs: '{}'.
2022-01-26 17:30:10 DEBUG    rasa.engine.storage.local_model_storage  - Resource 'train_UnexpecTEDIntentPolicy2' was requested for reading.
2022-01-26 17:30:10 DEBUG    rasa.utils.tensorflow.models  - Loading the model from C:\Users\user\AppData\Local\Temp\tmpwbhufgr6\train_UnexpecTEDIntentPolicy2\unexpected_intent_policy.tf_model with finetune_mode=False...
c:\users\user\desktop\test\env\lib\site-packages\tensorflow\python\framework\indexed_slices.py:447: UserWarning: Converting sparse IndexedSlices(IndexedSlices(indices=Tensor("gradients/cond_grad/Identity_1:0", shape=(None,), dtype=int64), values=Tensor("gradients/cond_grad/Identity:0", shape=(None,), dtype=float32), dense_shape=Tensor("gradients/cond_grad/Identity_2:0", shape=(1,), dtype=int32))) to a dense Tensor of unknown shape. This may consume a large amount of memory.
  warnings.warn(
c:\users\user\desktop\test\env\lib\site-packages\tensorflow\python\framework\indexed_slices.py:447: UserWarning: Converting sparse IndexedSlices(IndexedSlices(indices=Tensor("gradients/cond_1_grad/Identity_1:0", shape=(None,), dtype=int64), values=Tensor("gradients/cond_1_grad/Identity:0", shape=(None,), dtype=float32), dense_shape=Tensor("gradients/cond_1_grad/Identity_2:0", shape=(1,), dtype=int32))) to a dense Tensor of unknown shape. This may consume a large amount of memory.
  warnings.warn(
2022-01-26 17:30:16 DEBUG    rasa.utils.tensorflow.models  - Finished loading the model.
2022-01-26 17:30:16 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) to help us make this feature ready for production.
2022-01-26 17:30:16 DEBUG    rasa.engine.graph  - Node 'run_TEDPolicy3' loading 'TEDPolicy.load' and kwargs: '{}'.
2022-01-26 17:30:16 DEBUG    rasa.engine.storage.local_model_storage  - Resource 'train_TEDPolicy3' was requested for reading.
2022-01-26 17:30:16 DEBUG    rasa.utils.tensorflow.models  - Loading the model from C:\Users\user\AppData\Local\Temp\tmpwbhufgr6\train_TEDPolicy3\ted_policy.tf_model with finetune_mode=False...
2022-01-26 17:30:22 DEBUG    rasa.utils.tensorflow.models  - Finished loading the model.
2022-01-26 17:30:22 DEBUG    rasa.engine.graph  - Node 'rule_only_data_provider' loading 'RuleOnlyDataProvider.load' and kwargs: '{}'.
2022-01-26 17:30:22 DEBUG    rasa.engine.storage.local_model_storage  - Resource 'train_RulePolicy1' was requested for reading.
2022-01-26 17:30:22 DEBUG    rasa.engine.graph  - Node 'select_prediction' loading 'DefaultPolicyPredictionEnsemble.load' and kwargs: '{}'.
2022-01-26 17:30:22 INFO     root  - Rasa server is up and running.
2022-01-26 17:30:22 INFO     root  - Enabling coroutine debugging. Loop id 2392439000080.
2022-01-26 17:30:28 DEBUG    rasa.core.channels.socketio  - User kiL0fxjKyqXmw0WMAAAB connected to socketIO endpoint.
[2022-01-26 17:30:28 +0800] [18392] [ERROR] Exception occurred while handling uri: 'ws://localhost:5005/socket.io/?EIO=4&transport=websocket&sid=WgMpO8tMk1fwSdsPAAAA'
Traceback (most recent call last):
  File "c:\users\user\desktop\test\env\lib\site-packages\sanic\server\protocols\websocket_protocol.py", line 119, in websocket_handshake
    subprotocols = list(subprotocols)
  File "C:\Users\user\anaconda3\lib\typing.py", line 261, in inner
    return func(*args, **kwds)
  File "C:\Users\user\anaconda3\lib\typing.py", line 685, in __getitem__
    params = tuple(_type_check(p, msg) for p in params)
  File "C:\Users\user\anaconda3\lib\typing.py", line 685, in <genexpr>
    params = tuple(_type_check(p, msg) for p in params)
  File "C:\Users\user\anaconda3\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\user\desktop\test\env\lib\site-packages\engineio\asyncio_server.py", line 271, in handle_request
    packets = await socket.handle_get_request(environ)
  File "c:\users\user\desktop\test\env\lib\site-packages\engineio\asyncio_socket.py", line 89, in handle_get_request
    return await getattr(self, '_upgrade_' + transport)(environ)
  File "c:\users\user\desktop\test\env\lib\site-packages\engineio\asyncio_socket.py", line 142, in _upgrade_websocket
    return await ws(environ)
  File "c:\users\user\desktop\test\env\lib\site-packages\engineio\async_drivers\sanic.py", line 122, in __call__
    self._sock = await protocol.websocket_handshake(request)
  File "c:\users\user\desktop\test\env\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.

Sanic version:

image

Yes, I used this command to change the Sanic version to see if it solves the problem:

pip install sanic==21.6.0 --use-deprecated=legacy-resolver

This time it partially worked. Rasa can communicate through the connected socket endpoint. Here is the result:

2022-01-26 17:42:47 INFO     root  - Starting Rasa server on http://0.0.0.0:5005
2022-01-26 17:42:47 DEBUG    rasa.core.utils  - Using the default number of Sanic workers (1).
c:\users\user\desktop\test\env\lib\site-packages\rasa\shared\core\slot_mappings.py:213: UserWarning: Slot auto-fill has been removed in 3.0 and replaced with a new explicit mechanism to set slots. Please refer to https://rasa.com/docs/rasa/domain#slots to learn more.
  rasa.shared.utils.io.raise_warning(
2022-01-26 17:42:47 DEBUG    urllib3.connectionpool  - Starting new HTTPS connection (1): api.segment.io:443
2022-01-26 17:42:48 DEBUG    urllib3.connectionpool  - https://api.segment.io:443 "POST /v1/track HTTP/1.1" 200 21
2022-01-26 17:42:48 INFO     root  - Enabling coroutine debugging. Loop id 2467599441776.
2022-01-26 17:42:48 DEBUG    rasa.core.tracker_store  - Connected to InMemoryTrackerStore.
2022-01-26 17:42:48 DEBUG    rasa.core.lock_store  - Connected to lock store 'InMemoryLockStore'.
2022-01-26 17:42:48 DEBUG    rasa.core.nlg.generator  - Instantiated NLG to 'TemplatedNaturalLanguageGenerator'.
2022-01-26 17:42:48 INFO     rasa.core.processor  - Loading model models\20220126-172739-unsolvable-texture.tar.gz...
2022-01-26 17:42:49 DEBUG    rasa.engine.storage.local_model_storage  - Extracted model to 'C:\Users\user\AppData\Local\Temp\tmpyphx8vb8'.
c:\users\user\desktop\test\env\lib\site-packages\rasa\shared\core\slot_mappings.py:213: UserWarning: Slot auto-fill has been removed in 3.0 and replaced with a new explicit mechanism to set slots. Please refer to https://rasa.com/docs/rasa/domain#slots to learn more.
  rasa.shared.utils.io.raise_warning(
2022-01-26 17:42:49 DEBUG    rasa.engine.graph  - Node 'nlu_message_converter' loading 'NLUMessageConverter.load' and kwargs: '{}'.
2022-01-26 17:42:49 DEBUG    rasa.engine.graph  - Node 'run_WhitespaceTokenizer0' loading 'WhitespaceTokenizer.load' and kwargs: '{}'.
2022-01-26 17:42:49 DEBUG    rasa.engine.graph  - Node 'run_RegexFeaturizer1' loading 'RegexFeaturizer.load' and kwargs: '{}'.
2022-01-26 17:42:49 DEBUG    rasa.engine.storage.local_model_storage  - Resource 'train_RegexFeaturizer1' was requested for reading.
2022-01-26 17:42:49 DEBUG    rasa.engine.graph  - Node 'run_LexicalSyntacticFeaturizer2' loading 'LexicalSyntacticFeaturizer.load' and kwargs: '{}'.
2022-01-26 17:42:49 DEBUG    rasa.engine.storage.local_model_storage  - Resource 'train_LexicalSyntacticFeaturizer2' was requested for reading.
2022-01-26 17:42:49 DEBUG    rasa.engine.graph  - Node 'run_CountVectorsFeaturizer3' loading 'CountVectorsFeaturizer.load' and kwargs: '{}'.
2022-01-26 17:42:49 DEBUG    rasa.engine.storage.local_model_storage  - Resource 'train_CountVectorsFeaturizer3' was requested for reading.
2022-01-26 17:42:49 DEBUG    rasa.engine.graph  - Node 'run_CountVectorsFeaturizer4' loading 'CountVectorsFeaturizer.load' and kwargs: '{}'.
2022-01-26 17:42:49 DEBUG    rasa.engine.storage.local_model_storage  - Resource 'train_CountVectorsFeaturizer4' was requested for reading.
2022-01-26 17:42:49 DEBUG    rasa.engine.graph  - Node 'run_DIETClassifier5' loading 'DIETClassifier.load' and kwargs: '{}'.
2022-01-26 17:42:49 DEBUG    rasa.engine.storage.local_model_storage  - Resource 'train_DIETClassifier5' was requested for reading.
2022-01-26 17:42:49 DEBUG    rasa.utils.tensorflow.models  - Loading the model from C:\Users\user\AppData\Local\Temp\tmp9xd727ev\train_DIETClassifier5\DIETClassifier.tf_model with finetune_mode=False...
2022-01-26 17:42:50 DEBUG    rasa.nlu.classifiers.diet_classifier  - You specified 'DIET' to train entities, but no entities are present in the training data. Skipping training of entities.
2022-01-26 17:42:50 DEBUG    rasa.nlu.classifiers.diet_classifier  - Following metrics will be logged during training:
2022-01-26 17:42:50 DEBUG    rasa.nlu.classifiers.diet_classifier  -   t_loss (total loss)
2022-01-26 17:42:50 DEBUG    rasa.nlu.classifiers.diet_classifier  -   i_acc (intent acc)
2022-01-26 17:42:50 DEBUG    rasa.nlu.classifiers.diet_classifier  -   i_loss (intent loss)
2022-01-26 17:42:56 DEBUG    rasa.utils.tensorflow.models  - Finished loading the model.
2022-01-26 17:42:56 DEBUG    rasa.engine.graph  - Node 'run_EntitySynonymMapper6' loading 'EntitySynonymMapper.load' and kwargs: '{}'.
2022-01-26 17:42:56 DEBUG    rasa.engine.storage.local_model_storage  - Resource 'train_EntitySynonymMapper6' was requested for reading.
2022-01-26 17:42:56 DEBUG    rasa.nlu.extractors.entity_synonyms  - Failed to load ABCMeta from model storage. Resource 'train_EntitySynonymMapper6' doesn't exist.
2022-01-26 17:42:56 DEBUG    rasa.engine.graph  - Node 'run_ResponseSelector7' loading 'ResponseSelector.load' and kwargs: '{}'.
2022-01-26 17:42:56 DEBUG    rasa.engine.storage.local_model_storage  - Resource 'train_ResponseSelector7' was requested for reading.
2022-01-26 17:42:56 DEBUG    rasa.nlu.classifiers.diet_classifier  - Failed to load ABCMeta from model storage. Resource 'train_ResponseSelector7' doesn't exist.
2022-01-26 17:42:56 DEBUG    rasa.engine.storage.local_model_storage  - Resource 'train_ResponseSelector7' was requested for reading.
2022-01-26 17:42:56 DEBUG    rasa.nlu.selectors.response_selector  - Failed to load ResponseSelector from model storage. Resource 'train_ResponseSelector7' doesn't exist.
2022-01-26 17:42:56 DEBUG    rasa.engine.graph  - Node 'run_FallbackClassifier8' loading 'FallbackClassifier.load' and kwargs: '{}'.
2022-01-26 17:42:56 DEBUG    rasa.engine.graph  - Node 'run_RegexMessageHandler' loading 'RegexMessageHandler.load' and kwargs: '{}'.
2022-01-26 17:42:56 DEBUG    rasa.engine.graph  - Node 'domain_provider' loading 'DomainProvider.load' and kwargs: '{}'.
2022-01-26 17:42:56 DEBUG    rasa.engine.storage.local_model_storage  - Resource 'domain_provider' was requested for reading.
2022-01-26 17:42:56 DEBUG    rasa.engine.graph  - Node 'run_MemoizationPolicy0' loading 'MemoizationPolicy.load' and kwargs: '{}'.
2022-01-26 17:42:56 DEBUG    rasa.engine.storage.local_model_storage  - Resource 'train_MemoizationPolicy0' was requested for reading.
2022-01-26 17:42:56 DEBUG    rasa.engine.graph  - Node 'run_RulePolicy1' loading 'RulePolicy.load' and kwargs: '{}'.
2022-01-26 17:42:56 DEBUG    rasa.engine.storage.local_model_storage  - Resource 'train_RulePolicy1' was requested for reading.
2022-01-26 17:42:56 DEBUG    rasa.engine.graph  - Node 'run_UnexpecTEDIntentPolicy2' loading 'UnexpecTEDIntentPolicy.load' and kwargs: '{}'.
2022-01-26 17:42:56 DEBUG    rasa.engine.storage.local_model_storage  - Resource 'train_UnexpecTEDIntentPolicy2' was requested for reading.
2022-01-26 17:42:56 DEBUG    rasa.utils.tensorflow.models  - Loading the model from C:\Users\user\AppData\Local\Temp\tmp9xd727ev\train_UnexpecTEDIntentPolicy2\unexpected_intent_policy.tf_model with finetune_mode=False...
c:\users\user\desktop\test\env\lib\site-packages\tensorflow\python\framework\indexed_slices.py:447: UserWarning: Converting sparse IndexedSlices(IndexedSlices(indices=Tensor("gradients/cond_grad/Identity_1:0", shape=(None,), dtype=int64), values=Tensor("gradients/cond_grad/Identity:0", shape=(None,), dtype=float32), dense_shape=Tensor("gradients/cond_grad/Identity_2:0", shape=(1,), dtype=int32))) to a dense Tensor of unknown shape. This may consume a large amount of memory.
  warnings.warn(
c:\users\user\desktop\test\env\lib\site-packages\tensorflow\python\framework\indexed_slices.py:447: UserWarning: Converting sparse IndexedSlices(IndexedSlices(indices=Tensor("gradients/cond_1_grad/Identity_1:0", shape=(None,), dtype=int64), values=Tensor("gradients/cond_1_grad/Identity:0", shape=(None,), dtype=float32), dense_shape=Tensor("gradients/cond_1_grad/Identity_2:0", shape=(1,), dtype=int32))) to a dense Tensor of unknown shape. This may consume a large amount of memory.
  warnings.warn(
2022-01-26 17:43:02 DEBUG    rasa.utils.tensorflow.models  - Finished loading the model.
2022-01-26 17:43:02 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) to help us make this feature ready for production.
2022-01-26 17:43:02 DEBUG    rasa.engine.graph  - Node 'run_TEDPolicy3' loading 'TEDPolicy.load' and kwargs: '{}'.
2022-01-26 17:43:02 DEBUG    rasa.engine.storage.local_model_storage  - Resource 'train_TEDPolicy3' was requested for reading.
2022-01-26 17:43:02 DEBUG    rasa.utils.tensorflow.models  - Loading the model from C:\Users\user\AppData\Local\Temp\tmp9xd727ev\train_TEDPolicy3\ted_policy.tf_model with finetune_mode=False...
2022-01-26 17:43:08 DEBUG    rasa.utils.tensorflow.models  - Finished loading the model.
2022-01-26 17:43:08 DEBUG    rasa.engine.graph  - Node 'rule_only_data_provider' loading 'RuleOnlyDataProvider.load' and kwargs: '{}'.
2022-01-26 17:43:08 DEBUG    rasa.engine.storage.local_model_storage  - Resource 'train_RulePolicy1' was requested for reading.
2022-01-26 17:43:08 DEBUG    rasa.engine.graph  - Node 'select_prediction' loading 'DefaultPolicyPredictionEnsemble.load' and kwargs: '{}'.
2022-01-26 17:43:08 INFO     root  - Rasa server is up and running.
2022-01-26 17:43:19 DEBUG    rasa.core.channels.socketio  - User 8F7-3So9FrPk88nrAAAB connected to socketIO endpoint.

But the moment I refresh the page, it throws some exceptions as follows:

2022-01-26 17:44:44 DEBUG    rasa.core.channels.socketio  - User 8F7-3So9FrPk88nrAAAB disconnected from socketIO endpoint.
[2022-01-26 17:44:44 +0800] [2964] [ERROR] Exception occurred while handling uri: 'ws://localhost:5005/socket.io/?EIO=4&transport=websocket&sid=szFOkeDzpIIzSsHRAAAA'
Traceback (most recent call last):
  File "c:\users\user\desktop\test\env\lib\site-packages\sanic\app.py", line 782, in handle_request
    raise ServerError(
sanic.exceptions.ServerError: Invalid response type None (need HTTPResponse)
[2022-01-26 17:44:44 +0800] [2964] [ERROR] Exception occurred while handling uri: 'ws://localhost:5005/socket.io/?EIO=4&transport=websocket&sid=szFOkeDzpIIzSsHRAAAA'
Traceback (most recent call last):
  File "c:\users\user\desktop\test\env\lib\site-packages\sanic\app.py", line 782, in handle_request
    raise ServerError(
sanic.exceptions.ServerError: Invalid response type None (need HTTPResponse)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\user\desktop\test\env\lib\site-packages\sanic\http.py", line 129, in http1
    await self.protocol.request_handler(self.request)
  File "c:\users\user\desktop\test\env\lib\site-packages\sanic_plugin_toolkit\realm.py", line 566, in _handle_request_21_03
    raise cancelled
  File "c:\users\user\desktop\test\env\lib\site-packages\sanic_plugin_toolkit\realm.py", line 554, in _handle_request_21_03
    _ = await real_handle(request)
  File "c:\users\user\desktop\test\env\lib\site-packages\sanic\app.py", line 791, in handle_request
    await self.handle_exception(request, e)
  File "c:\users\user\desktop\test\env\lib\site-packages\sanic\app.py", line 704, in handle_exception
    await response.send(end_stream=True)
  File "c:\users\user\desktop\test\env\lib\site-packages\sanic\response.py", line 122, in send
    await self.stream.send(data, end_stream=end_stream)
  File "c:\users\user\desktop\test\env\lib\site-packages\sanic\http.py", line 335, in http1_response_header
    await self._send(ret)
  File "c:\users\user\desktop\test\env\lib\site-packages\sanic\server.py", line 268, in send
    raise CancelledError
asyncio.exceptions.CancelledError
2022-01-26 17:44:44 DEBUG    rasa.core.channels.socketio  - User lUqkgEYlmqLsMuH8AAAD connected to socketIO endpoint.

It seems like now the exception is thrown only if the user disconnects from the socket. But I completely want to get rid of any exception even if it connects to the socket io as expected.

Note: Iā€™m trying to connect socket io to my custom chatbot UI (not webchat).

Thank you

EDIT: The same issue was highlighted on GitHub - Socket Channel not working in rasa 3.0.0 #10412.