Action server not working with Docker: Couldn't connect to the server

Hello, We have deployed a chatbot on a website using Rasa webchat via Heroku. Chitchat works, but the action server gives the following error messege:

ERROR rasa.core.actions.action - Failed to run custom action ‘action_query_chuck_norris’. Couldn’t connect to the server at ‘http://iba_action_server_1:5055/webhook’. Is the server running? Error: Cannot connect to host iba_action_server_1:5055 ssl:default [Name or service not known]

The endpoints.yml:

action_endpoint: url: http://iba_action_server_1:5055/webhook

Screenshot_1

Hello @dieterm,

Your service running the action server is named “action_server”. Therefore to refer to its IP you need to change your endpoints.yml to:

action_endpoint: url: http://action_server:5055/webhook

Docker containers refer to each other’s IP by their service’s name, not container’s name (at least in the case of using docker-compose)

2 Likes

We have tried this out, but we unfortunately get the same error as before:

ERROR rasa.core.actions.action - Failed to run custom action ‘action_query_chuck_norris’. Couldn’t connect to the server at ‘http://action_server:5055/webhook’. Is the server running? Error: Cannot connect to host action_server:5055 ssl:default [Name or service not known]

What else could be the reason for this?

That is certainly weird. Do you see that the action_server is started ? Is there any log which indicated some kind of error (other than the one above ofc) ? You can also describe the process of deployment in steps, maybe we’ll figure something out.

We created our own docker images and Dockerfiles now (seperate ones for rasa server and action server) instead of using the latest versions from Rasa docker hub. We managed to start both servers on Heroku, but now we have port issues with the CMD run commands in the Dockerfiles. Heroku ads “” in front of the ports. The solution presented here did not solve the issue for us: Deploy bot on Heroku

@dieterm, I met the similar issue, do you solve the problem?

Thanks,

No we did not solve the port issue on Heroku. Our work around was to deploy the action server and the rasa server each on a seperate Heroku app.

@dieterm Can you please share your Dockerfile for rasa server. I managed to deploy the rasa server using docker and it is running but apparently on localhost in the heroku dyno

I am not able to access the API endpoints. Any help would be appreciated

Update: I was able to deploy it successfully in Heroku . The Dockerfile I have is

FROM rasa/rasa:latest-full

# Check Python Environment

RUN python --version

RUN pip --version

# Set working directory

WORKDIR /app

ADD . .

ENTRYPOINT []

EXPOSE 5005

CMD $(echo "rasa run -p $PORT --debug -m models --credentials credentials.yml --enable-api --log-file out.log --endpoints endpoints.yml" | sed 's/=//')

Although I am facing a problem currently, the problem is that when I try to wake up my dyno by sending it a request the app crashes

Hey @ramaneswaran,

Did you have separeate Dockerfile for your action server and rasa core ??

Could you share them please…and also, how did you deploy to heroku, action server on one app and rasa core on another ?

Hey @_sanjay_r

I did not use action server, for the project I was just using Rasa NLU for inference For deployment, I just pushed the docker container to Heroku

Deploying Using Docker in Heroku

Refer to the article above for deployment.

Sorry for my late reply. This is our Dockerfile:

FROM ubuntu:18.04

RUN apt-get update && apt-get -y install sudo && apt-get install -y python3 python3-pip

RUN python3 -m pip install --upgrade pip

RUN pip3 install rasa==1.5.1

ADD ./models /app/models/

ADD ./actions /app/actions/

ADD ./scripts /app/scripts/

ADD ./ /

ENTRYPOINT

CMD /app/scripts/start_service.sh

Our Dockerfile for the action server:

FROM ubuntu:18.04

RUN apt-get update && apt-get install -y python3 python3-pip

RUN python3 -m pip install --upgrade pip

RUN pip3 install rasa==1.5.1 && pip install pandas

ADD * /actions/

RUN chmod +x /actions/*

ENTRYPOINT

CMD ./actions/start_actions.sh