No response from rasa using socket.io

Hello, I just created a new project with rasa init and trained a model with the sample data. The only changes are in the credentials.yml:

socketio:
      user_message_evt: user_uttered
      bot_message_evt: bot_uttered
      session_persistence: true

rasa run --credentials credentials.yml --cors * output:

~/.local/lib/python3.6/site-packages/rasa/shared/utils/io.py:89: UserWarning: Could not load local model in 'tests'.
2020-10-13 11:14:34 INFO     root  - Rasa server is up and running.
~/.local/lib/python3.6/site-packages/rasa/shared/utils/io.py:89: UserWarning: No policy ensemble or domain set. Skipping action prediction and execution.

rasa run --credentials credentials.yml --cors * --debug output:

2020-10-13 11:23:01 DEBUG    rasa.core.channels.socketio  - User 8d44d8c96da248239ad6913a40a30061 connected to socketIO endpoint.
2020-10-13 11:23:48 DEBUG    rasa.core.lock_store  - Issuing ticket for conversation 'f57d3f4648a04091a4adc630c529eb49'.
2020-10-13 11:23:48 DEBUG    rasa.core.lock_store  - Acquiring lock for conversation 'f57d3f4648a04091a4adc630c529eb49'.
2020-10-13 11:23:48 DEBUG    rasa.core.lock_store  - Acquired lock for conversation 'f57d3f4648a04091a4adc630c529eb49'.
2020-10-13 11:23:48 DEBUG    rasa.core.tracker_store  - Creating a new tracker for id 'f57d3f4648a04091a4adc630c529eb49'.
2020-10-13 11:23:48 DEBUG    rasa.core.processor  - Starting a new session for conversation ID 'f57d3f4648a04091a4adc630c529eb49'.
2020-10-13 11:23:48 DEBUG    rasa.core.processor  - Action 'action_session_start' ended with events '[<rasa.shared.core.events.SessionStarted object at 0x7fb5646e8e80>, <rasa.shared.core.events.ActionExecuted object at 0x7fb5646e8e48>]'.
2020-10-13 11:23:48 DEBUG    rasa.nlu.classifiers.diet_classifier  - There is no trained model for 'ResponseSelector': The component is either not trained or didn't receive enough training data.
2020-10-13 11:23:48 DEBUG    rasa.nlu.selectors.response_selector  - Adding following selector key to message property: default
2020-10-13 11:23:48 DEBUG    rasa.core.processor  - Received user message 'hello' with intent '{'id': -6023219153646213377, 'name': 'greet', 'confidence': 0.9999649524688721}' and entities '[]'
2020-10-13 11:23:48 DEBUG    rasa.core.processor  - Logged UserUtterance - tracker now has 4 events.
2020-10-13 11:23:48 DEBUG    rasa.core.policies.memoization  - Current tracker state [{}, {'user': {'intent': 'greet'}, 'prev_action': {'action_name': 'action_listen'}}]
2020-10-13 11:23:48 DEBUG    rasa.core.policies.memoization  - There is a memorised next action 'utter_greet'
2020-10-13 11:23:48 DEBUG    rasa.core.policies.rule_policy  - Current tracker state: [{}, {'user': {'intent': 'greet'}, 'prev_action': {'action_name': 'action_listen'}}]
2020-10-13 11:23:48 DEBUG    rasa.core.policies.rule_policy  - There is no applicable rule.
2020-10-13 11:23:48 DEBUG    rasa.core.policies.ensemble  - Predicted next action using policy_0_MemoizationPolicy
2020-10-13 11:23:48 DEBUG    rasa.core.processor  - Predicted next action 'utter_greet' with confidence 1.00.
2020-10-13 11:23:48 DEBUG    rasa.core.processor  - Action 'utter_greet' ended with events '[BotUttered('Hey! How are you?', {"elements": null, "quick_replies": null, "buttons": null, "attachment": null, "image": null, "custom": null}, {"template_name": "utter_greet"}, 1602581028.9130025)]'.
2020-10-13 11:23:48 DEBUG    rasa.core.policies.memoization  - Current tracker state [{}, {'user': {'intent': 'greet'}, 'prev_action': {'action_name': 'action_listen'}}, {'user': {'intent': 'greet'}, 'prev_action': {'action_name': 'utter_greet'}}]
2020-10-13 11:23:48 DEBUG    rasa.core.policies.memoization  - There is a memorised next action 'action_listen'
2020-10-13 11:23:48 DEBUG    rasa.core.policies.rule_policy  - Current tracker state: [{}, {'user': {'intent': 'greet'}, 'prev_action': {'action_name': 'action_listen'}}, {'user': {'intent': 'greet'}, 'prev_action': {'action_name': 'utter_greet'}}]
2020-10-13 11:23:48 DEBUG    rasa.core.policies.rule_policy  - There is no applicable rule.
2020-10-13 11:23:48 DEBUG    rasa.core.policies.ensemble  - Predicted next action using policy_0_MemoizationPolicy
2020-10-13 11:23:48 DEBUG    rasa.core.processor  - Predicted next action 'action_listen' with confidence 1.00.
2020-10-13 11:23:48 DEBUG    rasa.core.processor  - Action 'action_listen' ended with events '[]'.
2020-10-13 11:23:48 DEBUG    rasa.core.lock_store  - Deleted lock for conversation 'f57d3f4648a04091a4adc630c529eb49'.

There is no response in my frontend:

this.socket.on('bot_uttered', (data) => {
     console.log(data);
});

Update: I changed the sequence of ‘connect’ event and ‘session_request’. Now I get responses, but only in --debug mode. Without debug it is still the same output.

Are you running the commands in the same folder? It looks like the domain.yml wasn’t found in the first example…

Also, does changing --cors * to --cors “*” change anything?

“Also, does changing --cors * to --cors “*” change anything?”

That helped, thank you. Maybe a hint here would be nice:

--cors [CORS [CORS ...]]
      Enable CORS for the passed origin. Use * to whitelist
      all origins. (default: None)

Good to hear you go it sorted! I think it has to do with how the shell handles strings vs. commands but I’m not 100% certain. (Also not sure it would work for every type of terminal.)

I’m having the exact same issue…and my command is the same as mentioned in the currently marked solution…

rasa run --cors “*” --debug

Output:

> 2021-05-20 18:19:00 INFO     root  - Rasa server is up and running.
> 2021-05-20 18:19:24 DEBUG    rasa.core.channels.socketio  - User wN95KmvR9P24FYPuAAAB connected to socketIO endpoint.
> 2021-05-20 18:19:24 DEBUG    rasa.core.channels.socketio  - User wN95KmvR9P24FYPuAAAB connected to socketIO endpoint.
> 2021-05-20 18:19:52 DEBUG    rasa.core.lock_store  - Issuing ticket for conversation '1'.
> 2021-05-20 18:19:52 DEBUG    rasa.core.lock_store  - Acquiring lock for conversation '1'.
> 2021-05-20 18:19:52 DEBUG    rasa.core.lock_store  - Acquired lock for conversation '1'.
> 2021-05-20 18:19:52 DEBUG    rasa.core.tracker_store  - Could not find tracker for conversation ID '1'.
> 2021-05-20 18:19:52 DEBUG    rasa.core.processor  - Starting a new session for conversation ID '1'.
> 2021-05-20 18:19:52 DEBUG    rasa.core.processor  - Policy prediction ended with events '[]'.
> 2021-05-20 18:19:52 DEBUG    rasa.core.processor  - Action 'action_session_start' ended with events '[<rasa.shared.core.events.SessionStarted object at 0x7f4844c2c190>, ActionExecuted(action: action_listen, policy: None, confidence: None)]'.
> 2021-05-20 18:19:52 DEBUG    rasa.core.processor  - Current slot values: 
>         name: None
>         email_or_phone: None
>         message: None
>         requested_slot: None
>         session_started_metadata: None
> 2021-05-20 18:19:53 DEBUG    rasa.nlu.selectors.response_selector  - Adding following selector key to message property: default
> 2021-05-20 18:19:53 DEBUG    rasa.nlu.selectors.response_selector  - Adding following selector key to message property: faq
> 2021-05-20 18:19:53 DEBUG    rasa.core.processor  - Received user message 'hello' with intent '{'id': 3093762737729351333, 'name': 'greet', 'confidence': 0.9998165965080261}' and entities '[]'
> 2021-05-20 18:19:53 DEBUG    rasa.core.processor  - Logged UserUtterance - tracker now has 4 events.
> 2021-05-20 18:19:53 DEBUG    rasa.core.policies.rule_policy  - Current tracker state:
> [state 1] user text: hello | previous action name: action_listen
> 2021-05-20 18:19:53 DEBUG    rasa.core.policies.rule_policy  - There is no applicable rule.
> 2021-05-20 18:19:53 DEBUG    rasa.core.policies.rule_policy  - Current tracker state:
> [state 1] user intent: greet | previous action name: action_listen
> 2021-05-20 18:19:53 DEBUG    rasa.core.policies.rule_policy  - There is a rule for the next action 'utter_greet'.
> 2021-05-20 18:19:53 DEBUG    rasa.core.policies.ensemble  - Made prediction using user intent.
> 2021-05-20 18:19:53 DEBUG    rasa.core.policies.ensemble  - Added `DefinePrevUserUtteredFeaturization(False)` event.
> 2021-05-20 18:19:53 DEBUG    rasa.core.policies.ensemble  - Predicted next action using policy_0_RulePolicy.
> 2021-05-20 18:19:53 DEBUG    rasa.core.processor  - Predicted next action 'utter_greet' with confidence 1.00.
> 2021-05-20 18:19:53 DEBUG    rasa.core.processor  - Policy prediction ended with events '[<rasa.shared.core.events.DefinePrevUserUtteredFeaturization object at 0x7f4844c2c160>]'.
> 2021-05-20 18:19:53 DEBUG    rasa.core.processor  - Action 'utter_greet' ended with events '[BotUttered('Hello..I'm Wendy, Goutam's assistant. 
>  How can I help you?', {"elements": null, "quick_replies": null, "buttons": [{"title": "Who is Goutam?", "payload": "Who is Goutam?"}, {"title": "Leave a message", "payload": "Leave a message"}], "attachment": null, "image": null, "custom": null}, {"utter_action": "utter_greet"}, 1621514993.1148198)]'.
> 2021-05-20 18:19:53 DEBUG    rasa.core.policies.rule_policy  - Current tracker state:
> [state 1] user intent: greet | previous action name: action_listen
> [state 2] user intent: greet | previous action name: utter_greet
> 2021-05-20 18:19:53 DEBUG    rasa.core.policies.rule_policy  - There is a rule for the next action 'action_listen'.
> 2021-05-20 18:19:53 DEBUG    rasa.core.policies.ensemble  - Predicted next action using policy_0_RulePolicy.
> 2021-05-20 18:19:53 DEBUG    rasa.core.processor  - Predicted next action 'action_listen' with confidence 1.00.
> 2021-05-20 18:19:53 DEBUG    rasa.core.processor  - Policy prediction ended with events '[]'.
> 2021-05-20 18:19:53 DEBUG    rasa.core.processor  - Action 'action_listen' ended with events '[]'.
> 2021-05-20 18:19:53 DEBUG    rasa.core.lock_store  - Deleted lock for conversation '1'.

Javascript code:

socket = io("http://localhost:5005");

socket.on('connect', () => {
    socket.emit("session_request", {
        "session_id": sid
    })
});

socket.on('bot_uttered', (data) => {
    console.log(data);
});

Here’s the network log

UPDATE: I’m able to get response when I’m turning off session persistence but if I turn on session persistence i get this issue