Rasa action server issues

I followed this instructions

https://www.youtube.com/watch?v=1cq7TerQaXI

First initialized rasa with following command

docker run -it --rm -v $(pwd):/app rasa/rasa:2.8.13-full init --no-prompt

Then copied content from here

https://github.com/RasaHQ/how-to-rasa/tree/main/video-08-actions/data

Then trained bot

docker run -it --rm -v $(pwd):/app rasa/rasa:2.8.13-full train --debug

now changed to this guide

Building a Rasa Assistant in Docker

created network

docker network create my-project

and started action server

docker run --rm -v $(pwd)/actions:/app/actions --net my-project --name action-server rasa/rasa-sdk:2.8.2

and got following error

2021-11-12 14:59:06 INFO     rasa_sdk.endpoint  - Starting action endpoint server...
2021-11-12 14:59:06 ERROR    rasa_sdk.executor  - Failed to register package 'actions'.
Traceback (most recent call last):
  File "/opt/venv/lib/python3.8/site-packages/rasa_sdk/executor.py", line 262, in register_package
    self._import_submodules(package)
  File "/opt/venv/lib/python3.8/site-packages/rasa_sdk/executor.py", line 225, in _import_submodules
    self._import_module(full_name)
  File "/opt/venv/lib/python3.8/site-packages/rasa_sdk/executor.py", line 239, in _import_module
    module = importlib.import_module(name)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/app/actions/actions.py", line 3, in <module>
    import arrow
ModuleNotFoundError: No module named 'arrow'
paulii@vetbot7:~/demobots/uusi$ docker run --rm -v $(pwd)/actions:/app/actions --net my-project --name action-server rasa/rasa-sdk:2.8.2
2021-11-12 15:06:23 INFO     rasa_sdk.endpoint  - Starting action endpoint server...
2021-11-12 15:06:23 ERROR    rasa_sdk.executor  - Failed to register package 'actions'.
Traceback (most recent call last):
  File "/opt/venv/lib/python3.8/site-packages/rasa_sdk/executor.py", line 262, in register_package
    self._import_submodules(package)
  File "/opt/venv/lib/python3.8/site-packages/rasa_sdk/executor.py", line 225, in _import_submodules
    self._import_module(full_name)
  File "/opt/venv/lib/python3.8/site-packages/rasa_sdk/executor.py", line 239, in _import_module
    module = importlib.import_module(name)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/app/actions/actions.py", line 3, in <module>
    import arrow
ModuleNotFoundError: No module named 'arrow'

then I tried inside /action folder and it started

paulii@vetbot7:~/demobots/uusi/actions$ docker run --rm -v $(pwd)/actions:/app/actions --net my-project --name action-server rasa/rasa-sdk:2.8.2
2021-11-12 15:10:49 INFO     rasa_sdk.endpoint  - Starting action endpoint server...
2021-11-12 15:10:49 INFO     rasa_sdk.endpoint  - Action endpoint is up and running on http://0.0.0.0:5055

So then I updated endpoints

action_endpoint:
 url: "http://action-server:5055/webhook"

and started Rasa in shell mode

docker run -it -v $(pwd):/app -p 5005:5005 --net my-project rasa/rasa:2.8.13-full shell

and got error

Your input ->  what time it is
2021-11-12 15:16:15 ERROR    rasa.core.processor  - Encountered an exception while running action 'action_tell_time'.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.8/site-packages/rasa/core/actions/action.py", line 685, in run
    response = await self.action_endpoint.request(
  File "/opt/venv/lib/python3.8/site-packages/rasa/utils/endpoints.py", line 172, in request
    raise ClientResponseError(
rasa.utils.endpoints.ClientResponseError: 404, Not Found, body='b'{"error":"No registered action found for name \'action_tell_time\'.","action_name":"action_tell_time"}''

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

Traceback (most recent call last):
  File "/opt/venv/lib/python3.8/site-packages/rasa/core/processor.py", line 772, in _run_action
    events = await action.run(
  File "/opt/venv/lib/python3.8/site-packages/rasa/core/actions/action.py", line 709, in run
    raise RasaException("Failed to execute custom action.") from e
rasa.shared.exceptions.RasaException: Failed to execute custom action.

So what to try next?

@InnoOmnia

  1. Hope your mentioned all the libraries and packages in requirements.txt in docker file
  2. Hope you mention all the actions in domain.yml

Recommend: Try run whole process in the local mode before using the docker container and try use pip freeze > requirements.txt you can even use this file in docker.

1 Like

Thank you for your fast reply. Previously when I used Action server in Docker container I used requirements.txt and also Dockerfile to build action server but according this official guide

Building a Rasa Assistant in Docker

It was not anymore needed, so I tried with it.

This is how I did it before

BEST WAY 2 LINK ACTION SERVER AND RASA SERVER | DOCKER CONTAINER | Innovate Yourself

that works. So should someone update that official rasa guide?

Btw, I can’t find anywhere “solved” button?

What changes you basically did in the code as I can see in above post and in link(2nd link), it seems fine? can you be more clear in solution for othe readers?

On the otherhand rasa have mentioned the basic docker steps which is fine for running the rasa using docker, there are so many other process to run rasa with only single command using docker-compose up build. I hope you got my point?