Permission error using docker compose

I’m trying to deploy my assistant using Docker compose via the instructions here: Deploying a Rasa Open Source Assistant in Docker Compose.

I have a Ubuntu (20.4) server. However, running “sudo docker-compose up” I get a “PermissionError: [Errno 13] Permission denied: ‘models’” along with other permission access errors trying to attach to my container. I’ve resorted to operating as the root user, still nothing.

I have mounted the etc/rasa directories and opened up permissions, but I didn’t think I needed to do that anyways for Rasa Open Source. What am I missing?

Full error:

Starting albert_rasa_1 … done Starting albert_app_1 … done Attaching to albert_app_1, albert_rasa_1 app_1 | 2021-02-21 23:22:54 INFO rasa_sdk.endpoint - Starting action endpoint server… app_1 | 2021-02-21 23:22:54 INFO rasa_sdk.executor - Registered function for ‘action_hello_world’. app_1 | 2021-02-21 23:22:54 INFO rasa_sdk.endpoint - Action endpoint is up and running on http://localhost:5055 rasa_1 | Matplotlib created a temporary config/cache directory at /tmp/matplotlib-3z822bk2 because the default path (/.config/matplotlib) is not a writable directory; it is highly recommended to set the MPLCONFIGDIR environment variable to a writable directory, in particular to speed up the import of Matplotlib and to better support multiprocessing. rasa_1 | 2021-02-21 23:22:56.061967: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library ‘libcudart.so.10.1’; dlerror: libcudart.so.10.1: cannot open shared object file: No such file or directory rasa_1 | 2021-02-21 23:22:56.062724: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. rasa_1 | 2021-02-21 23:22:59 WARNING rasa.utils.common - Failed to write global config. Error: [Errno 13] Permission denied: ‘/.config’. Skipping. rasa_1 | Traceback (most recent call last): rasa_1 | File “/opt/venv/bin/rasa”, line 8, in rasa_1 | sys.exit(main()) rasa_1 | File “/opt/venv/lib/python3.8/site-packages/rasa/main.py”, line 116, in main rasa_1 | cmdline_arguments.func(cmdline_arguments) rasa_1 | File “/opt/venv/lib/python3.8/site-packages/rasa/cli/run.py”, line 113, in run rasa_1 | args.model = _validate_model_path(args.model, “model”, DEFAULT_MODELS_PATH) rasa_1 | File “/opt/venv/lib/python3.8/site-packages/rasa/cli/run.py”, line 71, in _validate_model_path rasa_1 | os.makedirs(default, exist_ok=True) rasa_1 | File “/usr/lib/python3.8/os.py”, line 223, in makedirs rasa_1 | mkdir(name, mode) rasa_1 | PermissionError: [Errno 13] Permission denied: ‘models’ albert_rasa_1 exited with code 1

Hey @zen_alchemist,

Are you trying to run this in etc/rasa? Since you’re not using Rasa X, have you tried just running it in your user’s home directory?

I was originally running it in the user’s home directory, with the same issues. I was able to work around the issue for now by opening up permissions to the root group for the entire “opt/” directory. Do you think that’s a sustainable solution?

hmm I’m not sure actually, it should be fine but I’ll ask around. Did you change permissions to 777 or change the user to yourself?

I changed it to the root group and then permissions to 777. I gracefully copied the command “sudo chgrp -R root /etc/rasa/* && sudo chmod -R 777 /etc/rasa/*” from here but ran them for /opt instead.

Do you know why I was having permissions issues initially? Makes me a bit uneasy not to know why I had to use this workaround.

hey @zen_alchemist sorry I missed your last message.

I think by default your user doesn’t have the right permissions to use /opt on a VM but it’s where python installs the packages. So I believe it’s pretty standard to change the permissions to allow your user access to these packages.

Cool. Glad it’s a standard. Thanks for getting back to me!

1 Like