home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.03k stars 28.28k forks source link

command_line async_setup_platform raises `TypeError` `NoneType` is not subscriptable #116871

Open yarikoptic opened 1 week ago

yarikoptic commented 1 week ago

The problem

(I think after some recent upgrade) my hassio setup stopped showing its pretty web UI face. homeassistant logs showed some "bad marshal data", I did su repair two times although both didn't finish I believe and it looked like

image

so some filesystem errors... after that and reboot pretty face is still not loading fully but at least shows up and reports

image

and I can't fully get web UI interface to load -- just keeps showing

image

homeassistant logs shows

image

and looking at the code there: https://github.com/home-assistant/core/blob/dev/homeassistant/components/command_line/switch.py#L32C11-L32C31 it seems a little off as the method signature type annotation allows for it to be None: discovery_info: DiscoveryInfoType | None = None, but then unconditionally does that subscript access: discovery_info[CONF_NAME] .

What version of Home Assistant Core has the issue?

web ui doesn't load

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

bdraco commented 1 week ago

Please see https://community.home-assistant.io/t/psa-2024-5-upgrade-failure-and-dreame-vacuum-custom-integration/724612

yarikoptic commented 1 week ago

THANK YOU @bdraco . after I did core update --version 2024.4.4 I feel like I got back to prior flood of different errors, this particular traceback in addition, and web ui again similarly just

image

... actually it seems I can access Settings so will look at disabling or ugprading dreamy...

bdraco commented 1 week ago

Its also possible you have more than one integration causing issues.

Please see https://community.home-assistant.io/t/2024-5-tracking-down-instability-issues-caused-by-integrations/724441

yarikoptic commented 1 week ago

thanks again @bdraco . after upgrade of dreamy to v2.0.0b14 it doesn't load but the HA itself upgraded fine and seems to boot fine, so overall HA loading issue is resolved. I also do not observe original exception with TypeError but for that one to not happen as exception - proposing