Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RASA X hangs on "talk to your bot" #8611

Closed
gioppoluca opened this issue May 5, 2021 · 7 comments
Closed

RASA X hangs on "talk to your bot" #8611

gioppoluca opened this issue May 5, 2021 · 7 comments
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@gioppoluca
Copy link

gioppoluca commented May 5, 2021

Rasa version: 2.5.2

Rasa SDK version (if used & relevant): not relevant

Rasa X version (if used & relevant): 0.39.2

Python version: the one in container

Operating system (windows, osx, ...): Linux but using official containers

Issue:
Use RASA X in docker compose following tutorial
Create a very simple example
Create the model, activate it, go to talk to your bot, try to say "hi" bot stay there hanging forever

Error (including full traceback):

no error just hanging.
BTW in the story page the flow has a blue rectangle with "none" written where the intent should be, do not know if this is the result of some error or is just a bug of the flow diagram

Command or request that led to error:

interaction with the newly created model

Content of configuration file (config.yml) (if relevant):

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: EntitySynonymMapper
  - name: ResponseSelector
    epochs: 100
policies:
  - name: MemoizationPolicy
  - name: RulePolicy
  - name: TEDPolicy
    max_history: 5
    epochs: 100

Content of domain file (domain.yml) (if relevant):

session_config:
  session_expiration_time: 60
  carry_over_slots_to_new_session: true
intents:
- request_document
- greet
- thankyou
- stop
- deny
- chitchat
- affirm
- bot_challenge
entities:
- document
slots:
  document:
    type: text
    influence_conversation: false
responses:
  utter_ask_document_form:
  - text: You need to tell me what document you need
  utter_ask_continue:
  - text: do you want to continue?
  utter_slots_values:
  - text: 'you need to follow the process for the document:'
  utter_i_understand:
  - text: I understood you are looking for
  utter_greet:
  - text: Hi to you what can I do for you?

**Stories content

version: "2.0"
stories:
- story: request a document
  steps:
  - intent: request_document
    entities:
    - document: passport
  - action: utter_i_understand
@gioppoluca gioppoluca added area:rasa-oss 🎡 Anything related to the open source Rasa framework type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. labels May 5, 2021
@gioppoluca
Copy link
Author

I activeted debug on rasa-production and it seems that the server used the model correctly, but there is some errors in the comunication back to rasa X

nginx_1            | 172.28.0.1 - - [05/May/2021:15:09:02 +0000] "GET /api/conversations/69329d895bb74910b796bc2d8f63022b?format=full_conversation&since=0&environment=production HTTP/1.1" 200 324 "http://localhost/interactive" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
rasa-production_1  | 2021-05-05 15:09:02 DEBUG    rasa.nlu.classifiers.diet_classifier  - There is no trained model for 'ResponseSelector': The component is either not trained or didn't receive enough training data.
rasa-production_1  | 2021-05-05 15:09:02 DEBUG    rasa.nlu.selectors.response_selector  - Adding following selector key to message property: default
rasa-production_1  | 2021-05-05 15:09:02 DEBUG    rasa.core.processor  - Received user message 'hi' with intent '{'id': 4158997471203520594, 'name': 'greet', 'confidence': 0.999997615814209}' and entities '[]'
rasa-production_1  | 2021-05-05 15:09:02 DEBUG    rasa.core.processor  - Logged UserUtterance - tracker now has 3 events.
rasa-production_1  | 2021-05-05 15:09:02 DEBUG    rasa.core.policies.memoization  - Current tracker state:
rasa-production_1  | [state 1] user intent: greet | previous action name: action_listen
rasa-production_1  | 2021-05-05 15:09:02 DEBUG    rasa.core.policies.memoization  - There is a memorised next action 'utter_greet'
rasa-production_1  | 2021-05-05 15:09:02 DEBUG    rasa.core.policies.rule_policy  - Current tracker state:
rasa-production_1  | [state 1] user text: hi | previous action name: action_listen
rasa-production_1  | 2021-05-05 15:09:02 DEBUG    rasa.core.policies.rule_policy  - There is no applicable rule.
rasa-production_1  | 2021-05-05 15:09:02 DEBUG    rasa.core.policies.rule_policy  - Current tracker state:
rasa-production_1  | [state 1] user intent: greet | previous action name: action_listen
rasa-production_1  | 2021-05-05 15:09:02 DEBUG    rasa.core.policies.rule_policy  - There is no applicable rule.
rasa-production_1  | 2021-05-05 15:09:02 DEBUG    rasa.core.policies.ted_policy  - TED predicted 'utter_greet' based on user intent.
rasa-production_1  | 2021-05-05 15:09:02 DEBUG    rasa.core.policies.ensemble  - Made prediction using user intent.
rasa-production_1  | 2021-05-05 15:09:02 DEBUG    rasa.core.policies.ensemble  - Added `DefinePrevUserUtteredFeaturization(False)` event.
rasa-production_1  | 2021-05-05 15:09:02 DEBUG    rasa.core.policies.ensemble  - Predicted next action using policy_0_MemoizationPolicy.
rasa-production_1  | 2021-05-05 15:09:02 DEBUG    rasa.core.processor  - Predicted next action 'utter_greet' with confidence 1.00.
rasa-production_1  | 2021-05-05 15:09:02 DEBUG    rasa.core.processor  - Policy prediction ended with events '[<rasa.shared.core.events.DefinePrevUserUtteredFeaturization object at 0x7fe7d574c8b0>]'.
rasa-production_1  | 2021-05-05 15:09:02 DEBUG    rasa.core.processor  - Action 'utter_greet' ended with events '[BotUttered('Hi to you what can I do for you?', {"elements": null, "quick_replies": null, "buttons": null, "attachment": null, "image": null, "custom": null}, {"utter_action": "utter_greet"}, 1620227342.2056293)]'.
rasa-production_1  | 2021-05-05 15:09:02 DEBUG    rasa.core.policies.memoization  - Current tracker state:
rasa-production_1  | [state 1] user intent: greet | previous action name: action_listen
rasa-production_1  | [state 2] user intent: greet | previous action name: utter_greet
rasa-production_1  | 2021-05-05 15:09:02 DEBUG    rasa.core.policies.memoization  - There is a memorised next action 'action_listen'
rasa-production_1  | 2021-05-05 15:09:02 DEBUG    rasa.core.policies.rule_policy  - Current tracker state:
rasa-production_1  | [state 1] user intent: greet | previous action name: action_listen
rasa-production_1  | [state 2] user intent: greet | previous action name: utter_greet
rasa-production_1  | 2021-05-05 15:09:02 DEBUG    rasa.core.policies.rule_policy  - There is no applicable rule.
rasa-production_1  | 2021-05-05 15:09:02 DEBUG    rasa.core.policies.ted_policy  - TED predicted 'action_listen' based on user intent.
rasa-production_1  | 2021-05-05 15:09:02 DEBUG    rasa.core.policies.ensemble  - Predicted next action using policy_0_MemoizationPolicy.
rasa-production_1  | 2021-05-05 15:09:02 DEBUG    rasa.core.processor  - Predicted next action 'action_listen' with confidence 1.00.
rasa-production_1  | 2021-05-05 15:09:02 DEBUG    rasa.core.processor  - Policy prediction ended with events '[]'.
rasa-production_1  | 2021-05-05 15:09:02 DEBUG    rasa.core.processor  - Action 'action_listen' ended with events '[]'.
rasa-production_1  | 2021-05-05 15:09:02 DEBUG    rasa.core.tracker_store  - Recreating tracker from sender id '69329d895bb74910b796bc2d8f63022b'
rasa-production_1  | 2021-05-05 15:09:02 DEBUG    rasa.core.tracker_store  - Tracker with sender_id '69329d895bb74910b796bc2d8f63022b' stored to database
rasa-production_1  | 2021-05-05 15:09:02 DEBUG    rasa.core.lock_store  - Deleted lock for conversation '69329d895bb74910b796bc2d8f63022b'.
rasa-x_1           | [2021-05-05 15:09:02 +0000] - (sanic.access)[INFO][172.28.0.8:45966]: POST http://localhost/api/conversations/69329d895bb74910b796bc2d8f63022b/messages?environment=production  200 95

@gioppoluca
Copy link
Author

I add also the docker-compose file should it be needed (is the one got from the tutorial but never know)

version: "3.4"

x-database-credentials: &database-credentials
  DB_HOST: "db"
  DB_PORT: "5432"
  DB_USER: "${DB_USER:-admin}"
  DB_PASSWORD: "${DB_PASSWORD}"
  DB_LOGIN_DB: "${DB_LOGIN_DB:-rasa}"

x-rabbitmq-credentials: &rabbitmq-credentials
  RABBITMQ_HOST: "rabbit"
  RABBITMQ_USERNAME: "user"
  RABBITMQ_PASSWORD: ${RABBITMQ_PASSWORD}

x-redis-credentials: &redis-credentials
  REDIS_HOST: "redis"
  REDIS_PORT: "6379"
  REDIS_PASSWORD: ${REDIS_PASSWORD}
  REDIS_DB: "1"
  REDIS_CACHE_DB: "2"
  ACCEPTABLE_QUERY_COUNT_NUMBER: "50000"

x-duckling-credentials: &duckling-credentials
  RASA_DUCKLING_HTTP_URL: "http://duckling:8000"

x-nginx-host-variables: &nginx-host-variables
  RASA_X_HOST: "rasa-x:5002"
  RASA_USER_APP: "app:5055"
  RASA_PRODUCTION_HOST: "rasa-production:5005"

x-rasax-credentials: &rasax-credentials
  RASA_X_HOST: "http://rasa-x:5002"
  RASA_X_USERNAME: ${RASA_X_USERNAME:-admin}
  RASA_X_PASSWORD: ${RASA_X_PASSWORD:-}
  RASA_X_TOKEN: ${RASA_X_TOKEN}
  JWT_SECRET: ${JWT_SECRET}
  RASA_USER_APP: "http://app:5055"
  RASA_PRODUCTION_HOST: "http://rasa-production:5005"
  RASA_WORKER_HOST: "http://rasa-worker:5005"
  RASA_TOKEN: ${RASA_TOKEN}

x-rasa-credentials: &rasa-credentials
  <<: *rabbitmq-credentials
  <<: *rasax-credentials
  <<: *database-credentials
  <<: *redis-credentials
  <<: *duckling-credentials
  RASA_TOKEN: ${RASA_TOKEN}
  RASA_MODEL_PULL_INTERVAL: 10
  RABBITMQ_QUEUE: "rasa_production_events"
  RASA_TELEMETRY_ENABLED: ${RASA_TELEMETRY_ENABLED:-true}

x-rasa-services: &default-rasa-service
  restart: always
  image: "rasa/rasa:${RASA_VERSION}-full"
  volumes:
    - ./.config:/.config
  expose:
    - "5005"
  command: >
    x
    --no-prompt
    --production
    --config-endpoint http://rasa-x:5002/api/config?token=${RASA_X_TOKEN}
    --port 5005
    --debug
    --jwt-method HS256
    --jwt-secret ${JWT_SECRET}
    --auth-token '${RASA_TOKEN}'
    --cors "*"
  depends_on:
    - rasa-x
    - rabbit
    - redis

services:
  rasa-x:
    restart: always
    image: "rasa/rasa-x:${RASA_X_VERSION}"
    expose:
      - "5002"
    volumes:
      - ./models:/app/models
      - ./environments.yml:/app/environments.yml
      - ./credentials.yml:/app/credentials.yml
      - ./endpoints.yml:/app/endpoints.yml
      - ./logs:/logs
      - ./auth:/app/auth
    environment:
      <<: *database-credentials
      <<: *rasa-credentials
      SELF_PORT: "5002"
      DB_DATABASE: "${DB_DATABASE:-rasa}"
      RASA_MODEL_DIR: "/app/models"
      PASSWORD_SALT: ${PASSWORD_SALT}
      RABBITMQ_QUEUE: "rasa_production_events"
      RASA_X_USER_ANALYTICS: "0"
      SANIC_RESPONSE_TIMEOUT: "3600"
      RUN_DATABASE_MIGRATION_AS_SEPARATE_SERVICE: "true"
    depends_on:
      - db

  db-migration:
    entrypoint: ["python"]
    command: ["-m", "rasax.community.services.db_migration_service"]
    restart: always
    image: "rasa/rasa-x:${RASA_X_VERSION}"
    healthcheck:
      test: ["CMD-SHELL", "curl -f http://localhost:8000/health || kill 1"]
      interval: 5s
      timeout: 1s
      retries: 3
      start_period: 2s
    expose:
      - "8000"
    environment:
      <<: *database-credentials
      RUN_DATABASE_MIGRATION_AS_SEPARATE_SERVICE: "true"
      MPLCONFIGDIR: "/tmp/.matplotlib"
    depends_on:
      - db

  rasa-production:
    <<: *default-rasa-service
    environment:
      <<: *rasa-credentials
      RASA_ENVIRONMENT: "production"
      DB_DATABASE: "tracker"
      MPLCONFIGDIR: "/tmp/.matplotlib"
      RASA_MODEL_SERVER: "http://rasa-x:5002/api/projects/default/models/tags/production"

  rasa-worker:
    <<: *default-rasa-service
    environment:
      <<: *rasa-credenti`als
      RASA_ENVIRONMENT: "worker"
      DB_DATABASE: "worker_tracker"
      MPLCONFIGDIR: "/tmp/.matplotlib"
      RASA_MODEL_SERVER: "http://rasa-x:5002/api/projects/default/models/tags/production"

  app:
    restart: always
    image: "rasa/rasa-x-demo:${RASA_X_DEMO_VERSION}"
    expose:
      - "5055"
    depends_on:
      - rasa-production

  db:
    restart: always
    user: "1000"
    image: "bitnami/postgresql:11.9.0"
    expose:
      - "5432"
    environment:
      POSTGRESQL_USERNAME: "${DB_USER:-admin}"
      POSTGRESQL_PASSWORD: "${DB_PASSWORD}"
      POSTGRESQL_DATABASE: "${DB_DATABASE:-rasa}"
    volumes:
      - ./db:/bitnami/postgresql

  rabbit:
    restart: always
    image: "bitnami/rabbitmq:3.8.14"
    environment:
      RABBITMQ_HOST: "rabbit"
      RABBITMQ_USERNAME: "user"
      RABBITMQ_PASSWORD: ${RABBITMQ_PASSWORD}
      RABBITMQ_DISK_FREE_LIMIT: "{mem_relative, 0.1}"
    expose:
      - "5672"

  duckling:
    restart: always
    image: "rasa/duckling:0.1.6.5-r0"
    expose:
      - "8000"
    command: ["duckling-example-exe", "--no-access-log", "--no-error-log"]

  nginx:
    restart: always
    image: "nginx:1.19"
    ports:
      - "80:8080"
      - "443:8443"
    volumes:
      - ./certs:/etc/certs
      - ./nginx-config-files/nginx.conf:/etc/nginx/nginx.conf
      - ./nginx-config-files/ssl.conf.template:/etc/nginx/templates/ssl.conf.template
      - ./nginx-config-files/rasax.nginx.template:/etc/nginx/templates/rasax.nginx.template
    environment:
      <<: *nginx-host-variables
    depends_on:
      - rasa-x
      - rasa-production
      - app

  redis:
    restart: always
    image: "bitnami/redis:6.2.1"
    environment:
      REDIS_PASSWORD: ${REDIS_PASSWORD}
    expose:
      - "6379"

@sara-tagger
Copy link
Collaborator

Thanks for the issue, @ArjaanBuijk will get back to you about it soon!

You may find help in the docs and the forum, too 🤗

@gioppoluca
Copy link
Author

Some other feedback to try to add more elements to the debug process.
Inspecting the logs seems that rabbit is not logging anything.
If I understood well rasa-production after having processed the input should send an event in rabbit queue so that rasa-x become aware of the execution.

Looking at rabbitmq we have this:

rabbitmq-diagnostics list_queues
Timeout: 60.0 seconds ...
Listing queues for vhost / ...
name	messages
rasa_production_events	0

So seems that no one sent any events.
rasa-production gets its configuration from rasa-x and seems to get if correctly BUT nothing happen

@gioppoluca
Copy link
Author

tryed to update to rasa-x 0.39.3 but no luck ... still hanging

@mvielkind
Copy link
Contributor

mvielkind commented May 7, 2021

@gioppoluca this sounds similar to this issue in the forums. Could you try accessing Rabbit from the rasa-production container to see if you can get a response?

Rasa X not showing responses

@gioppoluca
Copy link
Author

Changed:

 RABBITMQ_DISK_FREE_LIMIT: "{mem_relative, 0.1}"

to

 RABBITMQ_DISK_FREE_ABSOLUTE_LIMIT: 512mb

as suggested in the forum and now it works.
Maybe changing the docker compose file and the documentation will also help others

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

No branches or pull requests

3 participants