Error unable to connect action server in docker - Rasa Open Source - Rasa Community Forum

Error unable to connect action server in docker

Hello, I am following this documentation Building a Rasa Assistant in Docker and after completely following it in shell it is giving me this error. I am unable to understand what the problem how to solve it.

My endpoints = action_endpoint: url: "http://action-server:5055/webhook"


post by Devershi on Apr 20, 2022

Hello! Can you share with us yours docker files? and the endpoint.yml?

If you prefer, you can follow nik202 steps on this comment.

Dockerizing my rasa chatbot application that has botfront - #11 by nik202


post by Devershi on Apr 20, 2022

Dockerfile (89 Bytes) endpoints.yml (1.4 KB)


post by Devershi on Apr 20, 2022

These are all commands I ran.

 docker run -v "%cd%":/app rasa/rasa:3.0.0-full train
docker build . -t rasa/rasa-sdk:3.0.0
docker network create my-project
docker run -d -v "%cd%"/actions:/app/actions --net my-project --name action-server rasa/rasa-sdk:3.0.0
docker run -it -v "%cd%":/app -p 5005:5005 --net my-project rasa/rasa:3.0.0-full shell

post by itsjhonny on Apr 20, 2022

Can you make docker ps to check the action server container is running? and docker network ls. to list all network?

To be honest, I prefer to use docker with docker-compose!


post by Devershi on Apr 20, 2022

I tried with compose as well still facing the same error.


post by nik202 on Apr 20, 2022

@Devershi As from the last docker ps output I can not see the Rasa server. I can only see the Rasa Action Server image and this is the main issue.

running rasa server image:

docker run -v $(pwd):/app rasa/rasa:3.1.0-full train --domain domain.yml --data data --out models

running rasa action server image:

docker run -d -v $(pwd)/actions:/app/actions --net my-project --name action-server rasa/rasa-sdk:3.1.1

I’d strongly suggest to read every step and try follow as mentioned. I am sure, you are just missing some step and wish you will sort this out soon. Good Luck!


post by Devershi on Apr 20, 2022

Hello, I tried again from start. Did I miss any steps? I am trying to follow the steps can you please help me out?


post by nik202 on Apr 20, 2022

@Devershi If I honestly tell you, the process you are using is more complex. Rather than, I suggest seeing my above-mentioned post and try to run it. In this, only one command needs to be run every time you make an update.

@Devershi

Observation: What this %cd% is this pwd? check how you can pass the path of windows in docker as my both machines are Mac and Ubuntu.

I will find one video tutorial for your reference, hope that will help you more in a better way.

  1. HOW TO BUILD A CHATBOT WITH DOCKER | RASA - YouTube
  2. HOW TO LINK ACTION SERVER AND RASA SERVER USING DOCKER - YouTube

These tutorial based on 2.x and you can change the image with 3.x and you can easily update.


post by Devershi on Apr 20, 2022

Surely I am following your suggested post right now.


post by Devershi on Apr 20, 2022

I removed all the docker containers and images from my docker desktop and tried again with same commands and somehow the issue got resolved. I don’t know the reason but for now the actions are working. Thank you.


post by nik202 on Apr 21, 2022

@Devershi I know…congrats, please close this thread as a solution.


post by Devershi on May 16, 2022

Hello @nik202 can you plz help me out here, I followed your shared post to use docker compose and after running it I am facing this error in action server.

these were my files for the same

Docker file 1

FROM rasa/rasa-sdk:3.1.1

WORKDIR /app

COPY requirements.txt requirements.txt

USER root

RUN pip install -r requirements.txt

EXPOSE 5055

USER 1001

Docker file 2

FROM rasa/rasa:3.1.0

WORKDIR '/app'

COPY . /app

COPY actions/requirements.txt ./

USER root

RUN pip install -r requirements.txt

RUN rasa train

VOLUME /app/models

CMD [ "run","-m","/app/models","--enable-api","--cors","*","--debug", "--endpoints", "endpoints.yml", "--log-file", "out.log", "--debug"]

EXPOSE 5005

Docker-compose.yml

version: '3'

services:
  rasa:
    container_name: "rasa_server"
    user: root
    build:
      context:  .
    volumes:
      - "./:/app"
    ports:
      - "5005:5005"
  action_server:
    container_name: "action_server"
    build:
      context: actions
    volumes:
      - ./actions:/app/actions
      - ./data:/app/data
    ports:
      - 5055:5055

What am I doing wrong here?


post by nik202 on May 16, 2022

@Devershi sure can you delete all the images and try to run it again?

@Devershi where is your '/.local' file in which folder?

@Devershi I will highly recommend to cross-check with my post: Dockerizing my rasa chatbot application that has botfront - #11 by nik202

Good Luck!


post by Devershi on May 16, 2022

I deleted all images and tried again giving same error.


post by nik202 on May 16, 2022

@Devershi strange, you want that I check online on zoom or google meet? quick call?


post by Devershi on May 16, 2022

Sure.


post by nik202 on May 16, 2022

@Devershi try to mention relative path for .pdf file and it will run in a docker container and permission error will be gone then as you have mention PWD in your action.py file. good luck