Rasa train gives "NameError: Cannot access action 'action_facility_search', as that name is not a registered action for this domain" error

I’m new to rasa and following rasa masterclass: Developing contextual AI assistance with Rasa tools. I’m in episode 6 and getting below error when building the model. I have followed exact same steps as mentioned in the tutorial. Below is the full stack-trace of rasa train command

2020-03-14 19:46:41.170935: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libnvinfer.so.6'; dlerror: libnvinfer.so.6: cannot open shared object file: No such file or directory
2020-03-14 19:46:41.170995: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libnvinfer_plugin.so.6'; dlerror: libnvinfer_plugin.so.6: cannot open shared object file: No such file or directory
2020-03-14 19:46:41.171003: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:30] Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.
/rasa-env/env/lib/python3.6/site-packages/rasa/core/training/dsl.py:422: UserWarning: Found unknown intent 'thanks' on line 7. Please, make sure that all intents are listed in your domain yaml.
  docs=DOCS_URL_DOMAINS,
/rasa-env/env/lib/python3.6/site-packages/rasa/core/training/dsl.py:422: UserWarning: Found unknown intent 'thanks' on line 18. Please, make sure that all intents are listed in your domain yaml.
  docs=DOCS_URL_DOMAINS,
2020-03-14 19:46:41 INFO     rasa.model  - Data (domain) for Core model section changed.
2020-03-14 19:46:41 INFO     rasa.model  - Data (messages) for NLU model section changed.
2020-03-14 19:46:41 INFO     rasa.model  - Data (nlg) for NLG templates section changed.
Training Core model...
/rasa-env/env/lib/python3.6/site-packages/rasa/core/training/dsl.py:422: UserWarning: Found unknown intent 'thanks' on line 7. Please, make sure that all intents are listed in your domain yaml.
  docs=DOCS_URL_DOMAINS,
/rasa-env/env/lib/python3.6/site-packages/rasa/core/training/dsl.py:422: UserWarning: Found unknown intent 'thanks' on line 18. Please, make sure that all intents are listed in your domain yaml.
  docs=DOCS_URL_DOMAINS,
Processed Story Blocks: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:00<00:00, 3520.40it/s, # trackers=1]
Processed Story Blocks: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:00<00:00, 932.54it/s, # trackers=7]
Processed Story Blocks: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:00<00:00, 204.93it/s, # trackers=30]
Processed Story Blocks: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:00<00:00, 236.69it/s, # trackers=22]
Processed trackers: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:00<00:00, 4617.10it/s, # actions=28]
Processed actions: 0it [00:00, ?it/s, # examples=18]Traceback (most recent call last):
  File "/rasa-env/env/lib/python3.6/site-packages/rasa/core/domain.py", line 537, in index_for_action
    return self.action_names.index(action_name)
ValueError: 'action_facility_search' is not in list

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/rasa-env/env/bin/rasa", line 8, in <module>
    sys.exit(main())
  File "/rasa-env/env/lib/python3.6/site-packages/rasa/__main__.py", line 91, in main
    cmdline_arguments.func(cmdline_arguments)
  File "/rasa-env/env/lib/python3.6/site-packages/rasa/cli/train.py", line 76, in train
    additional_arguments=extract_additional_arguments(args),
  File "/rasa-env/env/lib/python3.6/site-packages/rasa/train.py", line 50, in train
    additional_arguments=additional_arguments,
  File "uvloop/loop.pyx", line 1456, in uvloop.loop.Loop.run_until_complete
  File "/rasa-env/env/lib/python3.6/site-packages/rasa/train.py", line 101, in train_async
    additional_arguments,
  File "/rasa-env/env/lib/python3.6/site-packages/rasa/train.py", line 188, in _train_async_internal
    additional_arguments=additional_arguments,
  File "/rasa-env/env/lib/python3.6/site-packages/rasa/train.py", line 223, in _do_training
    additional_arguments=additional_arguments,
  File "/rasa-env/env/lib/python3.6/site-packages/rasa/train.py", line 361, in _train_core_with_validated_data
    additional_arguments=additional_arguments,
  File "/rasa-env/env/lib/python3.6/site-packages/rasa/core/train.py", line 66, in train
    agent.train(training_data, **additional_arguments)
  File "/rasa-env/env/lib/python3.6/site-packages/rasa/core/agent.py", line 707, in train
    self.policy_ensemble.train(training_trackers, self.domain, **kwargs)
  File "/rasa-env/env/lib/python3.6/site-packages/rasa/core/policies/ensemble.py", line 124, in train
    policy.train(training_trackers, domain, **kwargs)
  File "/rasa-env/env/lib/python3.6/site-packages/rasa/core/policies/memoization.py", line 163, in train
    self._add_states_to_lookup(trackers_as_states, trackers_as_actions, domain)
  File "/rasa-env/env/lib/python3.6/site-packages/rasa/core/policies/memoization.py", line 110, in _add_states_to_lookup
    feature_item = domain.index_for_action(action)
  File "/rasa-env/env/lib/python3.6/site-packages/rasa/core/domain.py", line 539, in index_for_action
    self._raise_action_not_found_exception(action_name)
  File "/rasa-env/env/lib/python3.6/site-packages/rasa/core/domain.py", line 544, in _raise_action_not_found_exception
    f"Cannot access action '{action_name}', "
NameError: Cannot access action 'action_facility_search', as that name is not a registered action for this domain. Available actions are: 
	 - action_listen
	 - action_restart
	 - action_session_start
	 - action_default_fallback
	 - action_deactivate_form
	 - action_revert_fallback_events
	 - action_default_ask_affirmation
	 - action_default_ask_rephrase
	 - action_back
	 - utter_ask_location
	 - utter_cheer_up
	 - utter_did_that_help
	 - utter_goodbye
	 - utter_greet
	 - utter_happy
	 - utter_how_can_i_help
	 - utter_iamabot

rasa version : 1.8.1

I have attached actions.py, domain.yml and config.yml files. I tried to see other similar threads but could not resolve the issue. Please let me know what I’m missing or doing wrong.

domain.yml (1.2 KB) actions.py (943 Bytes) config.yml (313 Bytes)

Can someone please help me on this. I’m still stuck and can’t move forward.

Hi, you have a story containing action_facility_search in your stories.md file but without an implementation in actions.py either add an implementation under the name action_facility_search in actions.py or delete the story containing it in stories.md

@Mohamed Thanks for the reply. The action is already implemented in actions.py.

def name(self) -> Text:
        return "action_facility_search"

You need to rename action_facility_search to facility_search in your actions section of your domain.yml, actions with prefix actions_ are Rasa default action overrides, which is why I think you are having issues. If that doesn’t resolve your issue, let me know.

Before training try this

rasa data validate

@niveK Thanks for the reply. I renamed action_facility_search to facility_search in domian.yml. Still same error.

@wabi Thanks for the reply. Ran rasa data validate, ran sucessfully, outputs below logs.

2020-03-20 09:05:45.923415: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libnvinfer.so.6'; dlerror: libnvinfer.so.6: cannot open shared object file: No such file or directory
2020-03-20 09:05:45.923674: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libnvinfer_plugin.so.6'; dlerror: libnvinfer_plugin.so.6: cannot open shared object file: No such file or directory
2020-03-20 09:05:45.923716: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:30] Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.
2020-03-20 09:05:47 INFO     rasa.validator  - Validating intents...
2020-03-20 09:05:47 INFO     rasa.validator  - Validating uniqueness of intents and stories...
2020-03-20 09:05:47 INFO     rasa.validator  - Validating utterances...
2020-03-20 09:05:47 INFO     rasa.validator  - Story structure validation...
Processed Story Blocks: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:00<00:00, 589.36it/s, # trackers=1]
2020-03-20 09:05:47 INFO     rasa.core.training.story_conflict  - Considering the preceding 10 turns for conflict analysis.
2020-03-20 09:05:47 WARNING  rasa.validator  - Story structure conflict after intent 'greet':
  utter_how_can_i_help predicted in 'search hospital + location' and 'search hospital happy path'
  utter_greet predicted in 'sad path 1', 'sad path 2', and 'happy path'

Can you share your domain.yml file

@wabi it’s already attached with the question. Attaching the entire project, if it helps.

sample-chatboat.zip (7.6 KB)

@vindeolal in your domain.yml you made a mistake you have actions: instead of action:

i will you my file

actions:

  • utter_greet
  • utter_cheer_up
  • utter_did_that_help
  • utter_happy
  • utter_how_can_i_help
  • utter_ask_location
  • action_facility_search
  • utter_goodbye

I will attach my file domain.yml (1.2 KB)

@wabi What a silly mistake!!. Thanks a lot for your time and pointing it out.

Your are welcome

I’m facing error, anyone please help me to find out

NameError: Cannot access action ‘None’, as that name is not a registered action for this domain.

Microsoft Windows [Version 10.0.18362.1016] © 2019 Microsoft Corporation. All rights reserved.

(pythonProject12) C:\Users\Sathish\PycharmProjects\pythonProject12>rasa train 2020-09-05 00:06:26 INFO rasa.model - Data (domain) for Core model section chan ged. 2020-09-05 00:06:26 INFO rasa.model - Data (nlg) for NLG templates section chan ged. Training Core model… Processed Story Blocks: 100%|████████| 4/4 [00:00<00:00, 4010.81it/s, # trackers=1] Processed Story Blocks: 100%|████████| 4/4 [00:00<00:00, 2003.49it/s, # trackers=4] Processed Story Blocks: 100%|████████| 4/4 [00:00<00:00, 668.47it/s, # trackers=12] Processed Story Blocks: 100%|████████| 4/4 [00:00<00:00, 334.57it/s, # trackers=23] Processed trackers: 100%|████████████| 4/4 [00:00<00:00, 1336.94it/s, # actions=13] Processed actions: 7it [00:00, 7018.92it/s, # examples=7] Traceback (most recent call last): File “c:\users\sathish\anaconda3\envs\pythonproject12\lib\site-packages\rasa\core
domain.py”, line 546, in index_for_action return self.action_names.index(action_name) ValueError: None is not in list

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File “c:\users\sathish\anaconda3\envs\pythonproject12\lib\runpy.py”, line 193, in run_module_as_main “main”, mod_spec) File “c:\users\sathish\anaconda3\envs\pythonproject12\lib\runpy.py”, line 85, in _ run_code exec(code, run_globals) File "C:\Users\Sathish\anaconda3\envs\pythonProject12\Scripts\rasa.exe_main.py ", line 7, in File “c:\users\sathish\anaconda3\envs\pythonproject12\lib\site-packages\rasa_mai n_.py”, line 92, in main cmdline_arguments.func(cmdline_arguments) File “c:\users\sathish\anaconda3\envs\pythonproject12\lib\site-packages\rasa\cli\t rain.py”, line 76, in train additional_arguments=extract_additional_arguments(args), File “c:\users\sathish\anaconda3\envs\pythonproject12\lib\site-packages\rasa\train .py”, line 50, in train additional_arguments=additional_arguments, File “c:\users\sathish\anaconda3\envs\pythonproject12\lib\asyncio\base_events.py”, line 587, in run_until_complete return future.result() File “c:\users\sathish\anaconda3\envs\pythonproject12\lib\site-packages\rasa\train .py”, line 101, in train_async additional_arguments, File “c:\users\sathish\anaconda3\envs\pythonproject12\lib\site-packages\rasa\train .py”, line 188, in _train_async_internal additional_arguments=additional_arguments, File “c:\users\sathish\anaconda3\envs\pythonproject12\lib\site-packages\rasa\train .py”, line 223, in _do_training additional_arguments=additional_arguments, File “c:\users\sathish\anaconda3\envs\pythonproject12\lib\site-packages\rasa\train .py”, line 361, in _train_core_with_validated_data additional_arguments=additional_arguments, File “c:\users\sathish\anaconda3\envs\pythonproject12\lib\site-packages\rasa\core
train.py”, line 66, in train agent.train(training_data, **additional_arguments) File “c:\users\sathish\anaconda3\envs\pythonproject12\lib\site-packages\rasa\core
agent.py”, line 742, in train self.policy_ensemble.train(training_trackers, self.domain, **kwargs) File “c:\users\sathish\anaconda3\envs\pythonproject12\lib\site-packages\rasa\core
policies\ensemble.py”, line 124, in train policy.train(training_trackers, domain, **kwargs) File “c:\users\sathish\anaconda3\envs\pythonproject12\lib\site-packages\rasa\core
policies\memoization.py”, line 163, in train self._add_states_to_lookup(trackers_as_states, trackers_as_actions, domain) File “c:\users\sathish\anaconda3\envs\pythonproject12\lib\site-packages\rasa\core
policies\memoization.py”, line 110, in _add_states_to_lookup feature_item = domain.index_for_action(action) File “c:\users\sathish\anaconda3\envs\pythonproject12\lib\site-packages\rasa\core
domain.py”, line 548, in index_for_action self._raise_action_not_found_exception(action_name) File “c:\users\sathish\anaconda3\envs\pythonproject12\lib\site-packages\rasa\core
domain.py”, line 553, in _raise_action_not_found_exception f"Cannot access action ‘{action_name}’, " NameError: Cannot access action ‘None’, as that name is not a registered action for this domain. Available actions are: - action_listen - action_restart - action_session_start - action_default_fallback - action_deactivate_form - action_revert_fallback_events - action_default_ask_affirmation - action_default_ask_rephrase - action_back - utter_ask_email - utter_ask_name - utter_ask_number - utter_goodbye - utter_greet - Form_Info

Hi all, I am new to Rasa, if fact I have not done any programming for many years! I am playing with Rasa to test the capabilities so I am changing my model constantly. I have encountered a similar issue: I created an action: utter_wont_give_name and a few days later when playing with my stories I changed the action name to utter_no_name. I changed this everywhere in the domain.yml and stories.yml files. I then retrained the model “Rasa train” and got the error: utter_wont_give_name cannot be found in domain. I double checked this action is not defined or used anywhere in either of the files above. I then added the action: utter_wont_give_name back into the domain file but did not reference it anywhere in the stories and the training completed. I then used interactive training and at some points in the stories it suggested utter_wont_give_name even though this is never used in stories.yml. I changed the interactive suggestions to utter_no_name in all occurances and saved the model. When I now run the model using shell I see it always now calls the new action utter_no_name. When I then removed utter_wont_give_name from the domian.yml file and retain the model “rasa train” I get the same utter_wont_give_name cannot be found in domain. Clearly, when training the model there are other data files used when creating stories, not just nlu, domain, stories and rules.yml. btw, I did check the rules file and it wasn’t there either. Can you enlighten me on the training process and what data files are used as obviously utter_wont_give_name is somewhere in the model and I can’t get rid of it. I have also had the same issue when I changed the name of a custom action. I want some way of flushing all references to unused actions.