Automations.yaml gone to root since upgrade (new Docker container)

Hi there;
I finally upgraded from 2021.9 to 2022.7, and I used the same process as before; copy the config contents onto a new folder, made a new docker container with 2022.7 image, and most of it worked. Few bugs, mostly from an old HACS but eventually all working.

I have an issue however, my automations.yaml (along with others) file keep reverting to root ownership, and I can’t edit on my main user (GUID=1000).

It’s never done this before, in the previous 4 upgrades via docker. Every time I change the ownership it revert back on reboot or any automatons editing via HA. The docker container settings are all the same - GUID and PUID are in the enviro vars as 1000.

Any ideas?

Hello @matticas. Ever got an answer to this?

nah mate, still stuck with this issue.

Just recently upgraded to 2023.4.x, and same thing, Automations.yaml keeps going to root, ditto scripts.yaml

Config, and lovelace yamls however are user friendly.

Sorry i’m no use to you, might be my docker config? However, my docker has been identical all along - i literally copy/paste it with new volumes every upgrade.

Thanks for getting back to me! I am also using Docker, but no clue as to what could be causing this…

Maybe the fact that the container is privileged has something to do with it. Whenever we change an automation or a script from the UI, then the file is written to as root. Check this post: Improving Docker security - non-root configuration

I also just checked inside the container, and confirmed that the python3 -m homeassistant --config /config process is running as root within the container.

Hi Alexivia;

So I tried that non-root docker install method, and it wouldn’t take correctly, heaps of random integrations were broken and not running. I didn’t spend a whole lot of time searching for it, and rolled back.

Since then, I did discover I had “chown” option enabled within Docker (using Portatiner GUI).

I disabled that, and the latest standard docker launch (2023_7_2) is behaving; automations.yaml, Scripts, etc, are all at User 1000 (mine, on the host). Ie, I can edit whenever. Copy/pasting the /config folder for each upgrade still requires voodoo, ie; sudo nautlilus, copy-paste, chown and chmod changes.

How did you check within the container that it’s root?