The server seems to start properly as I get this output in the console we running docker-compose:
INFO rasa_sdk.endpoint - Action endpoint is up and running on http://0.0.0.0:5055
However, as soon as a custom action is called, the following error arises:
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host localhost:5055 ssl:default [Connection refused]
Can anybody tell me what I am doing wrong here? I saw that several other people posted this error before, but it seems like, there is no solution yet?
Thanks in advance!
Rasa --v:
Rasa Version : 3.0.4
Minimum Compatible Version: 3.0.0
Rasa SDK Version : 3.0.2
Rasa X Version : None
Python Version : 3.7.2
Operating System : Darwin-20.6.0-x86_64-i386-64bit
Python Path : /Users/theresa/.pyenv/versions/3.7.2/bin/python3.7
A quick explanation I have 2 projects (English, German) in one repo and therefore need to rename/copy certain files. That’s what I am trying to do in the Dockerfile. Additionally, both have an importer project (each for its language) the GreetBot. I am only pasting the files of the English project as the structure is totally the same (just different language):
Dockerfile:
FROM rasa/rasa:3.0.6-full
COPY config_en.yml /app/config.yml
COPY endpoints.yml /app/endpoints.yml
COPY projects/ABC_en/* /app/projects/ABC_en/
COPY projects/GreetBot_en/* /app/projects/GreetBot_en/
COPY projects/ABC_en/actions/* /app/projects/ABC_en/actions/
RUN rasa train -c ./config_en.yml --out /app/models
ENTRYPOINT ["rasa"]
So I fixed the initial error. However, there seems to be still a problem with the action server.
I now get the following error when calling a custom action:
2022-02-02 14:57:33 ERROR rasa_sdk.endpoint - No registered action found for name 'action_course_set'.
ABC_en-rasa-1 | 2022-02-02 14:57:33 ERROR rasa.core.processor - Encountered an exception while running action 'action_course_set'.Bot will continue, but the actions events are lost. Please check the logs of your action server for more information.
I think the action.py is not correctly loaded or found. But I do not how to fix it. Any suggestions?
@threxx please check the code of this action action_course_set have you mentioned this in domain.yml or stories.yml or rules.yml because of this action_server not running. Even, If you have some API or etc please check.
I would also recommend running the action.py locally, fixing the issue or checking if it’s running properly or not, and then try running with docker-compose.
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
21098121d0ca rasa/rasa-sdk:latest "./entrypoint.sh sta…" About a minute ago Up About a minute 0.0.0.0:5055->5055/tcp ABC_en-action_server-1
e3836779e161 ABC_en:1.0 "rasa run -m /app/mo…" 54 minutes ago Up About a minute 0.0.0.0:5005->5005/tcp ABC_en-rasa-1
Docker-compose:
docker-compose -f docker-compose_en.yml -p abc_en up
[+] Running 2/0
⠿ Container abc_en-rasa-1 Created 0.0s
⠿ Container abc_en-action_server-1 Created 0.0s
Attaching to abc_en-action_server-1, abc_en-rasa-1
abc_en-action_server-1 | 2022-02-02 15:53:21 INFO rasa_sdk.endpoint - Starting action endpoint server...
abc_en-action_server-1 | 2022-02-02 15:53:21 INFO rasa_sdk.endpoint - Action endpoint is up and running on http://0.0.0.0:5055
abc_en-rasa-1 | 2022-02-02 15:53:24 INFO root - Starting Rasa server on http://0.0.0.0:5005
abc_en-rasa-1 | 2022-02-02 15:53:26 INFO rasa.core.processor - Loading model /app/models/20220202-145147-little-terrier.tar.gz...
And then the whole error log:
abc_en-rasa-1 | 2022-02-02 15:53:24 INFO root - Starting Rasa server on http://0.0.0.0:5005
abc_en-rasa-1 | 2022-02-02 15:53:26 INFO rasa.core.processor - Loading model /app/models/20220202-145147-little-terrier.tar.gz...
abc_en-rasa-1 | /opt/venv/lib/python3.8/site-packages/rasa/utils/train_utils.py:527: UserWarning: constrain_similarities is set to `False`. It is recommended to set it to `True` when using cross-entropy loss.
abc_en-rasa-1 | rasa.shared.utils.io.raise_warning(
abc_en-rasa-1 | 2022-02-02 15:54:16 INFO root - Rasa server is up and running.
abc_en-action_server-1 | 2022-02-02 15:56:25 ERROR rasa_sdk.endpoint - No registered action found for name 'action_course_set'.
abc_en-rasa-1 | 2022-02-02 15:56:25 ERROR rasa.core.processor - Encountered an exception while running action 'action_course_set'.Bot will continue, but the actions events are lost. Please check the logs of your action server for more information.
abc_en-rasa-1 | Traceback (most recent call last):
abc_en-rasa-1 | File "/opt/venv/lib/python3.8/site-packages/rasa/core/actions/action.py", line 722, in run
abc_en-rasa-1 | response = await self.action_endpoint.request(
abc_en-rasa-1 | File "/opt/venv/lib/python3.8/site-packages/rasa/utils/endpoints.py", line 173, in request
abc_en-rasa-1 | raise ClientResponseError(
abc_en-rasa-1 | rasa.utils.endpoints.ClientResponseError: 404, Not Found, body='b'{"error":"No registered action found for name \'action_course_set\'.","action_name":"action_course_set"}''
abc_en-rasa-1 |
abc_en-rasa-1 | The above exception was the direct cause of the following exception:
abc_en-rasa-1 |
abc_en-rasa-1 | Traceback (most recent call last):
abc_en-rasa-1 | File "/opt/venv/lib/python3.8/site-packages/rasa/core/processor.py", line 868, in _run_action
abc_en-rasa-1 | events = await action.run(
abc_en-rasa-1 | File "/opt/venv/lib/python3.8/site-packages/rasa/core/actions/action.py", line 746, in run
abc_en-rasa-1 | raise RasaException("Failed to execute custom action.") from e
abc_en-rasa-1 | rasa.shared.exceptions.RasaException: Failed to execute custom action.
abc_en-action_server-1 | 2022-02-02 15:56:25 ERROR rasa_sdk.endpoint - No registered action found for name 'action_get_courses_buttons'.
abc_en-rasa-1 | 2022-02-02 15:56:25 ERROR rasa.core.processor - Encountered an exception while running action 'action_get_courses_buttons'.Bot will continue, but the actions events are lost. Please check the logs of your action server for more information.
abc_en-rasa-1 | Traceback (most recent call last):
abc_en-rasa-1 | File "/opt/venv/lib/python3.8/site-packages/rasa/core/actions/action.py", line 722, in run
abc_en-rasa-1 | response = await self.action_endpoint.request(
abc_en-rasa-1 | File "/opt/venv/lib/python3.8/site-packages/rasa/utils/endpoints.py", line 173, in request
abc_en-rasa-1 | raise ClientResponseError(
abc_en-rasa-1 | rasa.utils.endpoints.ClientResponseError: 404, Not Found, body='b'{"error":"No registered action found for name \'action_get_courses_buttons\'.","action_name":"action_get_courses_buttons"}''
abc_en-rasa-1 |
abc_en-rasa-1 | The above exception was the direct cause of the following exception:
abc_en-rasa-1 |
abc_en-rasa-1 | Traceback (most recent call last):
abc_en-rasa-1 | File "/opt/venv/lib/python3.8/site-packages/rasa/core/processor.py", line 868, in _run_action
abc_en-rasa-1 | events = await action.run(
abc_en-rasa-1 | File "/opt/venv/lib/python3.8/site-packages/rasa/core/actions/action.py", line 746, in run
abc_en-rasa-1 | raise RasaException("Failed to execute custom action.") from e
abc_en-rasa-1 | rasa.shared.exceptions.RasaException: Failed to execute custom action.
I really think the action file is not loaded / copied correctly.
@nik202 Yes, abc_en:1.0 is the image I create with the DOCKERFILE mentioned above (with: docker image build -t abc_en:1.0 . -f Dockerfile). That’s why I add this to the docker-compose file. Is this not correct?
Everything builds and starts without errors. However, as soon as I make a request (with postman) to (http://localhost:5005/webhooks/rest/webhook) which uses custom actions I get the following error in the console:
rasa_server | 2022-02-03 12:13:07 ERROR rasa.core.processor - Encountered an exception while running action 'action_get_achievements'.Bot will continue, but the actions events are lost. Please check the logs of your action server for more information.
rasa_server | Traceback (most recent call last):
rasa_server | File "/opt/venv/lib/python3.8/site-packages/rasa/core/processor.py", line 868, in _run_action
rasa_server | events = await action.run(
rasa_server | File "/opt/venv/lib/python3.8/site-packages/rasa/core/actions/action.py", line 709, in run
rasa_server | raise RasaException(
rasa_server | rasa.shared.exceptions.RasaException: Failed to execute custom action 'action_get_achievements' because no endpoint is configured to run this custom action. Please take a look at the docs and set an endpoint configuration via the --endpoints flag. https://rasa.com/docs/rasa/custom-actions
I am not sure what’s wrong here as I added an endpoint and the actions server is running. Any ideas?
Maybe that helps with finding the error. I think I somehow/somewhere did not put the correct path, but I am not sure where. The stories which do not require custom actions work perfectly fine. Only the custom actions do not work.
If any action looking for the path or (seeking data) you need to provide the correct path as now you have copied everything in the container or try to provide relative path "./"
@nik202 yes abc_de and abc_en are two different projects (same project different language). So everything I am using is in abc_en and the docker-compose.yml is outside of this structure.
No worries! I actually was able to fix a lot of errors by myself (you might have seen my edits) so I had good progress. And I am very happy and so thankful that you are still trying to fix my problem here.
I am stuck with that path. I cannot figure out where I have to provide the correct path. Is it inside the docker-compose.yml or in the action Dockerfile?