Encountered an exception while running action

I am getting this error when a conversation reaches an intent.

2019-05-23 10:23:42 ERROR rasa.core.processor - Encountered an exception while running action 'are_you_a_manager'. Bot will continue, but the actions events are lost. Make sure to fix the exception in your custom code.

I have no custom code.(actions file is all commented) The action just outputs a simple question:

%YAML 1.1
- utter_cheer_up
- utter_did_that_help
- utter_goodbye
- utter_greet
- utter_happy
- are_you_a_manager
- u14_guidance_link
- affirm
- deny
- goodbye
- greet
- mood_great
- mood_unhappy
- manage_poor_performance
- image: https://i.imgur.com/nGF1K8f.jpg
  text: 'Here is something to cheer you up:'
- text: Did that help you?
- text: Bye
- text: Hey! How are you?
- text: Great carry on!
- text: Are you a manager?
- text: Here is a link 

I changed nothing between yesterday and today except adding the project to git, yesterday this worked fine.

I removed the two .db files to see if that solves it, it didn’t. I renamed the action and updated my stories, no luck. I created a new project in a separate folder, copied the model archive over, activated it - still no joy.

My story looks like this:

## manage poor performance 1
* manage_poor_performance
  - are_you_a_manager
* deny
  - u14_guidance_link

This is what I get when I test it. u1_you_manager was the original name of my utterance which is now are_you_a_manager

Any ideas where to look next?

Hey @nickopris, the way actions work, if they start with utter_, it looks for utterances – anything else will look for custom action code. You should be able to solve this by making sure all of your utterance actions start with that prefix, e.g. utter_ask_manager or something of the sort. With regards to it not updating, I believe at the moment domain files do not sync, so when you change the utterances names you should rerun rasa x.

1 Like

Thank you. That worked.

I’m facing same issue for a custom action which doesn’t have any issues or exceptions in it… If we run core locally with debug option enable and put some breakpoints any where in core or action code it works as expected but without breakpoints I’m getting this error… Please help me to resolve this…

Show us your actions file, please.

class ActionAskCountry(Action):

def name(self):  # type: () -> Text
    return "action_ask_country"

def run(
    dispatcher,  # type: CollectingDispatcher
    tracker,  # type: Tracker
    domain,  # type:  Dict[Text, Any]
):  # type: (...) -> List[Dict[Text, Any]]
       country = 'united states'
       country = country.capitalize()
       dispatcher.utter_template('utter_ask_purchase_country', tracker, country=country)
       return [SlotSet('country', country), SlotSet('needsFeedback', 'True')]

I’m not great at Python but if you replace run with this code you can test if rasa can see your action properly. The rest is your custom code that you need to fix:

def run(
    dispatcher: CollectingDispatcher,
    tracker: Tracker,
    domain: Dict[Text, Any],
) -> List[Dict[Text, Any]]:
    dispatcher.utter_message("Hello World!")
    return []

rasa is able to see my action while I’m debugging with breakpoints (Action running properly as expected) but without breakpoints getting that error…