# Can not connect to action server from bot when running in a container

**URL:** <https://forum.rasa.com/t/can-not-connect-to-action-server-from-bot-when-running-in-a-container/30957>\
**Category:** Rasa Open Source\
**Created:** [July 3, 2020, 10:22pm UTC](https://forum.rasa.com/t/can-not-connect-to-action-server-from-bot-when-running-in-a-container/30957 "2020-07-03T22:22:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nadeeshtv](https://avatars.discourse-cdn.com/v4/letter/n/90ced4/32.png) [@nadeeshtv](https://forum.rasa.com/u/nadeeshtv)\
**Post date:** [July 3, 2020, 10:22pm UTC](https://forum.rasa.com/t/can-not-connect-to-action-server-from-bot-when-running-in-a-container/30957/1 "2020-07-03T22:22:04Z")

</div>

Hi all,

I created a rasa server image using following **docker file**

```auto

WORKDIR /app

COPY . /app

COPY ./data /app/data

USER root

RUN rasa train

VOLUME /app

VOLUME /app/data

VOLUME /app/models

USER 1001

CMD ["run","-m","/app/models","--enable-api","--cors","*","--debug"]

```

Then created an **action image** with following docker file

```auto
# Extend the official Rasa SDK image

FROM rasa/rasa-sdk:1.6.1

# Use subdirectory as working directory

WORKDIR /app

# Copy any additional custom requirements, if necessary (uncomment next line)

COPY actions/requirements-actions.txt ./

# Change back to root user to install dependencies

USER root

# Install extra requirements for actions code, if necessary (uncomment next line)

RUN pip install -r "requirements-actions.txt"

# Copy actions folder to working directory

COPY ./actions /app/actions

# By best practices, don't run the code with root user

USER 1001

# Start the action server

CMD ["start", "--actions", "actions", "--debug"]

```

Then I ran the rasaserver as

```auto
 docker run -it -v $(pwd):/app myimage:version shell

```

Then I ran the action server as ( ref - [Building a Rasa Assistant in Docker](https://rasa.com/docs/rasa/user-guide/docker/building-in-docker/#training-the-rasa-core-model))

```auto
docker network create my-project

docker run -v $(pwd)/actions:/app/actions --net my-project --name action_server myactionimage:latest

```

But then I start interaction with the bot it’s not able to connect with action server

Couldn’t connect to the server at ‘http://action\_server:5055/webhook’. Is the server running? Error: **C\*\*\*\*annot connect to host action\_server:5055** ssl:None [Name or service not known]

I even updated the **endpoints.yaml** file as

```auto
action_endpoint:

url: "http://action_server:5055/webhook"

```

Can anyone suggest what am I doing wrong?

---

<div class="post-metadata">

**Author:** ![stephens](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/stephens/32/1632_2.png) [@stephens](https://forum.rasa.com/u/stephens)\
**Post date:** [July 4, 2020, 10:13pm UTC](https://forum.rasa.com/t/can-not-connect-to-action-server-from-bot-when-running-in-a-container/30957/2 "2020-07-04T22:13:23Z")

</div>

Hi Nadeesh,

The hostname `action_server` is probably not correct. It should probably be `localhost` since it sounds like you’re starting both containers from the command line.

If you switch to a docker-compose setup the the hosts know each other via their service name.

Greg

---

<div class="post-metadata">

**Author:** ![nadeeshtv](https://avatars.discourse-cdn.com/v4/letter/n/90ced4/32.png) [@nadeeshtv](https://forum.rasa.com/u/nadeeshtv)\
**Post date:** [July 5, 2020, 5:35pm UTC](https://forum.rasa.com/t/can-not-connect-to-action-server-from-bot-when-running-in-a-container/30957/3 "2020-07-05T17:35:42Z")

</div>

@stephens Thanks. Now I tried to run it using docker-compose. Please see my docker-compose file( rasa image was based on rasa:1.6.1-spacy)

```auto
version: '3.0'
services:
 rasa_movie:
   image: myrasa:v3
   ports:
     - 5005:5005
   depends_on:
     - duckling
     - action_server
   command:
     - shell
     - -m
     - /app/models
     - --cors
     - "*"
     - --enable-api
     - --log-file
     - out.log
     - -p
     - '5005'
 action_server:
   image: myaction:v1
   ports:
     - "5055:5055"
   command:
     - start
     - --actions
     - actions
 duckling:
   image: rasa/duckling
   ports:
     - "8000:8000"

```

But it failed with

```auto
myrasa_1 | 2020-07-05 17:09:29 ERROR asyncio - Task exception was never retrieved
myrasa_1 | future: <Task finished coro=<configure_app.<locals>.run_cmdline_io() done, defined at /build/lib/python3.6/site-packages/rasa/core/run.py:124> exception=PermissionError(1, 'Operation not permitted')>
myrasa_1 | Traceback (most recent call last):
myrasa_1 | File "/build/lib/python3.6/site-packages/rasa/core/run.py", line 128, in run_cmdline_io
myrasa_1 | server_url=constants.DEFAULT_SERVER_FORMAT.format("http", port)
myrasa_1 | File "/build/lib/python3.6/site-packages/rasa/core/channels/console.py", line 131, in record_messages
myrasa_1 | text = get_user_input(button_question)
myrasa_1 | File "/build/lib/python3.6/site-packages/rasa/core/channels/console.py", line 77, in get_user_input
myrasa_1 | style=Style([("qmark", "#b373d6"), ("", "#b373d6")]),
myrasa_1 | File "/build/lib/python3.6/site-packages/questionary/question.py", line 45, in ask
myrasa_1 | return self.unsafe_ask(patch_stdout)
myrasa_1 | File "/build/lib/python3.6/site-packages/questionary/question.py", line 59, in unsafe_ask
myrasa_1 | return self.application.run()
myrasa_1 | File "/build/lib/python3.6/site-packages/prompt_toolkit/application/application.py", line 736, in run
myrasa_1 | return run()
myrasa_1 | File "/build/lib/python3.6/site-

```

So far I could not figure out the issue. Any advice will help

---

<div class="post-metadata">

**Author:** ![martinavalogia](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/martinavalogia/32/10726_2.png) [@martinavalogia](https://forum.rasa.com/u/martinavalogia)\
**Post date:** [July 6, 2020, 8:05am UTC](https://forum.rasa.com/t/can-not-connect-to-action-server-from-bot-when-running-in-a-container/30957/4 "2020-07-06T08:05:13Z")

</div>

Hi Greg, I also face issues when running the actionserver it comes to a stand still

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/4/40c463eed1142223f7596a10d5b90ed5d3cd72de.png) .Please do let me know how to make this work??I have made changes to the actions.py page and also to endpoints.yml

---

<div class="post-metadata">

**Author:** ![stephens](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/stephens/32/1632_2.png) [@stephens](https://forum.rasa.com/u/stephens)\
**Post date:** [July 6, 2020, 11:47pm UTC](https://forum.rasa.com/t/can-not-connect-to-action-server-from-bot-when-running-in-a-container/30957/5 "2020-07-06T23:47:36Z")

</div>

Nadeesh,

This issue should be addressed by upgrading to 1.10.6.

Greg

---

<div class="post-metadata">

**Author:** ![nadeeshtv](https://avatars.discourse-cdn.com/v4/letter/n/90ced4/32.png) [@nadeeshtv](https://forum.rasa.com/u/nadeeshtv)\
**Post date:** [July 10, 2020, 9:53pm UTC](https://forum.rasa.com/t/can-not-connect-to-action-server-from-bot-when-running-in-a-container/30957/6 "2020-07-10T21:53:50Z")

</div>

@stephens Thanks
