# Rasa\_core.processor - Failed to execute custom action

**URL:** <https://forum.rasa.com/t/rasa-core-processor-failed-to-execute-custom-action/20026>\
**Category:** Rasa Open Source\
**Created:** [October 18, 2019, 12:28pm UTC](https://forum.rasa.com/t/rasa-core-processor-failed-to-execute-custom-action/20026 "2019-10-18T12:28:22Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kkbrat9](https://avatars.discourse-cdn.com/v4/letter/k/d07c76/32.png) [@kkbrat9](https://forum.rasa.com/u/kkbrat9)\
**Post date:** [October 18, 2019, 12:28pm UTC](https://forum.rasa.com/t/rasa-core-processor-failed-to-execute-custom-action/20026/1 "2019-10-18T12:28:22Z")

</div>

```auto
Rasa Versions:
rasa-core-sdk~=0.12.2
rasa_core~=0.13.2
rasa_nlu~=0.14.4

```

Custom Action file action.py, having following

```auto
import logging
import requests
import json
from rasa_core_sdk import Action

logger = logging.getLogger( __name__ )

class ApiAction(Action):
    def name(self):
        return "action_match_news"

    def run(self, dispatcher, tracker, domain):
        response = """KK Enjoy !!"""
        print(tracker)
        dispatcher.utter_message(response)
        return

```

domain.yaml has following

```auto
actions:
- utter_greet
- utter_did_that_help
- utter_goodbye
- action_match_news
- utter_default
- utter_gratitude
- utter_ask_again

intents:
- goodbye
- greet
- thanks
- affirm
- deny

templates:
  utter_greet:
  - text: "Hey! What can I do for you?"
  utter_did_that_help:
  - text: "Did that help you?"
  - text: "I hope that solved your query"
  utter_goodbye:
  - text: "Bye"
  utter_default:
  - text: "I am sorry, I didn't get that. Could you please repeat your query?"
  - text: "I am not sure what you are aiming for."
  utter_gratitude:
  - text: "Glad that I could be of help to you!\nBye"
  utter_ask_again:
  - text: "Okay! Let's start again, please tell me what do you need?"
  - text: "No issues! Let's try this again.\n Please repeat your query?"

```

stories.md has following

```auto
## news path 1
* greet
  - utter_greet
* current_matches
  - action_match_news
  - utter_did_that_help
* affirm or thanks
  - utter_gratitude
* goodbye
  - utter_goodbye

## news path 2
* current_matches
  - action_match_news
  - utter_did_that_help
* affirm or thanks
  - utter_gratitude
* goodbye
  - utter_goodbye

## news path 3
* greet
  - utter_greet
* current_matches
  - action_match_news
  - utter_did_that_help
* deny
  - utter_ask_again
* current_matches
  - action_match_news
  - utter_did_that_help
* affirm or thanks
  - utter_gratitude
* goodbye
  - utter_goodbye

```

Getting following error

```auto
2019-10-17 18:44:10 DEBUG rasa_core.processor - Predicted next action 'action_match_news' with prob 1.00.
2019-10-17 18:44:10 DEBUG rasa_core.actions.action - Calling action endpoint to run action 'action_match_news'.
2019-10-17 18:44:10 ERROR rasa_core.actions.action - Failed to run custom action 'action_match_news'. Action server responded with a non 200 status code of 404. Make sure your action server properly runs actions and returns a 200 once the action is executed. Error: 404 Client Error: NOT FOUND for url: http://localhost:5055/
2019-10-17 18:44:10 ERROR rasa_core.processor - Encountered an exception while running action 'action_match_news'. Bot will continue, but the actions events are lost. Make sure to fix the exception in your custom code.
2019-10-17 18:44:10 DEBUG rasa_core.processor - Failed to execute custom action.

```

Used example from here

```auto
https://www.analyticsvidhya.com/blog/2019/04/learn-build-chatbot-rasa-nlp-ipl/

```

---

<div class="post-metadata">

**Author:** ![JiteshGaikwad](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@JiteshGaikwad](https://forum.rasa.com/u/JiteshGaikwad)\
**Post date:** [October 18, 2019, 1:44pm UTC](https://forum.rasa.com/t/rasa-core-processor-failed-to-execute-custom-action/20026/2 "2019-10-18T13:44:05Z")

</div>

Hey @kkbrat9, have you ran your custom action server using the below command:

> rasa run actions

---

<div class="post-metadata">

**Author:** ![kkbrat9](https://avatars.discourse-cdn.com/v4/letter/k/d07c76/32.png) [@kkbrat9](https://forum.rasa.com/u/kkbrat9)\
**Post date:** [October 18, 2019, 2:06pm UTC](https://forum.rasa.com/t/rasa-core-processor-failed-to-execute-custom-action/20026/3 "2019-10-18T14:06:43Z")

</div>

@JiteshGaikwad: ran action server using this command

python3 -m rasa\_core\_sdk.endpoint --actions actions

```auto
root@ip-172-31-31-102:~/iplbot/try_version# python3 -m rasa_core_sdk.endpoint --actions actions
2019-10-18 14:07:07 INFO __main__ - Starting action endpoint server...
2019-10-18 14:07:07 INFO rasa_core_sdk.executor - Registered function for 'action_match_news'.
2019-10-18 14:07:07 INFO __main__ - Action endpoint is up and running. on ('0.0.0.0', 5055)

```

---

<div class="post-metadata">

**Author:** ![JiteshGaikwad](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@JiteshGaikwad](https://forum.rasa.com/u/JiteshGaikwad)\
**Post date:** [October 18, 2019, 4:16pm UTC](https://forum.rasa.com/t/rasa-core-processor-failed-to-execute-custom-action/20026/4 "2019-10-18T16:16:24Z")

</div>

I think so the issue exists in your custom actions, just check the error while your run the custom action server

---

<div class="post-metadata">

**Author:** ![kkbrat9](https://avatars.discourse-cdn.com/v4/letter/k/d07c76/32.png) [@kkbrat9](https://forum.rasa.com/u/kkbrat9)\
**Post date:** [October 18, 2019, 9:45pm UTC](https://forum.rasa.com/t/rasa-core-processor-failed-to-execute-custom-action/20026/5 "2019-10-18T21:45:19Z")

</div>

I don’t see anything specific. Am i missing something ?

```auto
root@ip-172-31-31-102:~/iplbot/try_version# python3 -m rasa_core_sdk.endpoint --actions actions
2019-10-18 21:42:35 INFO __main__ - Starting action endpoint server...
2019-10-18 21:42:35 INFO rasa_core_sdk.executor - Registered function for 'action_match_news'.
2019-10-18 21:42:35 INFO __main__ - Action endpoint is up and running. on ('0.0.0.0', 5055)

```

---

<div class="post-metadata">

**Author:** ![kkbrat9](https://avatars.discourse-cdn.com/v4/letter/k/d07c76/32.png) [@kkbrat9](https://forum.rasa.com/u/kkbrat9)\
**Post date:** [October 21, 2019, 1:17pm UTC](https://forum.rasa.com/t/rasa-core-processor-failed-to-execute-custom-action/20026/6 "2019-10-21T13:17:56Z")

</div>

@JiteshGaikwad Any suggestion to move forward ?

I tried example as here [Actions](https://rasa.com/docs/rasa/core/actions/#actions)

1. So, endpoints.yaml has following

```auto
action_endpoint:
  url: "http://localhost:5055/webhook"

```

1. Running rasa run actions has following

```auto
rasa run actions
/usr/local/lib/python3.6/dist-packages/h5py/ __init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
2019-10-21 14:17:16 INFO rasa_sdk.endpoint - Starting action endpoint server...
2019-10-21 14:17:16 INFO rasa_sdk.executor - Registered function for 'action_hello_world'.
2019-10-21 14:17:16 INFO rasa_sdk.endpoint - Action endpoint is up and running on http ('0.0.0.0', 5055)

```

1. Now how respond to hello world ?

BTW, modifiied action.py to look as below

```auto
from typing import Any, Text, Dict, List

from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher
#
#
class ActionHelloWorld(Action):
    def name(self) -> Text:
        return "action_hello_world"

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

```

---

<div class="post-metadata">

**Author:** ![kkbrat9](https://avatars.discourse-cdn.com/v4/letter/k/d07c76/32.png) [@kkbrat9](https://forum.rasa.com/u/kkbrat9)\
**Post date:** [October 22, 2019, 12:37pm UTC](https://forum.rasa.com/t/rasa-core-processor-failed-to-execute-custom-action/20026/7 "2019-10-22T12:37:56Z")

</div>

I am able to get thing working. Thanks for the help @JiteshGaikwad

---

<div class="post-metadata">

**Author:** ![pittmanlaw76](https://avatars.discourse-cdn.com/v4/letter/p/90ced4/32.png) [@pittmanlaw76](https://forum.rasa.com/u/pittmanlaw76)\
**Post date:** [November 6, 2019, 9:26pm UTC](https://forum.rasa.com/t/rasa-core-processor-failed-to-execute-custom-action/20026/8 "2019-11-06T21:26:09Z")

</div>

I am having similar issues. Can you post the solution that you followed to get things working?
