core: HA Core loop crashing when ZHA starts since 2023.4

The problem

Hi,

When upgrading HA Core to 2023.4.1 (and more recently, 2023.4.4), HA Core seems to crash at startup. More precisely, it crashes when ZHA starts. If I disable ZHA integration before upgrading, all goes well. When I enable ZHA after upgrade, HA Core crashes, restart, crashes, etc…

What version of Home Assistant Core has the issue?

core-2023.3.6

What was the last working version of Home Assistant Core?

core-2023.3.6

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

ZHA

Link to integration documentation on our website

https://www.home-assistant.io/integrations/zha/

Diagnostics information

I’m currently running HA Supervised, manually installed on a Raspberry Pi 3B running on Debian 11. Home Assistant 2023.3.6 Supervisor 2023.04.0 Frontend 20230309.1 - latest

configuration.yaml below

1 addon: Mosquitto Broker Integrations enabled: HACS, HASS.Agent, Supervisor, Home Connect, iRobot, Meteo, Mobile App, MQTT, Radio, RPI Power Checker, Shelly, Sun, UniFi Network, UniFi Protect, ViCare, ZHA On ZHA, I have multiple devices, mainly shades, 1 Zlinky and 2 Aqara door sensors.

I’ve had this configuration for more than 2 weeks now, running smoothly, all upgrades went well.

However, when upgrading HA Core to 2023.4.1 (and more recently, 2023.4.4), HA Core seems to crash at startup. More precisely, it crashes when ZHA starts. If I disable ZHA integration before upgrading, all goes well. When I enable ZHA after upgrade, HA Core crashes.

I’m a bit lost as I don’t see anything useful in the HA logs when I start ZHA 😦

Example YAML snippet

# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

http:
  use_x_forwarded_for: true
  trusted_proxies:
    - 10.0.3.30
    - 2a0e:XXXX:XXXX::/48

# Text to speech
tts:
  - platform: google_translate

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

recorder:
  db_url: mysql://hassio:XXXX@10.0.3.20/homeassistant?charset=utf8mb4
  purge_keep_days: 3650
  commit_interval: 60

Anything in the logs that might be useful for us?

No response

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 28 (10 by maintainers)

Most upvoted comments

Non-thread-safe operation means it will randomly cause a crash because it will modify the data in another thread and then that other thread goes to do something it it, it will fail in an unexpected way. In this case it’s likely modifying the event loop scheduling so if that fails everything collapses