Rasa server not accessible via public IP address of EC2 instance

Hi rasa community,

I have deployed my project on EC2 instance using docker file. The Dockerfile is like:

FROM python:3.8-slim-buster WORKDIR /app COPY requirements.txt /app/ RUN pip install --no-cache-dir -r requirements.txt COPY . /app/ EXPOSE 5005 CMD [“rasa”, “run”, “–enable-api”, “-p”, “5005”]

and the requirements.txt file is like:

pandas
openai
rasa

Now the host port 80 is attached to to the container port 5005. I am getting the response on terminal using curl command.

When I post the request on public address of ec2 instance. I am unable to send the request. Although in my security group port 80 is configured to accept http calls. What should I do?

Hi @ZohaibRamzan, can you post the webhook endpoint of the ec2 instance?

Can you try running the server on a port other than 80?

You mean ec2 port. Currently My docker container port 5005 is bind to port 80 of the ec2 instance. What other port should I try to bind with docker port 5005?

  1. You can bind it to like 5005:5005
  2. Add, 5005 to security group
  3. And request to IP:5005/…

No success.

When you access ip:port in the browser, do you get the message “Hello from Rasa”?

Capture10 Gateway timed out.

Then it should be a problem related to security group. Please remove the old SG and create a new SG and attach it to the instance and try again

Deleted old SG and added new SG. still not resolved

Can you share your docker-compose/Dockerfile?

FROM python:3.8-slim-buster WORKDIR /app COPY requirements.txt /app/ RUN pip install --no-cache-dir -r requirements.txt COPY . /app/ EXPOSE 5005 CMD [“rasa”, “run”, “–enable-api”, “-p”, “5005”]

The requirements.txt file has three libraries as below

pandas openai rasa

The above docker file is being used for image creation and then container.

What’s the docker command you use to run the container?

Dockerfile (201 Bytes)

sudo docker run -d -p 5005:5005 --name rasa-server image_id

So, the situation is the endpoint is accessible within the instance but not outside the instance, right? In that case, it should be related to the SG!

Thanks for your help. The issue was not related to SG. It was port forwarding issue. Which i resolved by running these below two commands.

sysctl net.ipv4.conf.all.forwarding=1, iptables -P FORWARD ACCEPT

Now my both rasa server and action server are working and I am able to get the responses through postman. How can I get the rasa widget configured on public IP address to show the client how chatbot is working? kindly help.