Rasa: API missing tracker return data if first event isn't a post to webhook

Created on 2 Jan 2020  路  4Comments  路  Source: RasaHQ/rasa

Rasa version: 1.6.0

Rasa SDK version (if used & relevant): 1.6.0

Rasa X version (if used & relevant):

Python version: Python 3.6.9 (Anaconda)

Operating system (windows, osx, ...): RHEL 7 (CentOS)

Issue: The tracker API isn't returning all the data if the first event isn't a post to webhook.

Error (including full traceback):

Missing information in return data (see below)


Command or request that led to error:
Clear history from mongoDB:

$ mongo
> use rasa
> db.dropDatabase()
> exit

Started RASA with:

$  rasa run --endpoints endpoints.yml --enable-api --debug

Posted a slot value to tracker, using postman (my sender id is "tester"):

POST to localhost:5005/conversations/tester/tracker/events
Post body: { "event": "slot", "name": "profile", "value": "corretor" }
Headers: { content-type: application/json }
Got a http 200 back with the following body:

{
    "sender_id": "tester",
    "slots": {
        "profile": "corretor",
    },
    "latest_message": {
        "intent": {},
        "entities": [],
        "text": null,
        "message_id": null,
        "metadata": {}
    },
    "latest_event_time": 1577995229.9281511307,
    "followup_action": null,
    "paused": false,
    "events": [
        {
            "event": "action",
            "timestamp": 1577995229.9356689453,
            "name": "action_session_start",
            "policy": null,
            "confidence": null
        },
        {
            "event": "session_started",
            "timestamp": 1577995229.9356927872
        },
        {
            "event": "action",
            "timestamp": 1577995229.9357538223,
            "name": "action_listen",
            "policy": null,
            "confidence": null
        },
        {
            "event": "slot",
            "timestamp": 1577995229.9281511307,
            "name": "profile",
            "value": "corretor"
        }
    ],
    "latest_input_channel": null,
    "active_form": {},
    "latest_action_name": "action_listen"
}

Then I posted a message to the tracker (with postman):

POST to localhost:5005/webhooks/rest/webhook
Post body: { "sender":"tester", "message":"Hi"}
Headers: { content-type: application/json }
Got a http 200 back.

I then called the tracker (with postman)

GET : localhost:5005/conversations/tester/tracker

{
    "sender_id": "tester",
    "slots": {
        "comentario_chamado": null,
        "descricao": null,
        "motivo_cancelamento": null,
        "numero_chamado": null,
        "profile": "corretor",
        "requested_slot": null,
        "titulo_chamado": null,
        "user_name": null
    },
    "latest_message": {
        "intent": {},
        "entities": [],
        "text": null,
        "message_id": null,
        "metadata": {}
    },
    "latest_event_time": 1577995389.7144963741,
    "followup_action": null,
    "paused": false,
    "events": [
        {
            "event": "session_started",
            "timestamp": 1577995229.9356927872
        },
        {
            "event": "action",
            "timestamp": 1577995229.9357538223,
            "name": "action_listen",
            "policy": null,
            "confidence": null
        },
        {
            "event": "slot",
            "timestamp": 1577995229.9281511307,
            "name": "profile",
            "value": "corretor"
        },
        {
            "event": "action",
            "timestamp": 1577995389.7108175755,
            "name": "utter_default",
            "policy": "policy_4_FallbackPolicy",
            "confidence": 0.7
        },
        {
            "event": "bot",
            "timestamp": 1577995389.7108221054,
            "text": "N茫o entendi, poderia reformular a frase?",
            "data": {
                "elements": null,
                "quick_replies": null,
                "buttons": null,
                "attachment": null,
                "image": null,
                "custom": null
            },
            "metadata": {}
        },
        {
            "event": "action",
            "timestamp": 1577995389.7144963741,
            "name": "action_listen",
            "policy": "policy_4_FallbackPolicy",
            "confidence": 1
        }
    ],
    "latest_input_channel": null,
    "active_form": {},
    "latest_action_name": "action_listen"
}

All the latest-message information is missing. Compare this to the following response if I post to webhook first (I dropped the mongo database again before posting this):

{
    "sender_id": "tester",
    "slots": {
        "comentario_chamado": null,
        "descricao": null,
        "motivo_cancelamento": null,
        "numero_chamado": null,
        "profile": null,
        "requested_slot": null,
        "titulo_chamado": null,
        "user_name": null
    },
    "latest_message": {
        "intent": {
            "name": "saudacao",
            "confidence": 0.9568712711
        },
        "entities": [],
        "intent_ranking": [
            {
                "name": "saudacao",
                "confidence": 0.9568712711
            },
            {
                "name": "agradecimento",
                "confidence": 0.0076029999
            },
            {
                "name": "suporte_valor_iptu",
                "confidence": 0.0046949848
            },
            {
                "name": "suporte_reembolso_plano",
                "confidence": 0.0039048197
            },
            {
                "name": "suporte_definicao_imovel_oportunidade",
                "confidence": 0.0034865651
            },
            {
                "name": "tratativa_adicionar_novidade_chamado",
                "confidence": 0.0020944814
            },
            {
                "name": "suporte_como_busco_imovel",
                "confidence": 0.0020385382
            },
            {
                "name": "suporte_definicao_gestor_placa",
                "confidence": 0.0017496475
            },
            {
                "name": "suporte_renovar_anuncio_gratis_vencido",
                "confidence": 0.0016969149
            },
            {
                "name": "suporte_visualiza_pedidos",
                "confidence": 0.0016599172
            }
        ],
        "text": "Oi"
    },
    "latest_event_time": 1577995607.2278442383,
    "followup_action": null,
    "paused": false,
    "events": [
        {
            "event": "session_started",
            "timestamp": 1577995607.2018072605
        },
        {
            "event": "action",
            "timestamp": 1577995607.2018611431,
            "name": "action_listen",
            "policy": null,
            "confidence": null
        },
        {
            "event": "user",
            "timestamp": 1577995607.2158670425,
            "text": "Hi",
            "parse_data": {
                "intent": {
                    "name": "saudacao",
                    "confidence": 0.9568712711
                },
                "entities": [],
                "intent_ranking": [
                    {
                        "name": "saudacao",
                        "confidence": 0.9568712711
                    },
                    {
                        "name": "agradecimento",
                        "confidence": 0.0076029999
                    },
                    {
                        "name": "suporte_valor_iptu",
                        "confidence": 0.0046949848
                    },
                    {
                        "name": "suporte_reembolso_plano",
                        "confidence": 0.0039048197
                    },
                    {
                        "name": "suporte_definicao_imovel_oportunidade",
                        "confidence": 0.0034865651
                    },
                    {
                        "name": "tratativa_adicionar_novidade_chamado",
                        "confidence": 0.0020944814
                    },
                    {
                        "name": "suporte_como_busco_imovel",
                        "confidence": 0.0020385382
                    },
                    {
                        "name": "suporte_definicao_gestor_placa",
                        "confidence": 0.0017496475
                    },
                    {
                        "name": "suporte_renovar_anuncio_gratis_vencido",
                        "confidence": 0.0016969149
                    },
                    {
                        "name": "suporte_visualiza_pedidos",
                        "confidence": 0.0016599172
                    }
                ],
                "text": "Oi"
            },
            "input_channel": "rest",
            "message_id": "039e9bc5961e4522a8a9f79cdf283998",
            "metadata": {}
        },
        {
            "event": "action",
            "timestamp": 1577995607.2246797085,
            "name": "action_saudacao",
            "policy": "policy_1_AugmentedMemoizationPolicy",
            "confidence": 1
        },
        {
            "event": "action",
            "timestamp": 1577995607.2278442383,
            "name": "action_listen",
            "policy": "policy_1_AugmentedMemoizationPolicy",
            "confidence": 1
        }
    ],
    "latest_input_channel": "rest",
    "active_form": {},
    "latest_action_name": "action_listen"
}

This works correctly in Rasa 1.4.6

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


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


area critical type

All 4 comments

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

You may find help in the docs and the forum, too 馃

Hi @samscudder ,

thanks for bringing this up. I can reproduce it with mongo and sqlite (not with the InmemoryTrackerStore though.

@wochinge should we close this issue? The PR for it was merged.

Omh, github should really close this when I do a fix ... comment

Was this page helpful?
0 / 5 - 0 ratings