# No message received from RASA custom action

**URL:** <https://forum.rasa.com/t/no-message-received-from-rasa-custom-action/21728>\
**Category:** Rasa Open Source\
**Created:** [November 26, 2019, 12:32pm UTC](https://forum.rasa.com/t/no-message-received-from-rasa-custom-action/21728 "2019-11-26T12:32:11Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ioans](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/ioans/32/6164_2.png) [@ioans](https://forum.rasa.com/u/ioans)\
**Post date:** [November 26, 2019, 12:32pm UTC](https://forum.rasa.com/t/no-message-received-from-rasa-custom-action/21728/1 "2019-11-26T12:32:11Z")

</div>

Hi!

I’ve been working on a custom bot which connects to Google Assistant, based on this tutorial: [Going beyond hey Google](https://blog.rasa.com/going-beyond-hey-google-building-a-rasa-powered-google-assistant/). I have it up and running on Docker with my own domain data. However, when I tried to implement a custom action server in another container, the server is available, but `dispatcher.utter_message()` doesn’t return the message back to RASA to be forwarded to Google and close the loop.

As shown in the code, I also tried `dispatcher.utter_template("utter_dummy", tracker)` to check if that returns anything, but no luck. I believe the issue is that I’m not starting the action server correctly, as I don’t call ` rasa run actions`, but when I tried to add this command in `docker-compose` I get:

“./entrypoint.sh: line 17: exec: actions: cannot execute: Is a directory”

The `actions` folder contains ` __init__.py` and `actions.py `

- docker-compose:

```auto
version: '3.0'
services:
  opn_bot_ga:
    image: rasa/rasa:latest
    volumes:
      - ./:/app
    ports:
      - 3001:5004
    command:
      # - train
      - run
      - --enable-api
      - -p
      - "5004"
  action_server:
    image: rasa/rasa-sdk:latest
    ports:
      - 5055:5055
    volumes:
      - ./actions:/app/actions

```

- endpoints.yml

```auto
action_endpoint:
  url: 'http://action_server:5055/webhook'

```

- actions.py

```auto
import requests
import json
from rasa_sdk import Action

class ActionTest(Action):
  def name(self):
    # define the name of the action
    return "action_joke"

  def run(self, dispatcher, tracker, domain):
    request = requests.get('http://api.icndb.com/jokes/random').json() # make an api call
    joke = request['value']['joke'] # extract a joke from returned json response
    dispatcher.utter_message(joke)
   # dispatcher.utter_template("utter_dummy", tracker)
    return []

```

---

<div class="post-metadata">

**Author:** ![Tanja](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tanja/32/4696_2.png) [@Tanja](https://forum.rasa.com/u/Tanja)\
**Post date:** [November 26, 2019, 2:46pm UTC](https://forum.rasa.com/t/no-message-received-from-rasa-custom-action/21728/2 "2019-11-26T14:46:12Z")

</div>

What rasa version are you using?

Can you please try to specify your actions file directly? E.g. `rasa run actions --actions actions/actions.py`. Does that help?

---

<div class="post-metadata">

**Author:** ![iicky](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/iicky/32/6061_2.png) [@iicky](https://forum.rasa.com/u/iicky)\
**Post date:** [November 26, 2019, 7:53pm UTC](https://forum.rasa.com/t/no-message-received-from-rasa-custom-action/21728/3 "2019-11-26T19:53:35Z")

</div>

Hello,

I am having this same issue. I have set up a minimal Rasa stack using Docker Compose (I overwrote the `rasa` entrypoint on the `rasa/rasa:latest-full` image so I could use the commands within the container, since the official Rasa image has `rasa` as its `ENTRYPOINT`).

The current versions being pulled from Docker Hub are:

- Rasa 1.5.0
- rasa-sdk 1.5.0

After running `rasa init` to get a base project up and running, I changed the `bot_challenge` intent to run the custom `hello world` example action. I added a log statement to the `run` method of the `hello world` action. I know that a connection is being made between Rasa Core and the Actions Server, since I get the following output in the Action Server logs when triggering the `bot_challenge` intent.

However, there is no reply from `dispatcher.utter_message`. I am using `rasa shell` to chat with the bot.

```auto
2019-11-26 14:32:21 INFO rasa_sdk.endpoint - Starting action endpoint server...
2019-11-26 14:32:21 INFO rasa_sdk.executor - Registered function for 'action_hello_world'.
2019-11-26 14:32:21 INFO sanic.root - Goin' Fast @ http://0.0.0.0:5055
2019-11-26 14:32:21 INFO sanic.root - Starting worker [1]
2019-11-26 14:32:33 INFO actions.actions - Hello world executed!
2019-11-26 14:32:33 INFO sanic.access - 

```

Any idea why this isn’t working? I can get the bot to respond outside of custom actions.

Here are the relevant files:

### **docker-compose.yaml**

```auto
  # Rasa -----------------------------------------
  rasa:
    container_name: rasa
    build:
      context: $HOME/app/rasa/
      dockerfile: docker/Dockerfile
    command: tail -f /dev/null
    ports:
      - 5005:5005
      - 5002:5002
    volumes:
      - $HOME/app/rasa:/app
    restart: always

  # Rasa Action Server--------------------------------
  rasa-actions:
    container_name: rasa-actions
    image: rasa/rasa-sdk:latest
    ports:
      - 5055:5055
    volumes:
      - $HOME/app/rasa/actions:/app/actions
    restart: always

```

### **actions/actions.py**

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

from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher

# Define logger
log = logging.getLogger( __name__ )

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]]:
        log.info('Hello world executed!')

        dispatcher.utter_message("Hello World!")

        return []

```

---

<div class="post-metadata">

**Author:** ![ioans](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/ioans/32/6164_2.png) [@ioans](https://forum.rasa.com/u/ioans)\
**Post date:** [November 26, 2019, 9:34pm UTC](https://forum.rasa.com/t/no-message-received-from-rasa-custom-action/21728/4 "2019-11-26T21:34:57Z")

</div>

Hey Tanja, thanks for your reply. I am using `rasa/rasa:latest` and `rasa/rasa-sdk:latest` images from Docker Hub.

I also tried to build the command in `docker-compose`:

```auto
  action_server:
    image: rasa/rasa-sdk:latest
    ports:
      - 5055:5055
    volumes:
      - ./actions:/app/actions
    command:
      - run 
      - actions 
      - --actions 
      - actions/actions.py

```

but still an error: `action_server_1 | ./entrypoint.sh: line 17: exec: actions: cannot execute: Is a directory `

---

<div class="post-metadata">

**Author:** ![ioans](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/ioans/32/6164_2.png) [@ioans](https://forum.rasa.com/u/ioans)\
**Post date:** [November 26, 2019, 9:41pm UTC](https://forum.rasa.com/t/no-message-received-from-rasa-custom-action/21728/5 "2019-11-26T21:41:57Z")

</div>

Seems really similar to my issue. I also get `INFO sanic.access - ` , but only when I use ` dispatcher.utter_template()`

---

<div class="post-metadata">

**Author:** ![ioans](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/ioans/32/6164_2.png) [@ioans](https://forum.rasa.com/u/ioans)\
**Post date:** [December 2, 2019, 11:29am UTC](https://forum.rasa.com/t/no-message-received-from-rasa-custom-action/21728/6 "2019-12-02T11:29:05Z")

</div>

Hey @Tanja, any thoughts about this issue?

---

<div class="post-metadata">

**Author:** ![hjelga](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/hjelga/32/6113_2.png) [@hjelga](https://forum.rasa.com/u/hjelga)\
**Post date:** [December 2, 2019, 12:40pm UTC](https://forum.rasa.com/t/no-message-received-from-rasa-custom-action/21728/7 "2019-12-02T12:40:09Z")

</div>

![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/7/75c5f90edcf5a747890e42e13bd9031c2de0dbee.png)

This solved this problem for me…

---

<div class="post-metadata">

**Author:** ![ravikrcs](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/ravikrcs/32/10301_2.png) [@ravikrcs](https://forum.rasa.com/u/ravikrcs)\
**Post date:** [December 2, 2019, 12:41pm UTC](https://forum.rasa.com/t/no-message-received-from-rasa-custom-action/21728/8 "2019-12-02T12:41:13Z")

</div>

Update rasa-sdk to 1.5.1

---

<div class="post-metadata">

**Author:** ![iicky](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/iicky/32/6061_2.png) [@iicky](https://forum.rasa.com/u/iicky)\
**Post date:** [December 3, 2019, 6:52pm UTC](https://forum.rasa.com/t/no-message-received-from-rasa-custom-action/21728/9 "2019-12-03T18:52:06Z")

</div>

Thanks for the replies and help! Works perfectly after updating.
