Rasa upgrade fails: Failed to write global config. Error: [Errno 13] Permission denied:

I’m upgrading my chatbots to Rasa 2.x.
My environment

Docker version 20.10.6, build 370c289
18.04.1-Ubuntu
Azure cloud server

When in us this command

docker run -it --rm --user 1003 -v $(pwd):/app rasa/rasa:2.5.0-full init --no-prompt

I get following error message

WARNING rasa.utils.common - Failed to write global config. Error: [Errno 13] Permission denied: ‘/.config’. Skipping.

I also tried with sudo

sudo docker run -it --rm --user 1003 -v $(pwd):/app rasa/rasa:2.5.0-full init --no-prompt

but got same error

WARNING rasa.utils.common - Failed to write global config. Error: [Errno 13] Permission denied: ‘/.config’. Skipping.

If I try with Rasa 1.x, no error messages

docker run -it --rm --user 1003 -v $(pwd):/app rasa/rasa:1.10.11-full init --no-prompt Welcome to Rasa! :robot:

also I noticed that file ownerships has changed , from this

-rw-r–r-- 1 paulii paulii 79372 Mar 5 08:58 domain.yml

, to this

-rw-r–r-- 1 paulii root 565 Apr 12 19:50 domain.yml

What to try next?

Is your RASA_HOME using the default /etc/rasa and is there already a .config directory.

Who owns the directory:

sudo ls -l .config

The sudo should work. Do either of these work from the shell:

touch .config/test
sudo touch .config/test

Thank you for your reply

I have nothing there

[paulii@vetbot-v4 /etc TUOTANTO]$ sudo ls -l .config
ls: cannot access '.config': No such file or directory
[paulii@vetbot-v4 /etc TUOTANTO]$ touch .config/test
touch: cannot touch '.config/test': No such file or directory
[paulii@vetbot-v4 /etc TUOTANTO]$ sudo touch .config/test
touch: cannot touch '.config/test': No such file or directory
[paulii@vetbot-v4 /etc TUOTANTO]$
[paulii@vetbot-v4 /etc TUOTANTO]$ sudo ls -l .config
ls: cannot access '.config': No such file or directory
[paulii@vetbot-v4 /etc TUOTANTO]$ touch .config/test
touch: cannot touch '.config/test': No such file or directory
[paulii@vetbot-v4 /etc TUOTANTO]$ sudo touch .config/test
touch: cannot touch '.config/test': No such file or directory
[paulii@vetbot-v4 /etc TUOTANTO]$

I’m not using Rasa X which installs files to /etc/

This is your own docker-compose setup? Can your provide the docker-compose.yml?

No, it is not docker-compose, I’m planning to move there but this is direct docker command

make the .config directory

Created .config directory

/etc/rasa/.config
drwxr-xr-x 2 root root 4096 Apr 21 09:21 .config/
drwxr-xr-x 3 root root 4096 Apr 21 09:21 rasa

Still same error

 sudo docker run -it --rm --user 1003 -v $(pwd):/app rasa/rasa:2.5.0-full
2021-04-21 09:23:46 WARNING  rasa.utils.common  - Failed to write global config. Error: [Errno 13] Permission denied: '/.config'. Skipping.

I can get it working with this command

sudo docker run -it --rm --user 0 -v $(pwd):/app rasa/rasa:2.5.0-full init --no-prompt

but then my file and directories rights are root, see below, I think that will create other problems?

drwxr-xr-x  3 root   root   4096 huhti 21 13:17 actions/
-rw-r--r--  1 root   root   1352 huhti 21 13:17 config.yml
-rw-r--r--  1 root   root    980 huhti 12 22:50 credentials.yml
drwxr-xr-x  2 root   root   4096 huhti 21 13:17 data/
-rw-r--r--  1 root   root    565 huhti 12 22:50 domain.yml
-rw-r--r--  1 root   root   1411 huhti 12 22:50 endpoints.yml
drwxr-xr-x  2 root   root   4096 huhti 21 13:18 models/
drwxr-xr-x  2 root   root   4096 huhti 21 13:17 tests/
1 Like