rasa icon indicating copy to clipboard operation
rasa copied to clipboard

ConversationError when calling trigger intent

Open Yassine-Boutakbout opened this issue 1 year ago • 1 comments

Rasa Open Source version

3.1.0

Rasa SDK version

3.1.2

Python version

3.8

What operating system are you using?

Linux

What happened?

When trying to send a notification by calling the trigger intent the rasa server throws a ConversationError, error message "An unexpected error occurred. Error: 'entity'".

The weird thing is that this works fine when i train the model only on this action (with EXTERNALl prefix), but when i add the other actions, forms, rules, and stories the error occurred again.

This used to work fine for me on the rasa 1.9.6, but after the migration to the version 3.1.0, it does not anymore.

Command / Request

POST : http://localhost:5005/conversations/1948f732-f7b0-49b6-8a16-da1868ce07b5/trigger_intent
request body :
{
    "name": "EXTERNAL_send_notification",
    "entities": [
        {
            "subscription": {
                "type": "delivery_note",
                "event": "packed",
                "delivery_id": "123456789"
            },
            "sender_id": "1948f732-f7b0-49b6-8a16-da1868ce07b5"
        }
    ]
}

Response code : 500

response body :
{
    "version": "3.1.0",
    "status": "failure",
    "message": "An unexpected error occurred. Error: 'entity'",
    "reason": "ConversationError",
    "details": {},
    "help": null,
    "code": 500
}

Relevant log output

2022-08-05 13:56:55 DEBUG    rasa.server  - Traceback (most recent call last):
2022-08-05T13:56:55.812405900Z   File "/usr/local/lib/python3.8/site-packages/rasa/server.py", line 941, in trigger_intent
2022-08-05T13:56:55.812414500Z     await app.ctx.agent.trigger_intent(
2022-08-05T13:56:55.812418900Z   File "/usr/local/lib/python3.8/site-packages/rasa/core/agent.py", line 475, in trigger_intent
2022-08-05T13:56:55.812422800Z     await self.processor.trigger_external_user_uttered(  # type: ignore[union-attr]
2022-08-05T13:56:55.812426200Z   File "/usr/local/lib/python3.8/site-packages/rasa/core/processor.py", line 563, in trigger_external_user_uttered
2022-08-05T13:56:55.812429900Z     tracker = await self.run_action_extract_slots(output_channel, tracker)
2022-08-05T13:56:55.812432900Z   File "/usr/local/lib/python3.8/site-packages/rasa/core/processor.py", line 172, in run_action_extract_slots
2022-08-05T13:56:55.812436400Z     extraction_events = await action_extract_slots.run(
2022-08-05T13:56:55.812439700Z   File "/usr/local/lib/python3.8/site-packages/rasa/core/actions/action.py", line 1218, in run
2022-08-05T13:56:55.812443600Z     value = extract_slot_value_from_predefined_mapping(
2022-08-05T13:56:55.812447700Z   File "/usr/local/lib/python3.8/site-packages/rasa/core/actions/action.py", line 1262, in extract_slot_value_from_predefined_mapping
2022-08-05T13:56:55.812451700Z     and SlotMapping.entity_is_desired(mapping, tracker)
2022-08-05T13:56:55.812455200Z   File "/usr/local/lib/python3.8/site-packages/rasa/shared/core/slot_mappings.py", line 158, in entity_is_desired
2022-08-05T13:56:55.812458900Z     mapping.get(ENTITY_ATTRIBUTE_TYPE) == entity[ENTITY_ATTRIBUTE_TYPE]
2022-08-05T13:56:55.812462300Z KeyError: 'entity'
2022-08-05T13:56:55.812466300Z 
2022-08-05T13:56:55.812469900Z 2022-08-05 13:56:55 ERROR    rasa.server  - An unexpected error occurred. Error: 'entity'

Yassine-Boutakbout avatar Aug 05 '22 14:08 Yassine-Boutakbout

@Yassine-Boutakbout Could you please share a link to a public repo containing your bot example files or a simplified version to be able to reproduce and debug accordingly?

Note also that the sender_id key, value pair should not be part of the request body, and should be present only as a path parameter in the url.

ancalita avatar Sep 05 '22 14:09 ancalita

➤ Maxime Verger commented:

:bulb: Heads up! We're moving issues to Jira: https://rasa-open-source.atlassian.net/browse/OSS.

From now on, this Jira board is the place where you can browse (without an account) and create issues (you'll need a free Jira account for that). This GitHub issue has already been migrated to Jira and will be closed on January 9th, 2023. Do not forget to subscribe to the corresponding Jira issue!

:arrow_right: More information in the forum: https://forum.rasa.com/t/migration-of-rasa-oss-issues-to-jira/56569.

sync-by-unito[bot] avatar Dec 16 '22 10:12 sync-by-unito[bot]