Actions_weather not responding in rasa-x

My bot gets stuck when it should run actions_weather.

Can some one please help me with this?

Thanks

Hi,

@elise Can you please help with this?

Regards

Hey @ishanarya14

Looks like your action server is not responding. Did you check the logs?

Hi @degiz, Yes , i checked the logs. There was no error in the command prompt

Thanks

Hey try rasa interactive in one shell and rasa run actions in other shell. It will show you the error.

You can also try " rasa run -m models --enable-api --cors “*” --debug "

Hi @athenasaurav, I am getting this error only while i run it in Rasa-X.

When i just run my bot in terminal, my action_weather works just fine and it gives proper results.

Can you mention your versiom

@athenasaurav : rasa x version I am using : 0.28.2

I guess ur using it on windows?

@athenasaurav, yes I am using it on Windows. But like I am using Google cloud platform and docker compose . So I am running it on like Ubuntu. Like I followed same instructions provided in the tutorial of rasa masterclass

okay do you have any custom dependencies in your actions file? you install the rasa on GCP using docker? i was considering it a local host issue

hi @athenasaurav and @Juste, @akelad , for your reference I am attaching two files. 1.File1: bot functioning properly in rasa shell, 2. File2: when I run the same bot on Rasa-X, the action_weather doesnot return result 3. File3: My actions.py file

Thanks

actions.py (1.3 KB)

Hey @degiz for your reference I am attaching two files. 1.File1: bot functioning properly in rasa shell, 2. File2: when I run the same bot on Rasa-X, the action_weather doesnot return result 3. File3: My actions.py file

and when I run docker-compose logs , i get the following error:

ERROR: Couldn’t connect to Docker daemon at http+docker://localhost - is it running? If it’s at a non-standard location, specify the URL with the DOCKER_HOST environment variable.

actions.py (1.3 KB)

Hey @ishanarya14, could you try running sudo docker-compose logs rasa-production as well as sudo docker-compose logs app and post the output here? I assume you installed Rasa X using docker compose?

Hello @akelad I changed my endpoints.yml file exactly instead of localhost:5055 I wrote my_server_ip:5055 and in docker-compose.override.yml file (in picture) i changed volumesrasax .It works correctly in rasa shell but rasa x does not reply with custom actions

Hello pardon for late reply. Did you installed rasa X using this link Docker-Compose Quick Install

Or you installed using docker container and rasa installation method.

In case u used the link above mentioned. Can you do docker ps and check the action server container status using docker logs

You will see why actions server is not responding.

One more thing after creating custom image and writing the docker-compose.override.yml file. Did you do a Sudo docker-compose down first and then Sudo docker-compose up -d.

Hi @akelad, when I run sudo docker-compose logs rasa-production

ishanarya14@rasa-x-weather:/etc/rasa$ sudo docker-compose logs rasa-production
Attaching to rasa_rasa-production_1
rasa-production_1  | /opt/venv/lib/python3.7/site-packages/rasa/core/brokers/pika.py:294: FutureWarning: Your Pika event broker config c
ontains the deprecated `queue` key. Please use the `queues` key instead.
rasa-production_1  |   self.queues = self._get_queues_from_args(queues, kwargs)
rasa-production_1  | 2020-05-16 14:28:41 ERROR    pika.adapters.utils.io_services_utils  - Socket failed to connect: <socket.socket fd=2
1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('172.19.0.8', 43384)>; error=111 (Connection refused)
rasa-production_1  | 2020-05-16 14:28:41 ERROR    pika.adapters.utils.connection_workflow  - TCP Connection attempt failed: ConnectionRe
fusedError(111, 'Connection refused'); dest=(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('172.19.0.4', 5672))
rasa-production_1  | 2020-05-16 14:28:41 ERROR    pika.adapters.utils.connection_workflow  - AMQPConnector - reporting failure: AMQPConn
ectorSocketConnectError: ConnectionRefusedError(111, 'Connection refused')
rasa-production_1  | 2020-05-16 14:28:46 ERROR    pika.adapters.utils.io_services_utils  - Socket failed to connect: <socket.socket fd=2
5, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('172.19.0.8', 43400)>; error=111 (Connection refused)
rasa-production_1  | 2020-05-16 14:28:46 ERROR    pika.adapters.utils.connection_workflow  - TCP Connection attempt failed: ConnectionRe
fusedError(111, 'Connection refused'); dest=(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('172.19.0.4', 5672))
rasa-production_1  | 2020-05-16 14:28:46 ERROR    pika.adapters.utils.connection_workflow  - AMQPConnector - reporting failure: AMQPConn
ectorSocketConnectError: ConnectionRefusedError(111, 'Connection refused')
rasa-production_1  | 2020-05-16 14:29:42.655625: E tensorflow/stream_executor/cuda/cuda_driver.cc:351] failed call to cuInit: UNKNOWN ER
ROR (303)
rasa-production_1  | /opt/venv/lib/python3.7/site-packages/sklearn/externals/joblib/__init__.py:15: FutureWarning: sklearn.externals.job
lib is deprecated in 0.21 and will be removed in 0.23. Please import this functionality directly from joblib, which can be installed wit
h: pip install joblib. If this warning is raised when loading pickled models, you may need to re-serialize those models with scikit-lear
n 0.21+.
rasa-production_1  |   warnings.warn(msg, category=FutureWarning)
rasa-production_1  | /opt/venv/lib/python3.7/site-packages/rasa/core/policies/keras_policy.py:265: FutureWarning: 'KerasPolicy' is depre
cated and will be removed in version 2.0. Use 'TEDPolicy' instead.
rasa-production_1  |   current_epoch=meta["epochs"],
rasa-production_1  | 2020-05-16 14:30:28 ERROR    rasa.core.brokers.pika  - Could not open Pika channel at host 'rabbit'. Failed with er
ror: Channel is closed.
rasa-production_1  | /opt/venv/lib/python3.7/site-packages/rasa/core/policies/keras_policy.py:265: FutureWarning: 'KerasPolicy' is depre
cated and will be removed in version 2.0. Use 'TEDPolicy' instead.
rasa-production_1  |   current_epoch=meta["epochs"],
rasa-production_1  | 2020-05-16 14:31:46 ERROR    rasa.core.processor  - Encountered an exception while running action 'action_weather'.
 Bot will continue, but the actions events are lost. Please check the logs of your action server for more information.

when I run sudo docker-compose logs app

ishanarya14@rasa-x-weather:/etc/rasa$ sudo docker-compose logs app
Attaching to rasa_app_1
app_1              | 2020-05-16 14:28:34 INFO     rasa_sdk.endpoint  - Starting action endpoint server...
app_1              | 2020-05-16 14:28:34 INFO     rasa_sdk.executor  - Registered function for 'action_weather'.
app_1              | /app/rasa_sdk/utils.py:159: UserWarning: Your versions of rasa and rasa_sdk might not be compatible. You are curren
tly running rasa version 1.10.0 and rasa_sdk version 2.0.0a1.
app_1              | To ensure compatibility use the same version for both, modulo the last number, i.e. using version A.B.x the numbers
 A and B should be identical for both rasa and rasa_sdk.
app_1              |   f"Your versions of rasa and "
app_1              | Exception occurred while handling uri: 'http://app:5055/webhook'
app_1              | Traceback (most recent call last):
app_1              |   File "/opt/venv/lib/python3.7/site-packages/sanic/app.py", line 976, in handle_request
app_1              |     response = await response
app_1              |   File "/app/rasa_sdk/endpoint.py", line 102, in webhook
app_1              |     result = await executor.run(action_call)
app_1              |   File "/app/rasa_sdk/executor.py", line 388, in run
app_1              |     events = action(dispatcher, tracker, domain)
app_1              |   File "/app/actions/actions.py", line 10, in run
app_1              |     from apixu.client import ApixuClient
app_1              | ModuleNotFoundError: No module named 'apixu'

yes,I installed rasa-x using docker compose

Hey @athenasaurav, when I run sudo docker-compose logs rasa-production

ishanarya14@rasa-x-weather:/etc/rasa$ sudo docker-compose logs rasa-production
Attaching to rasa_rasa-production_1
rasa-production_1  | /opt/venv/lib/python3.7/site-packages/rasa/core/brokers/pika.py:294: FutureWarning: Your Pika event broker config c
ontains the deprecated `queue` key. Please use the `queues` key instead.
rasa-production_1  |   self.queues = self._get_queues_from_args(queues, kwargs)
rasa-production_1  | 2020-05-16 14:28:41 ERROR    pika.adapters.utils.io_services_utils  - Socket failed to connect: <socket.socket fd=2
1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('172.19.0.8', 43384)>; error=111 (Connection refused)
rasa-production_1  | 2020-05-16 14:28:41 ERROR    pika.adapters.utils.connection_workflow  - TCP Connection attempt failed: ConnectionRe
fusedError(111, 'Connection refused'); dest=(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('172.19.0.4', 5672))
rasa-production_1  | 2020-05-16 14:28:41 ERROR    pika.adapters.utils.connection_workflow  - AMQPConnector - reporting failure: AMQPConn
ectorSocketConnectError: ConnectionRefusedError(111, 'Connection refused')
rasa-production_1  | 2020-05-16 14:28:46 ERROR    pika.adapters.utils.io_services_utils  - Socket failed to connect: <socket.socket fd=2
5, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('172.19.0.8', 43400)>; error=111 (Connection refused)
rasa-production_1  | 2020-05-16 14:28:46 ERROR    pika.adapters.utils.connection_workflow  - TCP Connection attempt failed: ConnectionRe
fusedError(111, 'Connection refused'); dest=(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('172.19.0.4', 5672))
rasa-production_1  | 2020-05-16 14:28:46 ERROR    pika.adapters.utils.connection_workflow  - AMQPConnector - reporting failure: AMQPConn
ectorSocketConnectError: ConnectionRefusedError(111, 'Connection refused')
rasa-production_1  | 2020-05-16 14:29:42.655625: E tensorflow/stream_executor/cuda/cuda_driver.cc:351] failed call to cuInit: UNKNOWN ER
ROR (303)
rasa-production_1  | /opt/venv/lib/python3.7/site-packages/sklearn/externals/joblib/__init__.py:15: FutureWarning: sklearn.externals.job
lib is deprecated in 0.21 and will be removed in 0.23. Please import this functionality directly from joblib, which can be installed wit
h: pip install joblib. If this warning is raised when loading pickled models, you may need to re-serialize those models with scikit-lear
n 0.21+.
rasa-production_1  |   warnings.warn(msg, category=FutureWarning)
rasa-production_1  | /opt/venv/lib/python3.7/site-packages/rasa/core/policies/keras_policy.py:265: FutureWarning: 'KerasPolicy' is depre
cated and will be removed in version 2.0. Use 'TEDPolicy' instead.
rasa-production_1  |   current_epoch=meta["epochs"],
rasa-production_1  | 2020-05-16 14:30:28 ERROR    rasa.core.brokers.pika  - Could not open Pika channel at host 'rabbit'. Failed with er
ror: Channel is closed.
rasa-production_1  | /opt/venv/lib/python3.7/site-packages/rasa/core/policies/keras_policy.py:265: FutureWarning: 'KerasPolicy' is depre
cated and will be removed in version 2.0. Use 'TEDPolicy' instead.
rasa-production_1  |   current_epoch=meta["epochs"],
rasa-production_1  | 2020-05-16 14:31:46 ERROR    rasa.core.processor  - Encountered an exception while running action 'action_weather'.
 Bot will continue, but the actions events are lost. Please check the logs of your action server for more information.

when I run sudo docker-compose logs app

ishanarya14@rasa-x-weather:/etc/rasa$ sudo docker-compose logs app
Attaching to rasa_app_1
app_1              | 2020-05-16 14:28:34 INFO     rasa_sdk.endpoint  - Starting action endpoint server...
app_1              | 2020-05-16 14:28:34 INFO     rasa_sdk.executor  - Registered function for 'action_weather'.
app_1              | /app/rasa_sdk/utils.py:159: UserWarning: Your versions of rasa and rasa_sdk might not be compatible. You are curren
tly running rasa version 1.10.0 and rasa_sdk version 2.0.0a1.
app_1              | To ensure compatibility use the same version for both, modulo the last number, i.e. using version A.B.x the numbers
 A and B should be identical for both rasa and rasa_sdk.
app_1              |   f"Your versions of rasa and "
app_1              | Exception occurred while handling uri: 'http://app:5055/webhook'
app_1              | Traceback (most recent call last):
app_1              |   File "/opt/venv/lib/python3.7/site-packages/sanic/app.py", line 976, in handle_request
app_1              |     response = await response
app_1              |   File "/app/rasa_sdk/endpoint.py", line 102, in webhook
app_1              |     result = await executor.run(action_call)
app_1              |   File "/app/rasa_sdk/executor.py", line 388, in run
app_1              |     events = action(dispatcher, tracker, domain)
app_1              |   File "/app/actions/actions.py", line 10, in run
app_1              |     from apixu.client import ApixuClient
app_1              | ModuleNotFoundError: No module named 'apixu'

yes,I installed rasa-x using docker compose

and yes I did sudo docker-compose down first and then sudo-docker compose up -d

Hello @ishanarya14 when you do sudo docker-compose logs app, you have following error that i can see:

app_1              |     from apixu.client import ApixuClient
app_1              | ModuleNotFoundError: No module named 'apixu'

When i check your previous massage about Docker-compose.override.yml file

You should update the volumes to the following, i m writing the entire docker-compose.override.yml file:


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

One more thing make sure that the actions.py and the init.py (blank .py file) are inside the actions folder that is inside the Rasa root folder. like /etc/rasa/actions/actions.py

Another issue i found that mismatch of rasa and rasa sdk version in your sudo docker compose logs app

app_1              | /app/rasa_sdk/utils.py:159: UserWarning: Your versions of rasa and rasa_sdk might not be compatible. You are curren
tly running rasa version 1.10.0 and rasa_sdk version 2.0.0a1.
app_1              | To ensure compatibility use the same version for both, modulo the last number, i.e. using version A.B.x the numbers
 A and B should be identical for both rasa and rasa_sdk.
```

Please check you docker-compose.yml file with docker-compose.override.yml file. The versions should match.

Lastly do a sudo docker-compose down and then sudo docker-compose up -d

In case the problem persist after this also try removing images with following commands one by one:
```
docker system prune --all
docker image prune --all
sudo docker-compose down
sudo docker-compose up -d
```

Hello @athenasaurav I have same problem.Difference in that my actions.py file is in this path /etc/actions/actions.py I don’t have rasa folder in etc is it necessary? My rasa-x version 0.28.3.In actions folder i have 3 files blank init.py,actions.py file with my custom actions and docker-compose.override.yml with content as you posted above. sudo docker-compose logs rasa-x gives next output:


sudo docker-compose logs rasa-production gives next error: Everything works well in rasa shell but in rasa x custom actions gets stuck.