Encountered an exception while running action 'tender_form'. Bot will continue, but the actions events are lost. Make sure to fix the exception in your custom code

My actions.py file

actions.py (5.5 KB)

Hi @Narayanan,

I’d recommend you to pick a shorter issue title! :slight_smile:

Your problem is, that you are not closing the elif-statement in required_slots. By adding an else-statement:

if((tracker.get_slot("org_name") and tracker.get_slot("year")) and tracker.get_slot("month")):
     return ["org_name","year","month"]
elif(tracker.get_slot("org_name") and tracker.get_slot("year")):
     if tracker.get_slot("month_required") == False:
          return ["org_name","year","month_required"]
     else: 
          return ["org_name","year","month_required","month"]
else:
    return <list>

it should work properly - as far as I have seen.

Still didnt solve my problem…

This problem is with regards to the formbot example in rasaHQ github page. I did the following steps. PFA folder

  1. rasa init --no-prompt
  2. this created certain files
  3. updated the config file with formpolicy
  4. Replaced the data, domain, and action file with that of the formbot, since docker is not available in my system
  5. did not update the endpoints and credentials file…maintained them as they were formed via the first command 5.the data got trained without any errors
  6. But when i run rasa shell and type the statement which produces the intent request_restaurent it gives me the following error:- " Encountered an exception while running action ‘restaurant_form’. Bot will continue, but the actions events are lost. Make sure to fix the exception in your custom code "

actions.py (4.6 KB) config.yml (301 Bytes) credentials.yml (658 Bytes) domain.yml (2.0 KB) endpoints.yml (1.3 KB)

and the data files are nlu.md (8.4 KB) stories.md (4.2 KB) All these are contained within a folder along with the models folder

Could you please run in a separate command:

rasa run actions -vv

and post the output while running the action in your modified version?

2019-06-14 10:25:38 INFO rasa_sdk.endpoint - Starting action endpoint server… 2019-06-14 10:25:38 INFO rasa_sdk.executor - Registered function for ‘restaurant_form’. 2019-06-14 10:25:38 INFO rasa_sdk.endpoint - Action endpoint is up and running. on (‘0.0.0.0’, 5055)