Failed to execute custom action

Can you please help?

version

Rasa Version : 2.1.0 Rasa SDK Version : 2.1.2 Rasa X Version : None Python Version : 3.6.9

I have run the "rasa run actions"

it is showing…

2020-11-23 20:07:00.304959: E tensorflow/stream_executor/cuda/cuda_driver.cc:314] failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected

2020-11-23 20:07:00 INFO rasa_sdk.endpoint - Starting action endpoint server…

2020-11-23 20:07:00 INFO rasa_sdk.endpoint - Action endpoint is up and running on http://localhost:5055

2020-11-23 20:07:00 DEBUG rasa_sdk.utils - Using the default number of Sanic workers (1).

2020-11-23 20:07:41 DEBUG rasa_sdk.executor - Received request to run ‘action_reset_all_slots’

2020-11-23 20:07:41 ERROR rasa_sdk.endpoint - No registered action found for name ‘action_reset_all_slots’.

In stories, If I call action_clean_room_relative then it will show error…Failed to execute custom action.

2020-11-23 21:05:38 ERROR rasa.core.processor - Encountered an exception while running action ‘action_clean_room_relative’.Bot will continue, but the actions events are lost. Please check the logs of your action server for more information. Traceback (most recent call last): File “/home/swapnil/Downloads/env/lib/python3.6/site-packages/rasa/core/actions/action.py”, line 612, in run json=json_body, method=“post”, timeout=DEFAULT_REQUEST_TIMEOUT File “/home/swapnil/Downloads/env/lib/python3.6/site-packages/rasa/utils/endpoints.py”, line 155, in request response.status, response.reason, await response.content.read() rasa.utils.endpoints.ClientResponseError: 404, Not Found, body=‘b’{“error”:“No registered action found for name ‘action_clean_room_relative’.”,“action_name”:“action_clean_room_relative”}’’

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File “/home/swapnil/Downloads/env/lib/python3.6/site-packages/rasa/core/processor.py”, line 750, in _run_action output_channel, nlg, temporary_tracker, self.domain File “/home/swapnil/Downloads/env/lib/python3.6/site-packages/rasa/core/actions/action.py”, line 635, in run raise RasaException(“Failed to execute custom action.”) from e rasa.shared.exceptions.RasaException: Failed to execute custom action.

domain.yml

actions:

-action_clean_room_relative

actions.py file

class ActionCleanRoomRelative(Action):

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

def run(self, dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:

	number = tracker.get_slot("number")

	number1 = current_time.hour
	message = ""
	number1 = (number1+t)%24
	if number1>=13:
		message = "Sure, I have scheduled a cleaning for {} pm today.".format(number1-12)
	else:
		message = "Sure, I have scheduled a cleaning for {} am today.".format(number1)

    dispatcher.utter_message(text=message)
1 Like

when you do rasa run actions -vv

do you see Registered function for action_clean_room_relative ?

Yes, I can see.

Hi, I am getting the same error when running the custom code. Same code is working perfectly fine on my business partner laptop but throws error when custom action is called

2021-02-22 01:29:41 ERROR rasa.core.processor - Encountered an exception while running action ‘action_search_restaurants’.Bot will continue, but the actions events are lost. Please check the logs of your action server for more information. Traceback (most recent call last): File “c:\programdata\anaconda3\envs\rasa\lib\site-packages\rasa\core\actions\action.py”, line 671, in run json=json_body, method=“post”, timeout=DEFAULT_REQUEST_TIMEOUT File “c:\programdata\anaconda3\envs\rasa\lib\site-packages\rasa\utils\endpoints.py”, line 155, in request response.status, response.reason, await response.content.read() rasa.utils.endpoints.ClientResponseError: 500, Internal Server Error, body=‘b’\n

Internal Server Error

\n

\n The server encountered an internal error and cannot complete\n your request.\n

\n’’

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File “c:\programdata\anaconda3\envs\rasa\lib\site-packages\rasa\core\processor.py”, line 760, in _run_action output_channel, nlg, temporary_tracker, self.domain File “c:\programdata\anaconda3\envs\rasa\lib\site-packages\rasa\core\actions\action.py”, line 694, in run raise RasaException(“Failed to execute custom action.”) from e rasa.shared.exceptions.RasaException: Failed to execute custom action.

Check attached file

  • Left side command prompt: rasa run actions
  • right side command prompt: rasa shell

Did you fix that Internal Server Error, I’ve got the same error. It’s not really an error, sometimes it works and sometimes it doesn’t. Why it’s so unstable