Unable to run Duckling server using docker-compose

@jpark2111 go with the generic approach please don’t mention dockerignore and copy everything which is required for model training.

@nik202 If I’m not using dockerignore file and copying everything, COPY . /app this line should be removed tho, correct? Even then all the config, credential, domain and endpoint.yml files are copied manually one by one to docker container? I’m confused here :frowning:

@jpark2111 no no you can even copy a single file too but as per training, we required some files.

@jpark2111 can you inspect the container? when you copied all file?

docker exec -u root -t -i <container ID> /bin/bash

You need to inspect

@nik202 Action server now is working, again I need to allow the 5055 port on VM. But duckling still getting error, port 8000 also is being allowed. attaching error message and files you might want to look at.

 rasa.nlu.extractors.duckling_entity_extractor  - Failed to connect to duckling http server. Make sure the duckling server is running/healthy/not stale and the proper host and port are set in the configuration. More information on how to run the server can be found on github: https://github.com/facebook/duckling#quickstart Error: HTTPConnectionPool(host='localhost', port=8000): Max retries exceeded with url: /parse (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ffadb98b640>: Failed to establish a new connection: [Errno 111] Connection refused'))

This is duckling config in config.yml

  - name: DucklingEntityExtractor
    url: http://duckling:8000

DockerFile

FROM rasa/rasa:2.8.2

WORKDIR /app
COPY . /app
USER root

RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
RUN python -m spacy download en_core_web_md 
RUN python -m spacy link en_core_web_md en

COPY ./data /app/data
COPY config.yml /app
COPY endpoints.yml /app

RUN rasa train

VOLUME /app
VOLUME /app/data
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.4"

services:
  rasa:
    restart: always
    image: "myimage/tag"
    user: root
    ports:
      - 5005:5005
    volumes:
      - ./:/app
    depends_on:
      - duckling
      - app
  app:
    restart: always
    image: "myimage/tag"
    ports:
      - 5055:5055
  duckling:
    restart: always
    image: "rasa/duckling:0.1.6.5-r2"
    ports:
      - 8000:8000
    command: ["duckling-example-exe", "--no-access-log", "--no-error-log"]

Is this is the right image?

I changed it to latest, still getting same error. Do I need to train model again? Since I’m using a model that trained during docker image is being built, do I need to build docker image for rasa again? @nik202

@jpark2111 yes, delete all the images and volume and run docker-compose build . do let me know.

@jpark2111 do check the duckling command which you mentioned in docker-compose.yml

CMD ["duckling-example-exe", "-p", "8000", "--no-access-log", "--no-error-log"]

@nik202 rasa server, action server and duckling are all up and running without issue now :slight_smile: Thank you for your support!!

@jpark2111 Great! :+1::+1: Next time please create a new thread for the new issue. Have a great day!

@jpark2111 for a record and feedback do share the final files (docker and docker-compose) for other readers whenever you got time.

1 Like

Hi @nik202 ,

I have recently started to develop a chatbot using rasa and currently I am trying to talk to a bot using docker compose. I have set up a docker compose file, a docker file in the main folder and a docker file in the action folder. I have made sure that the action-server defined in the docker compose is same in the endpoints.yml file and followed the solution at- Unable to run Duckling server using docker-compose - Rasa Open Source - Rasa Community Forum.

When I run the docker compose file, the duckling, rasa server and action server starts but when I try to talk to the bot, the first error is “Failed to connect to duckling server” and also all the “action session” fails to start.

docker-compose.yml (772 Bytes) Dockerfile (255 Bytes) Dockerfile_Action (214 Bytes)

Error on starting shell is: ‘’’ ERROR rasa.core.actions.action - Failed to run custom action ‘action_session_start’. Couldn’t connect to the server at ‘http://action-server:5056/webhook’. Is the server running? Error: Cannot connect to host action-server:5056 ssl:default [Name or service not known] 2022-07-13 16:43:48 ERROR rasa.core.processor - Encountered an exception while running action ‘action_session_start’.Bot will continue, but the actions events are lost. Please check the logs of your action server for more information. ‘’’

‘’’ ERROR rasa.nlu.extractors.duckling_entity_extractor - Failed to connect to duckling http server. Make sure the duckling server is running/healthy/not stale and the proper host and port are set in the configuration. More information on how to run the server can be found on github: GitHub - facebook/duckling: Language, engine, and tooling for expressing, testing, and evaluating composable language rules on input strings. Error: HTTPConnectionPool(host=‘localhost’, port=8000): Max retries exceeded with url: /parse (Caused by NewConnectionError(‘<urllib3.connection.HTTPConnection object at 0x7f9d4c5ef490>: Failed to establish a new connection: [Errno 111] Connection refused’)) ‘’’

I am using Rasa version 2.2.9

Please give suggestions to enable my bot and let me know if any further information is required.

Thank you