When calling to Azure deployed rasa (https://azure.domain/) we have no Access-Control-Allow-Origin header and the error:
Access to XMLHttpRequest at 'https://azure.domain/socket.io/?EIO=3&transport=polling&t=N2h2Iyj' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
webchat-latest.js:48 GET https://azure.domain/socket.io/?EIO=3&transport=polling&t=N2h2Iyj net::ERR_FAILED
From rasa logs:
2020-03-09T08:37:18.785913706Z 2020-03-09 08:37:18 DEBUG rasa.core.channels.socketio - User db6eb5c90108416b947f73ff77a243fb connected to socketIO endpoint.
2020-03-09T08:37:20.173660981Z 2020-03-09 08:37:20 DEBUG rasa.core.channels.socketio - User 140450853525404ba811e9fd71a5d389 connected to socketIO endpoint.
2020-03-09T08:37:21.573446796Z 2020-03-09 08:37:21 DEBUG rasa.core.channels.socketio - User e3ade34244aa4981b4c1aa4836680a7e connected to socketIO endpoint.
2020-03-09T08:38:31.823532304Z 2020-03-09 08:38:31 DEBUG rasa.core.channels.socketio - User db6eb5c90108416b947f73ff77a243fb disconnected from socketIO endpoint.
2020-03-09T08:38:32.247397831Z 2020-03-09 08:38:32 DEBUG rasa.core.channels.socketio - User 140450853525404ba811e9fd71a5d389 disconnected from socketIO endpoint.
2020-03-09T08:38:32.671065458Z 2020-03-09 08:38:32 DEBUG rasa.core.channels.socketio - User e3ade34244aa4981b4c1aa4836680a7e disconnected from socketIO endpoint.
Im guessing that in order to make it work on Azure we should have Access-Control-Allow-Origin: * when calling rasa on local.
@erohmensing We don’t have the mention of CORS configuration in our logs and a far as I remember we never had one.
Log looks like this:
2020-03-11 13:49:32 DEBUG rasa.cli.utils - Parameter 'endpoints' not set. Using default location 'endpoints.yml' instead.
2020-03-11 13:49:32 DEBUG rasa.cli.utils - Parameter 'credentials' not set. Using default location 'credentials.yml' instead.
2020-03-11 13:49:32 DEBUG rasa.core.utils - Available web server routes:
<routes>
2020-03-11 13:49:32 INFO root - Starting Rasa server on http://localhost:5005
2020-03-11 13:49:32 DEBUG rasa.core.utils - Using the default number of Sanic workers (1).
2020-03-11 13:49:32 INFO root - Enabling coroutine debugging. Loop id 94081157252232.
2020-03-11 13:49:32 DEBUG rasa.model - Extracted model to '/tmp/tmpnteaadq8'.
2020-03-11 13:49:43 INFO rasa.nlu.components - Added 'SpacyNLP' to component cache. Key 'SpacyNLP-fr'.
/build/lib/python3.6/site-packages/rasa/nlu/classifiers/embedding_intent_classifier.py:202: FutureWarning: Intent tokenization has been moved to Tokenizer components. Your config still mentions 'intent_tokenization_flag'. Tokenization may fail if you specify the parameter here. Please specify the parameter 'intent_tokenization_flag' and 'intent_split_symbol' in the tokenizer of your NLU pipeline
self._check_old_config_variables(self.component_config)
/build/lib/python3.6/site-packages/rasa/nlu/classifiers/embedding_intent_classifier.py:202: FutureWarning: Intent tokenization has been moved to Tokenizer components. Your config still mentions 'intent_split_symbol'. Tokenization may fail if you specify the parameter here. Please specify the parameter 'intent_tokenization_flag' and 'intent_split_symbol' in the tokenizer of your NLU pipeline
2020-03-11 13:49:44 DEBUG rasa.core.tracker_store - Connected to InMemoryTrackerStore.
2020-03-11 13:49:44 DEBUG rasa.core.lock_store - Connected to lock store 'InMemoryLockStore'.
2020-03-11 13:49:44 DEBUG rasa.model - Extracted model to '/tmp/tmpy1njd9z1'.
2020-03-11 13:49:44 DEBUG pykwalify.compat - Using yaml library: /build/lib/python3.6/site-packages/ruamel/yaml/__init__.py
2020-03-11 13:49:46 DEBUG rasa.core.nlg.generator - Instantiated NLG to 'TemplatedNaturalLanguageGenerator'.
@wabi We have this part in our credentials.yml file, which is the correct one?
Rasa log with socketio conf in endpoints.yml:
rasa_1 | sanic.exceptions.NotFound: Requested URL /socket.io/ not found
rasa_1 | [2020-03-20 10:58:42 +0000] [1] [ERROR] Exception occurred while handling uri: 'http://localhost:5005/socket.io/?EIO=3&transport=polling&t=N3tc5n-'
FYI we have in our credentials.yml file:
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
rasa:
url: "http://rasa:5005/api"