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

When adding first user message Rasa is incorrectly pushing two action_listen events to tracker #5068

Closed
tdzienniak opened this issue Jan 14, 2020 · 12 comments
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

@tdzienniak
Copy link
Contributor

Rasa version:
1.6.1
Rasa SDK version (if used & relevant):

Rasa X version (if used & relevant):

Python version:
3.6.9
Operating system (windows, osx, ...):
Ubuntu 19.10
Issue:
When adding first user message Rasa is incorrectly pushing two action_listen event to tracker, which results in predicting ActionDefaultFallback instead of proper action defined in conversation. Error occurs when using tracker store different than InMemoryTrackerStore.

Full tracker of that conversation:

{
    "_id" : ObjectId("5e1d829fc0f0571179a05a68"),
    "sender_id" : "internal_6ded90eb-1713-4cc0-bb94-e44f10906aa9",
    "active_form" : {},
    "events" : [ 
        {
            "event" : "action",
            "timestamp" : 1578992287.49245,
            "name" : "action_session_start",
            "policy" : null,
            "confidence" : null
        }, 
        {
            "event" : "session_started",
            "timestamp" : 1578992287.49247
        }, 
        {
            "event" : "action",
            "timestamp" : 1578992287.49251,
            "name" : "action_listen",
            "policy" : null,
            "confidence" : null
        }, 
        {
            "event" : "action",
            "timestamp" : 1578992287.49251,
            "name" : "action_listen",
            "policy" : null,
            "confidence" : null
        }, 
        {
            "event" : "user",
            "timestamp" : 1578992287.49483,
            "text" : "hej",
            "parse_data" : {
                "intent" : {
                    "name" : "greet",
                    "confidence" : 0.9904693961
                },
                "intent_ranking" : [ 
                    {
                        "name" : "greet",
                        "confidence" : 0.9904693961
                    }, 
                    {
                        "name" : "wypowiedzenie_polisy",
                        "confidence" : 0.0028299373
                    }, 
                    {
                        "name" : "lista",
                        "confidence" : 0.0022578358
                    }, 
                    {
                        "name" : "your_name",
                        "confidence" : 0.0019035154
                    }, 
                    {
                        "name" : "intencja_8",
                        "confidence" : 0.0013759891
                    }, 
                    {
                        "name" : "inform",
                        "confidence" : 0.0004938081
                    }, 
                    {
                        "name" : "goodbye",
                        "confidence" : 0.0004290111
                    }, 
                    {
                        "name" : "stop",
                        "confidence" : 0.000240524
                    }
                ],
                "entities" : [],
                "text" : "hej",
                "disablesBot" : false,
                "originalText" : "hej",
                "intentId" : "5d131175239ef4004bae057f"
            },
            "input_channel" : null,
            "message_id" : "e78661e26cc9411f823dbd02d1421caf",
            "metadata" : {}
        }, 
        {
            "event" : "action",
            "timestamp" : 1578992287.79463,
            "name" : "action_default_fallback",
            "policy" : "policy_2_FallbackPolicy",
            "confidence" : 0.3
        }, 
        {
            "event" : "bot",
            "timestamp" : 1578992287.79464,
            "metadata" : {
                "attachments" : []
            },
            "text" : null,
            "data" : {
                "elements" : [],
                "quick_replies" : null,
                "buttons" : null,
                "attachment" : null,
                "image" : null,
                "custom" : null
            }
        }, 
        {
            "event" : "rewind",
            "timestamp" : 1578992287.79464
        }
    ],
    "followup_action" : null,
    "latest_action_name" : "action_listen",
    "latest_event_time" : 1578992287.79464,
    "latest_input_channel" : null,
    "latest_message" : {
        "intent" : {},
        "entities" : [],
        "text" : null,
        "message_id" : null,
        "metadata" : {}
    },
    "paused" : false,
    "slots" : {
        "form_state" : null,
        "imie" : null,
        "nazwisko" : null,
        "requested_slot" : null,
        "system" : null,
        "zonaty" : null
    }
}
@tdzienniak tdzienniak added the type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. label Jan 14, 2020
@tdzienniak tdzienniak changed the title When adding first user message Rasa is incorrectly pushing two action_listen event to tracker When adding first user message Rasa is incorrectly pushing two action_listen events to tracker Jan 14, 2020
@tdzienniak
Copy link
Contributor Author

There is also another bug connected with this one, that Rasa is falling into infinite loop of ActionDefaultFallback predictions. In Rasa code there is safety limit of action execution and predictions, but in our bot we are manualy calling endpoints for adding message, predicting action and executing predicted action and we have to implement check, that ActionDefaultFallback is not predicted two or more times in a row.

@sara-tagger
Copy link
Collaborator

Thanks for the issue, @tabergma will get back to you about it soon!

You may find help in the docs and the forum, too 🤗

@tabergma
Copy link
Contributor

@tdzienniak Thanks for raising this issue. Did you used rasa shell or did you use the Rasa API for submitting the first user message?

@tdzienniak
Copy link
Contributor Author

@tabergma I used Rasa API.

@tabergma
Copy link
Contributor

@tdzienniak I have some trouble reproducing your error. Can you tell me the exact steps you did?

I started rasa with rasa run -m models --endpoints endpoints.yml --enable-api and configured an SQL tracker store in the endpoints.yml file. After the server started I sent a message to the server via http://localhost:5005/conversations/default/messages. The respond looked fine.

@tmbo tmbo added area:rasa-oss 🎡 Anything related to the open source Rasa framework status:more-details-needed Waiting for the user to provide more details / stacktraces / answer a question labels Feb 5, 2020
@tdzienniak
Copy link
Contributor Author

@tabergma hi, I have more details about this bug. It is also present in Rasa 1.7.0. I have created repository that can be used to reproduce this bug: https://github.com/tdzienniak/rasa-bug-with-mongo-tracker-store .

@no-response no-response bot removed the status:more-details-needed Waiting for the user to provide more details / stacktraces / answer a question label Feb 10, 2020
@federicotdn
Copy link
Contributor

I was able to reproduce this, on master commit 4211b92:

Screenshot 2020-02-17 at 17 09 20

To reproduce:

  • rasa init --no-prompt
  • Modify endpoints.yml
  • rasa shell
  • Talk to the bot
  • Inspect the conversation tracker in tracker.db

My endpoints.yml file:

tracker_store:
  type: sql
  dialect: sqlite
  db: tracker.db

@federicotdn
Copy link
Contributor

cc @ricwo this is what I mentioned in the rasa export PR

@BI4O
Copy link

BI4O commented Feb 21, 2020

@tdzienniak so the default trackerstores(InMemory) resulted in this bug? which tracker stores is better to avoid this bug?

@wochinge
Copy link
Contributor

wochinge commented Mar 2, 2020

fixed with Rasa Open Source 1.7.4

@indam23
Copy link
Contributor

indam23 commented Mar 17, 2021

@wochinge This also happens in 2.3.4 when setting retrieve_events_from_previous_conversation_sessions: true for Mongo/SQLTrackerStore. Should I open a new issue for it?

@wochinge
Copy link
Contributor

please!

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
Development

No branches or pull requests

8 participants