# Failed to execute custom action

**URL:** <https://forum.rasa.com/t/failed-to-execute-custom-action/37309>\
**Category:** Rasa Open Source\
**Created:** [November 23, 2020, 5:16pm UTC](https://forum.rasa.com/t/failed-to-execute-custom-action/37309 "2020-11-23T17:16:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![swapniltripathi7](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/swapniltripathi7/32/12004_2.png) [@swapniltripathi7](https://forum.rasa.com/u/swapniltripathi7)\
**Post date:** [November 23, 2020, 5:16pm UTC](https://forum.rasa.com/t/failed-to-execute-custom-action/37309/1 "2020-11-23T17:16:58Z")

</div>

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](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)
```

---

<div class="post-metadata">

**Author:** ![jusce17](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/jusce17/32/10023_2.png) [@jusce17](https://forum.rasa.com/u/jusce17)\
**Post date:** [November 25, 2020, 5:58pm UTC](https://forum.rasa.com/t/failed-to-execute-custom-action/37309/2 "2020-11-25T17:58:56Z")

</div>

when you do `rasa run actions -vv`

do you see `Registered function for action_clean_room_relative` ?

---

<div class="post-metadata">

**Author:** ![swapniltripathi7](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/swapniltripathi7/32/12004_2.png) [@swapniltripathi7](https://forum.rasa.com/u/swapniltripathi7)\
**Post date:** [November 25, 2020, 7:29pm UTC](https://forum.rasa.com/t/failed-to-execute-custom-action/37309/3 "2020-11-25T19:29:21Z")

</div>

Yes, I can see.

 ![Screenshot from 2020-11-26 00-58-18](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/4/45581eb136734995d1da76a26cb9308e70447578.png)

---

<div class="post-metadata">

**Author:** ![ashwanis](https://avatars.discourse-cdn.com/v4/letter/a/a9adbd/32.png) [@ashwanis](https://forum.rasa.com/u/ashwanis)\
**Post date:** [February 22, 2021, 1:41am UTC](https://forum.rasa.com/t/failed-to-execute-custom-action/37309/4 "2021-02-22T01:41:17Z")

</div>

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

 ![rasa-error](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/5/50f9033947f3a4d59a5071d3a407038ba63f3f47.jpeg)

---

<div class="post-metadata">

**Author:** ![ngotam1899](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/ngotam1899/32/14991_2.png) [@ngotam1899](https://forum.rasa.com/u/ngotam1899)\
**Post date:** [May 19, 2021, 11:57am UTC](https://forum.rasa.com/t/failed-to-execute-custom-action/37309/5 "2021-05-19T11:57:53Z")

</div>

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
