Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing add-on with malformed map section causes the supervisor to misbehave #5484

Open
bushvin opened this issue Dec 13, 2024 · 0 comments
Labels

Comments

@bushvin
Copy link

bushvin commented Dec 13, 2024

Describe the issue you are experiencing

When creating an addon with a malformed map section causes the supervisor to misbehave.
eg:

...
map:
  - share: rw
...

(note the space between share: and rw, turning the string into a map)

results into the supervisor displaying an error (see supervisor log)
This causes the system to become unhealthy, and upon reboot, the add-ons are not behaving correctly.

What type of installation are you running?

Home Assistant OS

Which operating system are you running on?

Home Assistant Operating System

Steps to reproduce the issue

  1. import add-on with malformed map section
  2. refresh add-ons
  3. witness the error
    ...

Anything in the Supervisor logs that might be useful for us?

2024-12-13 14:02:46.246 ERROR (MainThread) [supervisor.jobs] Unhandled exception: 'type'
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 304, in wrapper
    return await self._method(obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/store/__init__.py", line 121, in reload
    await self.load()
  File "/usr/src/supervisor/supervisor/store/__init__.py", line 78, in load
    await self.data.update()
  File "/usr/src/supervisor/supervisor/store/data.py", line 121, in update
    await self._read_addons_folder(
  File "/usr/src/supervisor/supervisor/store/data.py", line 232, in _read_addons_folder
    return await self.sys_run_in_executor(_process_addons_config)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/store/data.py", line 214, in _process_addons_config
    addon_config = SCHEMA_ADDON_CONFIG(addon_config)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 259, in __call__
    return self._exec((Schema(val) for val in self.validators), v)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 382, in _exec
    v = func(v)
        ^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 205, in __call__
    return self._compiled([], data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 779, in validate_callable
    return schema(data)
           ^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/addons/validate.py", line 285, in _migrate
    if any(volume[ATTR_TYPE] == MappingType.CONFIG for volume in volumes):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/addons/validate.py", line 285, in <genexpr>
    if any(volume[ATTR_TYPE] == MappingType.CONFIG for volume in volumes):
           ~~~~~~^^^^^^^^^^^
KeyError: 'type'

System Health information

a vanilla system

System Information

version core-2024.12.2
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.13.0
os_name Linux
os_version 6.6.51-haos-raspi
arch aarch64
timezone Europe/Brussels
config_dir /config
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 14.0
update_channel stable
supervisor_version supervisor-2024.11.4
agent_version 1.6.0
docker_version 27.2.0
disk_total 879.5 GB
disk_used 4.9 GB
healthy true
supported true
host_connectivity true
supervisor_connectivity true
ntp_synchronized true
virtualization
board rpi4-64
supervisor_api ok
version_api ok
installed_addons Restic Backups (1.5.2), Advanced SSH & Web Terminal (19.0.0)
Dashboards
dashboards 2
resources 0
views 0
mode storage
Recorder
oldest_recorder_run 13 December 2024 at 10:34
current_recorder_run 13 December 2024 at 13:12
estimated_db_size 0.46 MiB
database_engine sqlite
database_version 3.45.3

Supervisor diagnostics

config_entry-hassio-01JEZSBF5ZW34BP3R20RJ09CVZ.json

Additional information

No response

@bushvin bushvin added the bug label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant