Unable to run custom actions on rasa X

Hello, I have followed the rasa masterclass ep.9 and was trying to deploy my bot on rasa X. I have followed every step in the video and my bot is also working on rasa X. But, my custom actions don’t seem to work at all. In fact, I am getting this warning on running sudo docker-compose up -d

`WARNING: Service "app" is using volume "/app/actions" from the previous container. Host mapping "/etc/rasa/actions" has no effect. Remove the existing containers (with `docker-compose rm app`) to usRecreating rasa_app_1`

Can somebody help me fix this issue. I’ll appreciate any help.

Hi @vishal_a, sorry we missed this post. Seems like maybe you have other containers running already before running sudo docker-compose up -d? You can check with sudo docker ps to see what’s already running and maybe already using that volume.

Hi @erohmensing, thanks for the reply. There are no other containers running at the moment. And I’m still getting the same error.

Ok. Can you remove all the stopped containers with sudo docker container prune and try again?

If you could share your docker-compose file and project directory structure, that would probably be helpful too :slight_smile:

@vishal_a did you find a fix to your issue?

Hi @erohmensing,

I followed this link to deploy rasa chatbot using docker in Linux.

rasa-x iInstallation path is: /etc/rasa

Deployment successfully and integrated with web UI working fine with basic queries(without actions.py) like small talk. but if I hit actions.py from rasa-x interactive didnt get any response. action file: /etc/rasa/actions.py

I created docker-compose.override.yml for actions.py

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

and my when I try docker ps my rasa sdk is restarting every time. please find the image.

actions is not working please help me to fix.

@siva Looks like you are mounting a directory actions instead of your file actions.py. So the correct mount here would be

volumes:
  - ./actions.py:/app/actions/actions.py

Thought I believe you’ll also need an __init__.py in that /app/actions folder for it to register your classes.

The proper way to deploy the action server is by building an image. This way you don’t have to copy code to and from your server.

Hi @erohmensing,

Thank you for your response.

I followed your suggestion. have created actions folder and copied my actions.py file in to actions/actions.py file.

i have created__init__.py and requirements-action.txt(python dependencies which i used in local system) file inside actions folder after that created Dockerfile as per documentation then I ran below code to build the docker image:

docker build . -t gitrepo_name/<git_repository_name>:version_1

I am getting below error when i build docker image - python libraries are not installing properly:

can you tell me am i going right way or not? please help me to fix these issue.

Hi @erohmensing,

Finally I connected rasa x with custom action server using docker image,

issue was some error with python dependencies from the requirement-actions.txt file, then instead of requirement-action.txt i just mentioned the python packages from actions.py file directly in to DockerFile like below,

RUN pip install --upgrade pip && \
pip install --no-cache-dir mysql-connector fuzzywuzzy numpy pandas && \
pip install --no-cache-dir matplotlib

then i created Dockerfile. now everything is working fine.