[Docker] Fail to register package actions.actions

Hi everyone,

I am trying to use rasa with Docker. I can’t seem to make action server run. When I do docker-compose up, I got the following error I’ve read all similar topics. I’ve moved actions.py in the current folder too, nothing seems to work.

action_server_1  | 2019-05-28 08:18:16 INFO     rasa_sdk.endpoint  - Starting action endpoint server...
action_server_1  | 2019-05-28 08:18:16 ERROR    rasa_sdk.executor  - Failed to register package 'actions.actions'.
action_server_1  | Traceback (most recent call last):
action_server_1  |   File "/app/rasa_sdk/executor.py", line 175, in register_package
action_server_1  |     self._import_submodules(package)
action_server_1  |   File "/app/rasa_sdk/executor.py", line 162, in _import_submodules
action_server_1  |     package = importlib.import_module(package)
action_server_1  |   File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
action_server_1  |     return _bootstrap._gcd_import(name[level:], package, level)
action_server_1  |   File "<frozen importlib._bootstrap>", line 994, in _gcd_import
action_server_1  |   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
action_server_1  |   File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
action_server_1  | ModuleNotFoundError: No module named 'actions.actions'

Here is my folder structure

+---actions\
|      |---__init__.py
|      |---actions.py
+---data\
|      |---nlu.md
|      |---stories.md
+----models\
|      |---current.tar.gz
+---config.yml
+---credentials.yml
+---docker-compose.yml
+---Dockerfile
+---domain.yml
+---endpoints.yml

My endpoints.yml

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

My docker image rasa/rasa:spacy-fr is an extension of rasa/rasa:latest-full.

My docker-compose.yml file.

version: '3.0'
services:
  rasa:
    image: rasa/rasa:spacy-fr
    ports:
      - 5005:5005
    volumes:
      - ./:/app
    command:
      - run
  action_server:
    image: rasa/rasa_sdk:latest
    volumes:
      - ./actions:/app/actions
    ports:
      - 5055:5055

Does anybody have an idea about how to fix this ? Thanks in advance.

To resolve this issue, I deleted all images and containers present on my computer and restarted the process from scratch and doker-compose worked, and the customed actions got registrated.

To delete (all) images and containers:

docker system prune --all
docker image prune --all

@tatia, thanks for the post, it’s very helpful. The latest is 3.4 now. In docker-compose.yml, the services are as below, but no “rasa” and “action_server”. Do you know how to deal with it?

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"
    depends_on:
      - db

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

  rasa-worker:
    <<: *default-rasa-service
    environment:
      <<: *rasa-credentials
      RASA_ENVIRONMENT: "worker"
      DB_DATABASE: "worker_tracker"
      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

Thanks,

@yiouyou please create a new post with your question in the Rasa X category, and we will help you out :slight_smile:

Hi, @erohmensing

Please help me with the last update of the following post, thanks a lot!