Permission denied when using custom docker-compose

Hi,

I’m using custom docker-compose to run rasa on VM(ubuntu-20.04), I’m getting error PermissionError: [Errno 13] Permission denied: ‘models’

docker-compose file is in etc/rasa directory, I also did this command sudo chgrp -R root /etc/rasa/* && sudo chmod -R 770 /etc/rasa/* but still get same error.

What am I missing?

FYI, model is trained already once docker image was built

@jpark2111 can you share the actual error screenshot from the docker logs ?

2022-01-31 19:29:46 WARNING  rasa.utils.common  - Failed to write global config.                                                                                                                                                              Error: [Errno 13] Permission denied: '/.config'. Skipping.
Traceback (most recent call last):
  File "/usr/local/bin/rasa", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/site-packages/rasa/__main__.py", line 118, in m                                                                                                                                                             ain
    cmdline_arguments.func(cmdline_arguments)
  File "/usr/local/lib/python3.8/site-packages/rasa/cli/run.py", line 118, in ru                                                                                                                                                             n
    args.model = _validate_model_path(args.model, "model", DEFAULT_MODELS_PATH)
  File "/usr/local/lib/python3.8/site-packages/rasa/cli/run.py", line 71, in _va                                                                                                                                                             lidate_model_path
    os.makedirs(default, exist_ok=True)
  File "/usr/local/lib/python3.8/os.py", line 223, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: 'models'

this message keeps repeating, as the docker container keeps restarting @nik202

@jpark2111 I know the solution but me confused, please share the all docker and docker-compose files and even docker ps screenshots. Thanks.

This is used for Rasa X https://rasa.com/docs/rasa-x/0.42.x/installation-and-setup/install/docker-compose#4-configure

and you sharing me Rasa Open Source debug ?

Please clear me what are you trying to archive?

Confirm me please:

  1. Do you trying to run code using Rasa X ? OR
  2. Do you trying to run code using Rasa open-source with docker and docker-compose?

Thanks.

trying to run rasa open source with docker and docker-compose. @nik202

@jpark2111 Now make sense to me :slight_smile:

Can you share the docker files please quickly?

FROM python:3.8-slim

WORKDIR /app
COPY . /app

RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
RUN python -m spacy download en_core_web_md 
RUN python -m spacy link en_core_web_md en


RUN rasa train

USER 1001

ENTRYPOINT ["rasa"]

CMD ["run", "--enable-api", "--port", "8080"]

@nik202

@jpark2111 there is no rasa install and why are you using Python 3.8-slim if you are not creating any env?

@jpark2111

For Demo use only:

FROM rasa/rasa:2.8.0
WORKDIR '/app'
COPY . /app
USER root
# WORKDIR /app
# COPY . /app
COPY ./data /app/data
RUN  rasa train
VOLUME /app
VOLUME /app/data
VOLUME /app/models
CMD ["run","-m","/app/models","--enable-api","--cors","*","--debug" ,"--endpoints", "endpoints.yml", "--log-file", "out.log", "--debug"]

Try to update your docker file, take something from code :slight_smile:

OR

Just try to mention USER root in your file and check. But, I have a doubt it will not run again.

Even, your run command doesn’t have the model and you also do not mount the model in the docker container, show how he will run the model?

The solution here is USER root that’s why it shows Permission denied.

@jpark2111 For running completely code in docker and docker-compose for Rasa Open source please visit this thread: Dockerizing my rasa chatbot application that has botfront - #11 by nik202

If you still have some burning questions or doubt, you know I’m here :slight_smile: Good Luck! I hope this will help you.

29 posts were split to a new topic: Cannot hit REST Webhook on Azure Server