Trouble With Rasa X 0.34 and Custom Action Server

Hello, I am trying to install Rasa X 0.34 on an EC2 machine with a custom action server and running into difficulties. I have chosen the docker compose path and will make clear below what I have tried and what is happening:

I started here with these instructions:

This instructed me to:

curl -sSL -o install.sh https://storage.googleapis.com/rasa-x-releases/0.34.0/install.sh
sudo bash ./install.sh
`...etc.`

Next I went here: Docker Compose - Connecting a Custom Action Server

But before completing these instructions, I was instructed to do this: Using the Rasa Action Server GitHub Action to automate image builds

Below is the contents of .github/workflows/action_server.yml:

on:
  push:
    branches:
      - master
    paths:
    - 'actions/**'

jobs:
  build_and_deploy:
    runs-on: ubuntu-latest
    name: Build Action Server image and upgrade Rasa X deployment
    steps:
    - name: Checkout repository
      uses: actions/checkout@v2
      with:
        token: ${{ secrets.ACTIONS_TOKEN }}

    - id: action_server
      name: Build an action server with a custom actions
      uses: RasaHQ/action-server-gha@master
      # Full list of parameters: https://github.com/RasaHQ/action-server-gha/tree/master#input-arguments
      with:
        actions_directory: actions
        docker_image_name: 'my_user_name/my_docker_repository'
        docker_registry_login: ${{ secrets.DOCKER_HUB_LOGIN }}
        docker_registry_password: ${{ secrets.DOCKER_HUB_PASSWORD }}
        rasa_sdk_version: 2.1.2
        # More details about github context:
        # https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#github-context
        #
        # github.sha - The commit SHA that triggered the workflow run
        docker_image_tag: ${{ github.sha }}

This all seemed to work well. Docker Hub successfully offered a new image every time I modified and checked in actions.py file.

I then completed the instructions, creating a ‘docker-compose.override.yml’ file on my server in /etc/rasa (below):

docker-compose.override.yml
version: '3.4'
services:
  app:
    restart: always
    image: 'my_user_name/my_docker_repository:4286266fab2c06458aa88c924582cae16efa6b79'
    volumes:
      - ./actions:/app/actions
    expose:
      - "5055"
    depends_on:
      - rasa-production

I then brought down and up the image:

sudo docker-compose down

sudo docker-compose up -d

Then inspected the running containers:

sudo docker ps -a

CONTAINER ID        IMAGE                                                                   COMMAND                  CREATED             STATUS                    PORTS                                         NAMES
58acf61369ac        rasa/nginx:0.34.0                                                       "/opt/bitnami/entryp…"   48 seconds ago      Up 47 seconds             0.0.0.0:80->8080/tcp, 0.0.0.0:443->8443/tcp   rasa_nginx_1
634882bc97d5       my_user_name/my_docker_repository:4286266fab2c06458aa88c924582cae16efa6b79   "./entrypoint.sh sta…"   49 seconds ago      Up 48 seconds             5055/tcp                                      rasa_app_1
625333b8f96c        rasa/rasa:2.1.2-full                                                    "rasa x --no-prompt …"   50 seconds ago      Up 49 seconds             5005/tcp                                      rasa_rasa-production_1
7b3a8082d4d3        rasa/rasa:2.1.2-full                                                    "rasa x --no-prompt …"   50 seconds ago      Up 47 seconds             5005/tcp                                      rasa_rasa-worker_1
24f49bd9cda3        rasa/rasa-x:0.34.0                                                      "python -m rasax.com…"   52 seconds ago      Up 51 seconds (healthy)   8000/tcp                                      rasa_db-migration_1
2691cfebc16c        rasa/rasa-x:0.34.0                                                      "sh -c 'user_id=$(id…"   52 seconds ago      Up 50 seconds             5002/tcp                                      rasa_rasa-x_1
fe3051f06ce3        rasa/duckling:0.1.6.4                                                   "duckling-example-ex…"   54 seconds ago      Up 53 seconds             8000/tcp                                      rasa_duckling_1
63b71ee4ec4f        bitnami/postgresql:11.9.0                                               "/opt/bitnami/script…"   54 seconds ago      Up 52 seconds             5432/tcp                                      rasa_db_1
c91201b191cf        bitnami/rabbitmq:3.8.9                                                  "/opt/bitnami/script…"   54 seconds ago      Up 53 seconds             4369/tcp, 5672/tcp, 15672/tcp, 25672/tcp      rasa_rabbit_1
ffb56cc5a68f        bitnami/redis:6.0.8                                                     "/opt/bitnami/script…"   54 seconds ago      Up 52 seconds             6379/tcp                                      rasa_redis_1

You can see above there is a service, ‘rasa_app_1’, running on port 5055.

After this I logged on to Rasa X server, connected my github repository, trained my models, and started chatting with bot. The first thing the bot does is call a custom Action. But no response from the bot - clearly there is something wrong:

Back to the terminal:

ubuntu@ip: /etc/rasa# docker logs rasa_app_1
2020-12-07 23:51:12 INFO     rasa_sdk.endpoint  - Starting action endpoint server...
2020-12-07 23:51:12 INFO     rasa_sdk.endpoint  - Action endpoint is up and running on http://localhost:5055
2020-12-07 23:54:21 ERROR    rasa_sdk.endpoint  - No registered action found for name 'action_session_start'.
2020-12-07 23:54:21 ERROR    rasa_sdk.endpoint  - No registered action found for name 'action_session_start'.
ubuntu@ip: /etc/rasa# 

and then:

docker logs rasa_rasa-production_1

2020-12-07 23:54:21 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.
Traceback (most recent call last):
  File "/opt/venv/lib/python3.7/site-packages/rasa/core/actions/action.py", line 612, in run
    json=json_body, method="post", timeout=DEFAULT_REQUEST_TIMEOUT
  File "/opt/venv/lib/python3.7/site-packages/rasa/utils/endpoints.py", line 155, in request
    response.status, response.reason, await response.content.read()
rasa.utils.endpoints.ClientResponseError: 404, Not Found, body='b'{"error":"No registered action found for name \'action_session_start\'.","action_name":"action_session_start"}''

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/venv/lib/python3.7/site-packages/rasa/core/processor.py", line 750, in _run_action
    output_channel, nlg, temporary_tracker, self.domain
  File "/opt/venv/lib/python3.7/site-packages/rasa/core/actions/action.py", line 635, in run
    raise RasaException("Failed to execute custom action.") from e
rasa.shared.exceptions.RasaException: Failed to execute custom action.
2020-12-07 23:54:21 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.
Traceback (most recent call last):
  File "/opt/venv/lib/python3.7/site-packages/rasa/core/actions/action.py", line 612, in run
    json=json_body, method="post", timeout=DEFAULT_REQUEST_TIMEOUT
  File "/opt/venv/lib/python3.7/site-packages/rasa/utils/endpoints.py", line 155, in request
    response.status, response.reason, await response.content.read()
rasa.utils.endpoints.ClientResponseError: 404, Not Found, body='b'{"error":"No registered action found for name \'action_session_start\'.","action_name":"action_session_start"}''

So although the action server is up and running, it doesn’t seem like it is contactable by Rasa X? I also notice that there is nothing in the 'etc/rasa/actions' directory. I feel like I am missing a step somewhere. Any help would be appreciated.

Solid outline of the problem! I am running into similar issues as well when setting up the action server on rasax 0.34.x

@mohankanni - Did you figure something out?

@Emma I’d really appreciate some help on this. Can you recommend a path to get some help? Thanks!

@jayb I’ve decided to do a fresh Install.

For a starting point, I want to get the default actions.py file working.

If everything Works on the default template I will try to put in my custom actions.py and will update you if it is working or not.

docker-compose.override.yml

version: '3.4'
services:
  app:
    image: 'rasa/rasa-sdk:latest'
    volumes:
      - ./actions:/app/actions
    expose:
      - '5055'
    depends_on:
      - rasa-production

@mohankanni Thanks!

@akelad any ideas on my issue above?

It looks like you don’t need to override volume for the app service in the docker-compose.

You mentioned that you build your Docker image, your image contains everything that you need then.

Try something like this:

docker-compose.override.yml

services:
  app:
    restart: always
    image: 'my_user_name/my_docker_repository:4286266fab2c06458aa88c924582cae16efa6b79'
    expose:
      - "5055"

@tczekajlo BRILLIANT!!! That worked. Thank you so much. I never would have suspected that line would be an issue. I will look more into exactly what that line does. Thanks, again.

@mohankanni See reply from tczekajlo below. This line turned out to be an issue for me:

volumes:
      - ./actions:/app/actions

Jay

I had the same issue where form action wasn’t found I followed (Ep #9 - Rasa Masterclass) Improving the assistant: Setting up the Rasa X | Rasa 1.8.0 - YouTube.

Didn’t follow any other steps of creating action server separately


Finally - all started working

Get Action server Image container Id by running

Run : sudo docker ps

The container Id 603339fd04e0 is mapped to Image: rasa/rasa-sdk:latest
COMMAND : "./entrypoint.sh Ports : 5055/tcp

Run: docker container restart 603339fd04e0

This is the action server, I restarted then Rasa X was able to find the actions registered, and is responding.