Failed to connect duckling server while using docker-compose

Hi @nik202 hope you are doing well. I’ve been successfully running rasa open source using docker-compose on cloud server. The thing is I needed to update credentials.yml file to enable web socket channel so I built new image with changes made but duckling issue is happening again. I checked all the configuration and it looked same as one that I used before, but still failing. Only the image I built last time is working without any issue. I tried removing all the images and volumes on the cloud server but error still exists. What’s wrong with this case? I can only think about the duckling endpoint in config.yml url: http://duckling:8000 Is there possibility to cache this value with url: http://localhost:8000 when new image is being built for some reason? I also tried deleting all the image and built new image with new tag with right configuration but it’s not working. Any thoughts?

@jpark2111 Hello, and thanks for the concern. Yes, by god grace I’m doing fine, I wish and hope you also doing fine?

Can you please share a few pieces of information?

  1. Rasa open source docker and docker-compose files and which version of rasa?
  2. Errors screenshot, please
  3. config.yml

Weill solves this issue together.

@nik202 Thanks for quick response on weekends! I’ve been doing great, glad to hear you are doing fine as well :slight_smile:

sharing files you requested

  1. 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
  1. docker-compose.yml
version: "3.4"

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

  1. Errors Screenshot

  1. Config.yml
version: "2.0"
language: en
pipeline:
  - name: WhitespaceTokenizer
  - name: RegexFeaturizer
  - name: LexicalSyntacticFeaturizer
  - name: CountVectorsFeaturizer
  - name: CountVectorsFeaturizer
    analyzer: "char_wb"
    min_ngram: 1
    max_ngram: 4
  - name: DIETClassifier
    epochs: 100
  - name: FallbackClassifier
    threshold: 0.7
  - name: DucklingEntityExtractor
    url: http://duckling:8000
    dimensions:
    - amount-of-money
    - time
    - number
  - name: SpacyNLP
    model: "en_core_web_md"
    case_sensitive: false
  - name: "SpacyEntityExtractor"
    # Note: It is not possible to use the SpacyTokenizer + SpacyFeaturizer in
    #       combination with the WhitespaceTokenizer, and as a result the
    #       PERSON extraction by Spacy is not very robust.
    #       Because of this, the nlu training data is annotated as well, and the
    #       DIETClassifier will also extract PERSON entities .
    dimensions: ["PERSON"]
  - name: EntitySynonymMapper
policies:
- name: AugmentedMemoizationPolicy
- name: TEDPolicy
  epochs: 40
- name: RulePolicy
  core_fallback_threshold: 0.4
  core_fallback_action_name: "action_default_fallback"
  enable_fallback_prediction: True

@jpark2111 please share docker ps

OR

@jpark2111 Mentioned this in config.yml (replace these two fields)

- name: "DucklingHTTPExtractor" 
  url: "http://duckling:8000"

please run it again and share the result or error?

@nik202

@jpark2111 it doesn’t have any status that it’s running or not?

@nik202 They are up and running

In previous image status says Up about an hour as well

@jpark2111 please make the changes and do let me know, what I have mentioned in my previous post. Failed to connect duckling server while using docker-compose - #4 by nik202

@nik202 So change it with doubleQuotes? will do, it will need time to build image and docker-compose down and up. Should I remove all the images and volumes as well?

@jpark2111 yes, use double quotes please, and yes it will be best if you delete the image and volumes. I hope you are using docker desktop for the same or docker extension in VS code :slight_smile:

@nik202 Still getting same error. :frowning: wondering why it worked before, and now it doesn’t with same configuration…

@jpark2111 share the error again with the screenshot please

@nik202

@jpark2111 do you have anything running on port 8000 except duckling?

@nik202 duckling is the only thing running on port 8000, but is there a way that I can check to make sure duckling is the only one running on port 8000?

@jpark2111 I guess that is fine, can you mention EXPOSE 8000 in docker-compose.yml under ducking?

 expose:
    - "8000"

and run the image

@jpark2111 is your code is running on the local machine without any issue? did you cross-check?

@jpark2111 quickly share the endpoints.yml

expose:
    - "8000"

still getting error.

locally it’s always working fine. @nik202

endpoints.yml

version: "2.0"

action_endpoint:
 url: "http://app:5055/webhook"

There’s only action server endpoint configured.

@jpark2111 damm its so strange.

@jpark2111 restart your system please and close all the terminals and try run again.