Socket IO doesn't respond

Using Rasa 1.10.8 and angular 9 Webhook working fine but when I change it to Socket IO, it emits the message to the Rasa bot but it’s doesn’t send back to the front end

  • credentials.yml :-
 socketio:
  user_message_evt: user_uttered
  bot_message_evt: bot_uttered
  session_persistence: false   
  • rasa run logs :-
2020-07-09 13:34:43,375 [DEBUG]  Recreating tracker for id '5W7ilZ624HeykYGQ'

2020-07-09 13:34:47,037 [DEBUG]  Recreating tracker for id '5W7ilZ624HeykYGQ'

2020-07-09 13:34:47,303 [DEBUG]  Received user message 'hi' with intent '{'name': 'greet', 'confidence': 0.998452365398407}' and entities '[]'

2020-07-09 13:34:47,309 [DEBUG]  Logged UserUtterance - tracker now has 5 events.

2020-07-09 13:34:47,314 [DEBUG]  Current tracker state [None, None, None, None, {'slot_name_0': 1.0}, {'slot_name_0': 1.0, 'intent_greet': 1.0, 'prev_action_greet_user': 1.0}]

2020-07-09 13:34:47,316 [DEBUG]  Launch DeLorean...

2020-07-09 13:34:47,318 [DEBUG]  Current tracker state [None, None, None, None, {'slot_name_0': 1.0}, {'slot_name_0': 1.0, 'intent_greet': 1.0, 'prev_action_greet_user': 1.0}]

2020-07-09 13:34:47,320 [DEBUG]  There is no memorised next action

2020-07-09 13:34:47,321 [DEBUG]  There is no active form

2020-07-09 13:34:47,323 [DEBUG]  There is no mapped action for the predicted intent, 'greet'.

2020-07-09 13:34:47,324 [DEBUG]  Predicted next action using policy_0_TEDPolicy

2020-07-09 13:34:47,325 [DEBUG]  Predicted next action 'action_listen' with confidence 0.91.

2020-07-09 13:34:47,326 [DEBUG]  Action 'action_listen' ended with events '[]'.

2020-07-09 13:34:47,328 [DEBUG]  Deleted lock for conversation '5W7ilZ624HeykYGQ'.

2020-07-09 13:35:41,447 [ERROR]  Exception occurred while handling uri: unknown

NoneType: None

It looks like your bot is predicting action_listen, so you won’t see anything on the front end; can you try it with some message that actually triggers a response?

2020-07-09 13:34:47,323 [DEBUG] There is no mapped action for the predicted intent, ‘greet’.(same logs as HTTP) and it’s working fine with HTTP

The next line says this though. What are you seeing differently with HTTP? is it predicting a different action? What do the logs look like?

Webhook Log:

  • 2020-07-20 13:29:51 DEBUG rasa.core.processor - Received user message ‘hi’ with intent ‘{‘name’: ‘greet’, ‘confidence’: 0.9921329021453857}’ and entities ‘[]’
  • 2020-07-20 13:29:51 DEBUG rasa.core.processor - Logged UserUtterance - tracker now has 4 events.
  • 2020-07-20 13:29:51 DEBUG rasa.core.policies.memoization - Current tracker state [None, {}, {‘intent_greet’: 1.0, ‘prev_action_listen’: 1.0}]
  • 2020-07-20 13:29:51 DEBUG rasa.core.policies.memoization - There is a memorised next action ‘action_greet_user’
  • 2020-07-20 13:29:51 DEBUG rasa.core.policies.form_policy - There is no active form
  • 2020-07-20 13:29:51 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_1_AugmentedMemoizationPolicy
  • 2020-07-20 13:29:51 DEBUG rasa.core.processor - Predicted next action ‘action_greet_user’ with confidence 1.00.
  • 2020-07-20 13:29:51 DEBUG rasa.core.actions.action - Calling action endpoint to run action ‘action_greet_user’.
  • 2020-07-20 13:29:54 DEBUG rasa.core.processor - Action ‘action_greet_user’ ended with events ‘[BotUttered(‘Hi! My name’s AI4Support.’, {“elements”: null, “quick_replies”: null, “buttons”: null, “attachment”: null, “image”: null, “custom”: null}, {}, 1595244594.0053353)]’.
  • 2020-07-20 13:29:54 DEBUG rasa.core.processor - Current slot values:
  •     firstIntent: None
    
  •     name: None
    
  •     product: None
    
  •     requested_slot: None
    
  •     shown_privacy: None
    
  •     version: None
    
  • 2020-07-20 13:29:54 DEBUG rasa.core.policies.memoization - Current tracker state [{}, {‘intent_greet’: 1.0, ‘prev_action_listen’: 1.0}, {‘intent_greet’: 1.0, ‘prev_action_greet_user’: 1.0}]
  • 2020-07-20 13:29:54 DEBUG rasa.core.policies.memoization - There is a memorised next action ‘action_listen’
  • 2020-07-20 13:29:54 DEBUG rasa.core.policies.form_policy - There is no active form
  • 2020-07-20 13:29:54 DEBUG rasa.core.policies.mapping_policy - There is no mapped action for the predicted intent, ‘greet’.
  • 2020-07-20 13:29:54 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_1_AugmentedMemoizationPolicy
  • 2020-07-20 13:29:54 DEBUG rasa.core.processor - Predicted next action ‘action_listen’ with confidence 1.00.
  • 2020-07-20 13:29:54 DEBUG rasa.core.processor - Action ‘action_listen’ ended with events ‘[]’.
  • 2020-07-20 13:29:54 DEBUG rasa.core.lock_store - Deleted lock for conversation ‘dsB75PDxcSLFEgy6zD8ZoZLe1zIAHURJyBLpMG20wibDmfa5EVMxLkKIXk9F0AiGnViFtRdJ4L6’.

Socket Log :

  • 2020-07-20 13:31:47 DEBUG rasa.core.processor - Received user message ‘hi’ with intent ‘{‘name’: ‘greet’, ‘confidence’: 0.9921329021453857}’ and entities ‘[]’
  • 2020-07-20 13:31:47 DEBUG rasa.core.processor - Logged UserUtterance - tracker now has 4 events.
  • 2020-07-20 13:31:47 DEBUG rasa.core.policies.memoization - Current tracker state [None, {}, {‘prev_action_listen’: 1.0, ‘intent_greet’: 1.0}]
  • 2020-07-20 13:31:47 DEBUG rasa.core.policies.memoization - There is a memorised next action ‘action_greet_user’
  • 2020-07-20 13:31:47 DEBUG rasa.core.policies.form_policy - There is no active form
  • 2020-07-20 13:31:47 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_1_AugmentedMemoizationPolicy
  • 2020-07-20 13:31:47 DEBUG rasa.core.processor - Predicted next action ‘action_greet_user’ with confidence 1.00.
  • 2020-07-20 13:31:47 DEBUG rasa.core.actions.action - Calling action endpoint to run action ‘action_greet_user’.
  • 2020-07-20 13:31:49 DEBUG rasa.core.processor - Action ‘action_greet_user’ ended with events ‘[BotUttered(‘Hi! My name’s AI4Support.’, {“elements”: null, “quick_replies”: null, “buttons”: null, “attachment”: null, “image”: null, “custom”: null}, {}, 1595244709.6476202)]’.
  • 2020-07-20 13:31:49 DEBUG rasa.core.processor - Current slot values:
  •     firstIntent: None
    
  •     name: None
    
  •     product: None
    
  •     requested_slot: None
    
  •     shown_privacy: None
    
  •     version: None
    
  • 2020-07-20 13:31:49 DEBUG rasa.core.policies.memoization - Current tracker state [{}, {‘prev_action_listen’: 1.0, ‘intent_greet’: 1.0}, {‘prev_action_greet_user’: 1.0, ‘intent_greet’: 1.0}]
  • 2020-07-20 13:31:49 DEBUG rasa.core.policies.memoization - There is a memorised next action ‘action_listen’
  • 2020-07-20 13:31:49 DEBUG rasa.core.policies.form_policy - There is no active form
  • 2020-07-20 13:31:49 DEBUG rasa.core.policies.mapping_policy - There is no mapped action for the predicted intent, ‘greet’.
  • 2020-07-20 13:31:49 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_1_AugmentedMemoizationPolicy
  • 2020-07-20 13:31:49 DEBUG rasa.core.processor - Predicted next action ‘action_listen’ with confidence 1.00.
  • 2020-07-20 13:31:49 DEBUG rasa.core.processor - Action ‘action_listen’ ended with events ‘[]’.
  • 2020-07-20 13:31:49 DEBUG rasa.core.lock_store - Deleted lock for conversation ‘339a633000ac487ba77eeb0bc2b436aa’.

FYI you can format your logs/code snippets by putting it between triple backticks i.e.

```

< your code goes here >

```

1 Like

Webhook Log:

2020-07-20 13:29:51 DEBUG    rasa.core.processor  - Received user message 'hi' with intent '{'name': 'greet', 'confidence': 0.9921329021453857}' and entities '[]'
2020-07-20 13:29:51 DEBUG    rasa.core.processor  - Logged UserUtterance - tracker now has 4 events.
2020-07-20 13:29:51 DEBUG    rasa.core.policies.memoization  - Current tracker state [None, {}, {'intent_greet': 1.0, 'prev_action_listen': 1.0}]
2020-07-20 13:29:51 DEBUG    rasa.core.policies.memoization  - There is a memorised next action 'action_greet_user'
2020-07-20 13:29:51 DEBUG    rasa.core.policies.form_policy  - There is no active form
2020-07-20 13:29:51 DEBUG    rasa.core.policies.ensemble  - Predicted next action using policy_1_AugmentedMemoizationPolicy
2020-07-20 13:29:51 DEBUG    rasa.core.processor  - Predicted next action 'action_greet_user' with confidence 1.00.
2020-07-20 13:29:51 DEBUG    rasa.core.actions.action  - Calling action endpoint to run action 'action_greet_user'.
2020-07-20 13:29:54 DEBUG    rasa.core.processor  - Action 'action_greet_user' ended with events '[BotUttered('Hi! My name's AI4Support.', {"elements": null, "quick_replies": null, "buttons": null, "attachment": null, "image": null, "custom": null}, {}, 1595244594.0053353)]'.
2020-07-20 13:29:54 DEBUG    rasa.core.processor  - Current slot values:
        firstIntent: None
        name: None
        product: None
        requested_slot: None
        shown_privacy: None
        version: None
2020-07-20 13:29:54 DEBUG    rasa.core.policies.memoization  - Current tracker state [{}, {'intent_greet': 1.0, 'prev_action_listen': 1.0}, {'intent_greet': 1.0, 'prev_action_greet_user': 1.0}]
2020-07-20 13:29:54 DEBUG    rasa.core.policies.memoization  - There is a memorised next action 'action_listen'
2020-07-20 13:29:54 DEBUG    rasa.core.policies.form_policy  - There is no active form
2020-07-20 13:29:54 DEBUG    rasa.core.policies.mapping_policy  - There is no mapped action for the predicted intent, 'greet'.
2020-07-20 13:29:54 DEBUG    rasa.core.policies.ensemble  - Predicted next action using policy_1_AugmentedMemoizationPolicy
2020-07-20 13:29:54 DEBUG    rasa.core.processor  - Predicted next action 'action_listen' with confidence 1.00.
2020-07-20 13:29:54 DEBUG    rasa.core.processor  - Action 'action_listen' ended with events '[]'.
2020-07-20 13:29:54 DEBUG    rasa.core.lock_store  - Deleted lock for conversation 'dsB75PDxcSLFEgy6zD8ZoZLe1zIAHURJyBLpMG20wibDmfa5EVMxLkKIXk9F0AiGnViFtRdJ4L6'.

Socket Log :

2020-07-20 13:31:47 DEBUG    rasa.core.processor  - Received user message 'hi' with intent '{'name': 'greet', 'confidence': 0.9921329021453857}' and entities '[]'
2020-07-20 13:31:47 DEBUG    rasa.core.processor  - Logged UserUtterance - tracker now has 4 events.
2020-07-20 13:31:47 DEBUG    rasa.core.policies.memoization  - Current tracker state [None, {}, {'prev_action_listen': 1.0, 'intent_greet': 1.0}]
2020-07-20 13:31:47 DEBUG    rasa.core.policies.memoization  - There is a memorised next action 'action_greet_user'
2020-07-20 13:31:47 DEBUG    rasa.core.policies.form_policy  - There is no active form
2020-07-20 13:31:47 DEBUG    rasa.core.policies.ensemble  - Predicted next action using policy_1_AugmentedMemoizationPolicy
2020-07-20 13:31:47 DEBUG    rasa.core.processor  - Predicted next action 'action_greet_user' with confidence 1.00.
2020-07-20 13:31:47 DEBUG    rasa.core.actions.action  - Calling action endpoint to run action 'action_greet_user'.
2020-07-20 13:31:49 DEBUG    rasa.core.processor  - Action 'action_greet_user' ended with events '[BotUttered('Hi! My name's AI4Support.', {"elements": null, "quick_replies": null, "buttons": null, "attachment": null, "image": null, "custom": null}, {}, 1595244709.6476202)]'.
2020-07-20 13:31:49 DEBUG    rasa.core.processor  - Current slot values:
        firstIntent: None
        name: None
        product: None
        requested_slot: None
        shown_privacy: None
        version: None
2020-07-20 13:31:49 DEBUG    rasa.core.policies.memoization  - Current tracker state [{}, {'prev_action_listen': 1.0, 'intent_greet': 1.0}, {'prev_action_greet_user': 1.0, 'intent_greet': 1.0}]
2020-07-20 13:31:49 DEBUG    rasa.core.policies.memoization  - There is a memorised next action 'action_listen'
2020-07-20 13:31:49 DEBUG    rasa.core.policies.form_policy  - There is no active form
2020-07-20 13:31:49 DEBUG    rasa.core.policies.mapping_policy  - There is no mapped action for the predicted intent, 'greet'.
2020-07-20 13:31:49 DEBUG    rasa.core.policies.ensemble  - Predicted next action using policy_1_AugmentedMemoizationPolicy
2020-07-20 13:31:49 DEBUG    rasa.core.processor  - Predicted next action 'action_listen' with confidence 1.00.
2020-07-20 13:31:49 DEBUG    rasa.core.processor  - Action 'action_listen' ended with events '[]'.
2020-07-20 13:31:49 DEBUG    rasa.core.lock_store  - Deleted lock for conversation '339a633000ac487ba77eeb0bc2b436aa'.

These lines look different from the original post; I take it the behaviour is still the same? Because the logs from socketio & http now match, so the issues isn’t there

The original post was part of full log, then I post the full logs it’s the same but I don’t know what is the issues or where I tried to change

  session_persistence: false   

and change the format of the message from the front end by handling the session from the front end but the same issues. never respond

What front end are you using with socket io and how did you configure it?

angular 9 using ngx-socket-io package and configuration :

import { SocketIoModule, SocketIoConfig } from 'ngx-socket-io';

const config: SocketIoConfig = { url: 'http://localhost:5500', options: {} };

imports: [
    ...
    SocketIoModule.forRoot(config)
],
  public sendMessage(message: any) {
    this.socket.emit("user_uttered", message);
  }

  public getMessages() {
    return Observable.create(observer => {
      this.socket.on("bot_uttered", (message: any) => {
        observer.next(message);
      });
    });
  }