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

Empty include file crashes HA on startup, new in 2024.1.4 #108446

Closed
brettonw opened this issue Jan 20, 2024 · 1 comment · Fixed by #108489
Closed

Empty include file crashes HA on startup, new in 2024.1.4 #108446

brettonw opened this issue Jan 20, 2024 · 1 comment · Fixed by #108489

Comments

@brettonw
Copy link

The problem

Empty include file crashes HA on startup:

homeassistant:
  packages: !include_dir_named packages

An "empty" file in the packages directory, including one whose contents are completely commented out, causes HA to crash hard on startup:

hass    | s6-rc: info: service s6rc-oneshot-runner: starting
hass    | s6-rc: info: service s6rc-oneshot-runner successfully started
hass    | s6-rc: info: service fix-attrs: starting
hass    | s6-rc: info: service fix-attrs successfully started
hass    | s6-rc: info: service legacy-cont-init: starting
hass    | s6-rc: info: service legacy-cont-init successfully started
hass    | s6-rc: info: service legacy-services: starting
hass    | services-up: info: copying legacy longrun home-assistant (no readiness notification)
hass    | s6-rc: info: service legacy-services successfully started
hass    | 2024-01-20 01:12:18.489 ERROR (MainThread) [root] Uncaught exception
hass    | Traceback (most recent call last):
hass    |   File "<frozen runpy>", line 198, in _run_module_as_main
hass    |   File "<frozen runpy>", line 88, in _run_code
hass    |   File "/usr/src/homeassistant/homeassistant/__main__.py", line 221, in <module>
hass    |     sys.exit(main())
hass    |              ^^^^^^
hass    |   File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
hass    |     exit_code = runner.run(runtime_conf)
hass    |                 ^^^^^^^^^^^^^^^^^^^^^^^^
hass    |   File "/usr/src/homeassistant/homeassistant/runner.py", line 188, in run
hass    |     return loop.run_until_complete(setup_and_run_hass(runtime_config))
hass    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
hass    |   File "/usr/local/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
hass    |     return future.result()
hass    |            ^^^^^^^^^^^^^^^
hass    |   File "/usr/src/homeassistant/homeassistant/runner.py", line 154, in setup_and_run_hass
hass    |     hass = await bootstrap.async_setup_hass(runtime_config)
hass    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
hass    |   File "/usr/src/homeassistant/homeassistant/bootstrap.py", line 147, in async_setup_hass
hass    |     config_dict = await conf_util.async_hass_config_yaml(hass)
hass    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
hass    |   File "/usr/src/homeassistant/homeassistant/config.py", line 501, in async_hass_config_yaml
hass    |     await merge_packages_config(hass, config, core_config.get(CONF_PACKAGES, {}))
hass    |   File "/usr/src/homeassistant/homeassistant/config.py", line 1029, in merge_packages_config
hass    |     PACKAGES_CONFIG_SCHEMA(packages)
hass    |   File "/usr/src/homeassistant/homeassistant/helpers/config_validation.py", line 588, in verify
hass    |     return cast(dict, schema(value))
hass    |                       ^^^^^^^^^^^^^
hass    |   File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 272, in __call__
hass    |     return self._compiled([], data)
hass    |            ^^^^^^^^^^^^^^^^^^^^^^^^
hass    |   File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 595, in validate_dict
hass    |     return base_validate(path, iteritems(data), out)
hass    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
hass    |   File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 433, in validate_mapping
hass    |     raise er.MultipleInvalid(errors)
hass    | voluptuous.error.MultipleInvalid: expected a dictionary for dictionary value @ data['<THE EMPTY FILE NAME>']
hass    | [06:12:18] INFO: Home Assistant Core finish process exit code 1
hass    | [06:12:18] INFO: Home Assistant Core service shutdown
hass    | s6-rc: info: service legacy-services: stopping
hass    | s6-rc: info: service legacy-services successfully stopped
hass    | s6-rc: info: service legacy-cont-init: stopping
hass    | s6-rc: info: service legacy-cont-init successfully stopped
hass    | s6-rc: info: service fix-attrs: stopping
hass    | s6-rc: info: service fix-attrs successfully stopped
hass    | s6-rc: info: service s6rc-oneshot-runner: stopping
hass    | s6-rc: info: service s6rc-oneshot-runner successfully stopped

What version of Home Assistant Core has the issue?

core-2024.1.4

What was the last working version of Home Assistant Core?

core-2024.1.3

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Core

Link to integration documentation on our website

n/a

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

Possibly related to this change:
#107853

@ludeeus ludeeus added this to the 2024.1.5 milestone Jan 20, 2024
@frenck frenck removed this from the 2024.1.5 milestone Jan 20, 2024
@RoboMagus
Copy link
Contributor

RoboMagus commented Jan 20, 2024

#108426

Please DO check for existing issues before creating a new one.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants