Updating addon configuration options from CLI

The following is for hassio running on a pi.

I had to uninstall and reinstall the mariadb addon due to some data corruption. I have a dump of the events and the states tables, so I wanted to try and get the db addon up and running and import the state/event data before relaunching the core.

So, I was trying to start the mariadb addon from the CLI, but it can’t start until you configure a password for the db. I was trying to find a way to set the options from the CLI, but was running into a brick wall. I really want to understand the architecture of HA better with all the docker containers, etc.

If the mariadb addon has not started, there is no docker container for it, otherwise, it would be easy to start a shell in that container and modify the options.

I can get into the supervisor docker container and I see that in the /data folder is a file called addons.json. In that file are all the installed addons configurations including the options that have been set via the UI. However, if I modify that file and try to launch the mariadb addon, it still doesn’t start. If I reload the supervisor (ha supervisor reload), the addons.json gets reset back to the version before I edited it, but my saved backup is still there.

I seem to be missing some middle man but looking everywhere in the supervisor container, I don’t see where else these options are stored.

Let me post the question. If in the UI, you go to an addon’s configuration page and change some option there and click “Save”, what happens at that point? Where does that get saved and how do the changes end up in the supervisor? My guess is there’s a folder somewhere maybe within the OS that gets mounted to /data in the supervisor docker when it gets launched?

Or is there another parent container of the supervisor? What container(s) does the OS launch? It appears the supervisor container is responsible for launching the addon containers. Is that correct?

1 Like

I think I found out where I can edit the file. In the OS, it appears to be in the path /mnt/data/supervisor. If I edit the file there, it carries over into the supervisor container.

However, I’d still like to get my other architecture questions answered.

did you ever find out more? I am running into the same probem, but there is no /mnt/data/supervisor