Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two action_listen events appended to tracker when retrieve_events_from_previous_conversation_sessions: true for SQL/MongoTrackerStore #8237

Closed
indam23 opened this issue Mar 18, 2021 · 2 comments · Fixed by #8258
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@indam23
Copy link
Contributor

indam23 commented Mar 18, 2021

Rasa version: 2.3.4

Python version: 3.7

Operating system (windows, osx, ...): macOS

Issue:

Similar to #5068, but under a specific circumstance:

When using either the MongoTrackerStore or SQLTrackerStore with retrieve_events_from_previous_conversation_sessions: true, two action_listen events are appended to the tracker after a bot action. It looks like the second action_listen is only appended when the next user message comes in, since the last exchange is followed by only one action_listen.

Error (including full traceback):
Returned tracker after posting three /greet messages to the rest webhook:

{
    "sender_id": "listen2",
    "slots": {
        "session_started_metadata": null
    },
    "latest_message": {
        "intent": {
            "name": "greet",
            "confidence": 1
        },
        "entities": [],
        "text": "/greet",
        "message_id": "eab65fe260744fde90c83367a48cba31",
        "metadata": {},
        "intent_ranking": [
            {
                "name": "greet",
                "confidence": 1
            }
        ]
    },
    "latest_event_time": 1616079025.5186849,
    "followup_action": null,
    "paused": false,
    "events": [
        {
            "event": "action",
            "timestamp": 1616078983.868062,
            "name": "action_session_start",
            "policy": null,
            "confidence": 1,
            "action_text": null
        },
        {
            "event": "session_started",
            "timestamp": 1616078983.8681338
        },
        {
            "event": "action",
            "timestamp": 1616078983.868154,
            "name": "action_listen",
            "policy": null,
            "confidence": null,
            "action_text": null
        },
        {
            "event": "user",
            "timestamp": 1616078983.868726,
            "text": "/greet",
            "parse_data": {
                "intent": {
                    "name": "greet",
                    "confidence": 1
                },
                "entities": [],
                "text": "/greet",
                "message_id": "e788384747a749b0ba5ff7cb557ab1bf",
                "metadata": {},
                "intent_ranking": [
                    {
                        "name": "greet",
                        "confidence": 1
                    }
                ]
            },
            "input_channel": "rest",
            "message_id": "e788384747a749b0ba5ff7cb557ab1bf",
            "metadata": {}
        },
        {
            "event": "user_featurization",
            "timestamp": 1616078983.871351,
            "use_text_for_featurization": false
        },
        {
            "event": "action",
            "timestamp": 1616078983.871364,
            "name": "utter_greet",
            "policy": "policy_0_RulePolicy",
            "confidence": 1,
            "action_text": null
        },
        {
            "event": "bot",
            "timestamp": 1616078983.871459,
            "metadata": {
                "utter_action": "utter_greet"
            },
            "text": "hi",
            "data": {
                "elements": null,
                "quick_replies": null,
                "buttons": null,
                "attachment": null,
                "image": null,
                "custom": null
            }
        },
        {
            "event": "action",
            "timestamp": 1616078983.872324,
            "name": "action_listen",
            "policy": "policy_0_RulePolicy",
            "confidence": 1,
            "action_text": null
        },
        {
            "event": "action",
            "timestamp": 1616078983.872324,
            "name": "action_listen",
            "policy": "policy_0_RulePolicy",
            "confidence": 1,
            "action_text": null
        },
        {
            "event": "user",
            "timestamp": 1616078983.888557,
            "text": "/greet",
            "parse_data": {
                "intent": {
                    "name": "greet",
                    "confidence": 1
                },
                "entities": [],
                "text": "/greet",
                "message_id": "d6d1270a9e544e1dbcbbc7e2e41a2bbd",
                "metadata": {},
                "intent_ranking": [
                    {
                        "name": "greet",
                        "confidence": 1
                    }
                ]
            },
            "input_channel": "rest",
            "message_id": "d6d1270a9e544e1dbcbbc7e2e41a2bbd",
            "metadata": {}
        },
        {
            "event": "user_featurization",
            "timestamp": 1616078983.8902452,
            "use_text_for_featurization": false
        },
        {
            "event": "action",
            "timestamp": 1616078983.8902662,
            "name": "utter_greet",
            "policy": "policy_0_RulePolicy",
            "confidence": 1,
            "action_text": null
        },
        {
            "event": "bot",
            "timestamp": 1616078983.890395,
            "metadata": {
                "utter_action": "utter_greet"
            },
            "text": "hi",
            "data": {
                "elements": null,
                "quick_replies": null,
                "buttons": null,
                "attachment": null,
                "image": null,
                "custom": null
            }
        },
        {
            "event": "action",
            "timestamp": 1616078983.891432,
            "name": "action_listen",
            "policy": "policy_0_RulePolicy",
            "confidence": 1,
            "action_text": null
        },
        {
            "event": "action",
            "timestamp": 1616078983.891432,
            "name": "action_listen",
            "policy": "policy_0_RulePolicy",
            "confidence": 1,
            "action_text": null
        },
        {
            "event": "user",
            "timestamp": 1616079025.496054,
            "text": "/greet",
            "parse_data": {
                "intent": {
                    "name": "greet",
                    "confidence": 1
                },
                "entities": [],
                "text": "/greet",
                "message_id": "a20924bdc85947d2b982344407472a59",
                "metadata": {},
                "intent_ranking": [
                    {
                        "name": "greet",
                        "confidence": 1
                    }
                ]
            },
            "input_channel": "rest",
            "message_id": "a20924bdc85947d2b982344407472a59",
            "metadata": {}
        },
        {
            "event": "user_featurization",
            "timestamp": 1616079025.497736,
            "use_text_for_featurization": false
        },
        {
            "event": "action",
            "timestamp": 1616079025.497748,
            "name": "utter_greet",
            "policy": "policy_0_RulePolicy",
            "confidence": 1,
            "action_text": null
        },
        {
            "event": "bot",
            "timestamp": 1616079025.4978318,
            "metadata": {
                "utter_action": "utter_greet"
            },
            "text": "hi",
            "data": {
                "elements": null,
                "quick_replies": null,
                "buttons": null,
                "attachment": null,
                "image": null,
                "custom": null
            }
        },
        {
            "event": "action",
            "timestamp": 1616079025.49875,
            "name": "action_listen",
            "policy": "policy_0_RulePolicy",
            "confidence": 1,
            "action_text": null
        },
        {
            "event": "action",
            "timestamp": 1616079025.49875,
            "name": "action_listen",
            "policy": "policy_0_RulePolicy",
            "confidence": 1,
            "action_text": null
        },
        {
            "event": "user",
            "timestamp": 1616079025.514944,
            "text": "/greet",
            "parse_data": {
                "intent": {
                    "name": "greet",
                    "confidence": 1
                },
                "entities": [],
                "text": "/greet",
                "message_id": "eab65fe260744fde90c83367a48cba31",
                "metadata": {},
                "intent_ranking": [
                    {
                        "name": "greet",
                        "confidence": 1
                    }
                ]
            },
            "input_channel": "rest",
            "message_id": "eab65fe260744fde90c83367a48cba31",
            "metadata": {}
        },
        {
            "event": "user_featurization",
            "timestamp": 1616079025.517356,
            "use_text_for_featurization": false
        },
        {
            "event": "action",
            "timestamp": 1616079025.517371,
            "name": "utter_greet",
            "policy": "policy_0_RulePolicy",
            "confidence": 1,
            "action_text": null
        },
        {
            "event": "bot",
            "timestamp": 1616079025.5174751,
            "metadata": {
                "utter_action": "utter_greet"
            },
            "text": "hi",
            "data": {
                "elements": null,
                "quick_replies": null,
                "buttons": null,
                "attachment": null,
                "image": null,
                "custom": null
            }
        },
        {
            "event": "action",
            "timestamp": 1616079025.5186849,
            "name": "action_listen",
            "policy": "policy_0_RulePolicy",
            "confidence": 1,
            "action_text": null
        }
    ],
    "latest_input_channel": "rest",
    "active_loop": {},
    "latest_action": {
        "action_name": "action_listen"
    },
    "latest_action_name": "action_listen"
}

Command or request that led to error:

rasa run --enable-api
for i in 1 2 3 4; do    curl --request POST \
    --url http://localhost:5005/webhooks/rest/webhook \
    --header 'Content-Type: application/json' \
    --data '{
        "sender": "listen2",
        "message":"/greet"
    }'
done
 curl 'http://localhost:5005/conversations/listen2/tracker'

Content of configuration file (config.yml) (if relevant):

policies:
  - name: RulePolicy

Content of domain file (domain.yml) (if relevant):

version: "2.0"

intents:
  - greet
  - goodbye

responses:
  utter_greet:
  - text: hi

session_config:
  session_expiration_time: 60
  carry_over_slots_to_new_session: true

Content of rules.yml:

version: "2.0"

rules:

- rule: Say goodbye anytime the user says goodbye
  steps:
  - intent: goodbye
  - action: action_restart

- rule: Say goodbye anytime the user says goodbye
  steps:
  - intent: greet
  - action: utter_greet
@indam23 indam23 added type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. area:rasa-oss 🎡 Anything related to the open source Rasa framework labels Mar 18, 2021
@indam23
Copy link
Contributor Author

indam23 commented Mar 18, 2021

@wochinge

@indam23
Copy link
Contributor Author

indam23 commented Apr 6, 2021

closed by #8258

@indam23 indam23 closed this as completed Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
1 participant