supervisor: Addons with `schema: false` are broken in 2021.02.5
Describe the issue
Home Assistant addons that does not specify configuration schema
seems to be broken. All provided settings are filtered out.
https://developers.home-assistant.io/docs/add-ons/configuration/ documentation tells:
Key | Type | Required | Description |
---|---|---|---|
schema | dict | no | Schema for options value of the add-on. It can be false to disable schema validation and use custom options. |
If addon uses schema: false
it will not be able to read any configuration from options.json
Example config here: https://github.com/ParadoxAlarmInterface/hassio-repository/blob/master/paradox_alarm_interface/config.json
Supervisor just strips all configuration options out.
I think bug was introduced with this change: https://github.com/home-assistant/supervisor/pull/2510/files
Steps to reproduce
- Update HA OS from 5.10 to 5.11
- Some plugins stop accepting configuration: https://github.com/ParadoxAlarmInterface/pai/issues/199
Enviroment details
- Operating System:: RPI4 HA OS
- Supervisor version:: 2021.02.5
- Home Assistant version: 2021.2.1
Supervisor logs
Supervisor logs
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options LOGGING_FILE
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options LOGGING_LEVEL_CONSOLE
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options LOGGING_LEVEL_FILE
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options LOGGING_DUMP_PACKETS
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options LOGGING_DUMP_MESSAGES
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options LOGGING_DUMP_STATUS
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options LOGGING_DUMP_EVENTS
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options CONNECTION_TYPE
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options SERIAL_PORT
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options SERIAL_BAUD
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options IP_CONNECTION_HOST
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options IP_CONNECTION_PORT
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options IP_CONNECTION_PASSWORD
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options IP_CONNECTION_SITEID
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options IP_CONNECTION_EMAIL
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options IP_CONNECTION_PANEL_SERIAL
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options IP_CONNECTION_BARE
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options LIMITS
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options SYNC_TIME
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options PASSWORD
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options MQTT_ENABLE
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options MQTT_HOST
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options MQTT_PORT
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options MQTT_USERNAME
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options MQTT_PASSWORD
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options MQTT_RETAIN
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options MQTT_BIND_ADDRESS
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options MQTT_BIND_PORT
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options MQTT_HOMEASSISTANT_AUTODISCOVERY_ENABLE
21-02-08 20:36:01 WARNING (MainThread) [supervisor.addons.options] Unknown options MQTT_PUBLISH_STATUS
21-02-08 20:36:03 WARNING (MainThread) [supervisor.addons.options] Unknown options port
System Information
System Information
arch: aarch64
channel: stable
docker: 19.03.13
features:
- reboot
- shutdown
- services
- network
- hostname
- hassos
hassos: "5.11"
homeassistant: 2021.2.2
hostname: homeassistant
logging: info
machine: raspberrypi4-64
operating_system: Home Assistant OS 5.11
state: running
supervisor: 2021.02.6
supported: true
supported_arch:
- aarch64
- armv7
- armhf
timezone: Europe/Brussels
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 4
- Comments: 30 (14 by maintainers)
Commits related to this issue
- fix configuration workaround for https://github.com/home-assistant/supervisor/issues/2540 — committed to ArtistAOP/hassio by ArtistAOP 3 years ago
I would lobby for bringing the old behavior back as well - this change has broken the room-assistant add-on for a lot of users without warning (or at least I didn’t read anything about this before my users approached me on GitHub with the issue). Bringing the complex option tree under schema validation is quite difficult. Last time I tried I failed to depict the YAML tree using the schema correctly, which is the whole reason I disabled it.
I would be interested to hear more about the reasoning for this change.
EDIT:
This alone makes it impossible for me to write a schema for the room-assistant config. Only way to make it work is by making the application config YAML an inline document, which is a breaking change and isn’t great from a UX point of view imo.
EDIT 2:
According to a conversation on Discord this limitation doesn’t really exist and was more meant as a recommendation. That would make some parts of my previous arguments void, but it still doesn’t allow for some flexibility features such as polytypes. Writing a schema is also still a time consuming task for projects with bigger configs.
I really doubt if I will be able to create a valid json schema that would cover all the options I have in my addon. JSON schema format is so limited.
IMHO, that is a bad idea in general. I (personally) would not support it.
@frenck and @pvizeli So with this “fix” you have broken 3 addons. Can you please at least tell us why this “fix” was required and what it actually solves? You just forced addon developers to write and maintain two separate config validation solutions in a different repos. Keeping them in sync is extra useless effort. Why supervisor deals with validation at all. It is not its responsibility. Only addon knows what setting combination is valid and what is not. Ok, let it do it for addons with simple configuration if a dev wants it. But why it must enforce schema validation for all? I do not understand.
@frenck How can I specify in schema so a sub dict could have any keys and values?
And please reopen this issue if you do not want people to create another dozen of dupes. Our debate is in progress. Closing the issue before a solution is found is a bad manner.
@pvizeli Even if you see your approach as the correct behavior, what was done was a breaking change without a prior notification. IMHO, you should mark “schema: false” as deprecated, specify some kind of deadline for removal and allow devs of the addons that use it to align, then when your deadline arrived you can remove it. It’s really a bad approach to introduce such drastic changes in bevahior without prior notification.
I can say I’m rather new to HA (using it for about two years) but the number of times the Supervisor updates is breaking things is pretty uneasy. And on-top of that you can’t downgrade the Supervisor so you get back to a release which was working for you (until the broken thing gets fixed) because there’s the auto-upgrade feature (which I understand the reason for, sure).
Maybe a “postpone auto-updates for x days” CLI option when downgrading the Supervisor would be helpful. Even Windows 10 with their aggressive Updates allows for posponing them 😃. Think about it.
That was stale documentation: https://github.com/home-assistant/developers.home-assistant/pull/800
So we fix the bug and not created one 😃