# Can't run custom action with Docker

**URL:** <https://forum.rasa.com/t/cant-run-custom-action-with-docker/21293>\
**Category:** Rasa Open Source\
**Created:** [November 15, 2019, 10:54am UTC](https://forum.rasa.com/t/cant-run-custom-action-with-docker/21293 "2019-11-15T10:54:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![vivitare](https://avatars.discourse-cdn.com/v4/letter/v/c57346/32.png) [@vivitare](https://forum.rasa.com/u/vivitare)\
**Post date:** [November 15, 2019, 10:54am UTC](https://forum.rasa.com/t/cant-run-custom-action-with-docker/21293/1 "2019-11-15T10:54:46Z")

</div>

Hey i’m trying to create a chatbot with RASA in Docker but i can’t use custom action, the bot don’t respond.

I’m running the action server in a Docker container with docker-compose. This is the docker-compose.yml file :

```auto
version: '3.0'
services:
  action_server:
    image: rasa/rasa-sdk:latest
    volumes:
      - ./actions:/app/actions

```

And this is my endpoints.yml file :

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

```

To interact with the chatbot, i execute rasa/rasa:latest image Docker with this command :

```auto
docker run -it --network="chatbot_rasa_default" -v $(pwd):/app rasa/rasa interactive

```

But at the moment where the bot should execute the custom action, he said nothing (it’s the same thing when i use `rasa shell -vv` cmd):

```auto
? Your input -> hey
? Your NLU model classified 'hey' with intent 'greet' and there are no entities, is this correct? Yes
------
Chat History

 # Bot You
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
 1 action_listen
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
 2 hey
                         intent: greet 0.80
------
? The bot wants to run 'action_hello_world', correct? Yes
------
Chat History

 # Bot You
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
 1 action_listen
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
 2 hey
                                   intent: greet 0.80
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
 3 action_hello_world 1.00
------
? The bot wants to run 'action_listen', correct? (Y/n)

```

The bot sould respond “Hello World !” because it is written in action/action.py file :

```python
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):
        return "action_hello_world"
    def run(self, dispatcher, tracker, domain):
        print("Hello")
        print("this is tracker",tracker)
        dispatcher.utter_message("Hello World!")
        return []

```

But i noticed that the action server logs returned nothing :

```auto
[root@vm]# docker-compose up
Creating network "chatbot_rasa_default" with the default driver
Creating chatbot_rasa_action_server_1 ... done
Attaching to chatbot_rasa_action_server_1
action_server_1 | 2019-11-15 10:19:17 INFO rasa_sdk.endpoint - Starting action endpoint server...
action_server_1 | 2019-11-15 10:19:17 INFO rasa_sdk.executor - Registered function for 'action_hello_world'.
action_server_1 | 2019-11-15 10:19:17 INFO rasa_sdk.endpoint - Action endpoint is up and running on http ('0.0.0.0', 5055)

```

Why the bot didn’t respond “hello world !” ? I missed a step ?

---

<div class="post-metadata">

**Author:** ![fuih](https://avatars.discourse-cdn.com/v4/letter/f/d78d45/32.png) [@fuih](https://forum.rasa.com/u/fuih)\
**Post date:** [November 18, 2019, 1:28am UTC](https://forum.rasa.com/t/cant-run-custom-action-with-docker/21293/2 "2019-11-18T01:28:49Z")

</div>

Hello @vivitare,

Are you running the Rasa server and the action server separately, not in the same Docker network ? I don’t see the Rasa server service in your docker-compose.yml

---

<div class="post-metadata">

**Author:** ![vivitare](https://avatars.discourse-cdn.com/v4/letter/v/c57346/32.png) [@vivitare](https://forum.rasa.com/u/vivitare)\
**Post date:** [November 18, 2019, 8:25am UTC](https://forum.rasa.com/t/cant-run-custom-action-with-docker/21293/3 "2019-11-18T08:25:25Z")

</div>

Thks @fuih

Nope, they can communicate with each other because i run rasa with this command :

```bash
docker run -it --network="chatbot_rasa_default" -v $(pwd):/app rasa/rasa:latest shell -vv

```

When he can’t communicate with the action server, a message appear that they can’t communicate with each other.

---

<div class="post-metadata">

**Author:** ![imLew](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/imlew/32/3744_2.png) [@imLew](https://forum.rasa.com/u/imLew)\
**Post date:** [November 25, 2019, 2:12pm UTC](https://forum.rasa.com/t/cant-run-custom-action-with-docker/21293/4 "2019-11-25T14:12:53Z")

</div>

Are you running it in two separate docker containers or the way it is described in [Running Rasa with Docker](https://rasa.com/docs/rasa/user-guide/running-rasa-with-docker/)? If they are separate I think you might need to open the port for the action server

---

<div class="post-metadata">

**Author:** ![vivitare](https://avatars.discourse-cdn.com/v4/letter/v/c57346/32.png) [@vivitare](https://forum.rasa.com/u/vivitare)\
**Post date:** [December 6, 2019, 8:49am UTC](https://forum.rasa.com/t/cant-run-custom-action-with-docker/21293/5 "2019-12-06T08:49:35Z")

</div>

they don’t need open port because they are in the same network, they can ping between them.

---

<div class="post-metadata">

**Author:** ![bubjanes](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/bubjanes/32/6898_2.png) [@bubjanes](https://forum.rasa.com/u/bubjanes)\
**Post date:** [April 24, 2020, 8:54pm UTC](https://forum.rasa.com/t/cant-run-custom-action-with-docker/21293/6 "2020-04-24T20:54:45Z")

</div>

> [@vivitare](#):
>
> docker run -it --network=“chatbot\_rasa\_default” -v $(pwd):/app rasa/rasa:latest shell -vv

Hola @vivitare!

Shooting from the hip here a little, but I think I had the same problem. Try making the docker `--network` in your docker container the same as the `action_endpoint` in endpoints.yml.

So the final command would look something like this:

`docker run -it --network="action_server" -v $(pwd):/app rasa/rasa:latest shell -vv`

Hope that helps!

---

<div class="post-metadata">

**Author:** ![Pisou](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/pisou/32/21795_2.png) [@Pisou](https://forum.rasa.com/u/Pisou)\
**Post date:** [October 20, 2022, 4:23pm UTC](https://forum.rasa.com/t/cant-run-custom-action-with-docker/21293/7 "2022-10-20T16:23:36Z")

</div>

@vivitare I had the same problem. You were able to solve it ?
