Home Assistant halfway crashes after a reboot and loading integrations

Hello all,

I’m not sure what is causing this but recently, whenever I initiate a reboot in HASS or restart the VM within unraid, whenever HASS boots back up and attempts to load all the integration, it will all of a sudden freeze and everything just completely stops. Reloading the browser page will just result in a perpetual spinning wheel.

If I reboot the VM, everything will initiate again normally for around a minute before it crashes again. What I’ve noticed is that two to three integrations would fail during this whole thing, Homekit Device, TP-Link Kasa Smart, and ZHA. The TP-Link integration doesn’t seem to be related to the issue but just happens to break whenever I reboot but doesn’t seem to be the cause of the crash.

However, what I’ve noticed will help fix the issue, or at least allow me to boot HASS completely, is if I’m fast enough, I can go in and disable everything inside Homekit Device, and the bootup process will complete. Usually ZHA will still say it failed setup, but if I click reload, it will reload just fine. Then I can proceed to re-enable Homekit Device one by one and everything will work normally again, until when I have to reboot HASS.

How do I gather a log for when HASS is booting up? Everything was fine until a few days ago, when I added a couple of the original Aqara Motion Sensors (not P1) to ZHA. Does anyone know of a case where the original Aqara motion sensors caused HASS to not boot up? If this is the case, why would disabling Homekit Device first fix the problem?

Any suggestions is greatly appreciated. I really hope I don’t have to part ways with the original Aqara motion sensors. I kinda need them for my bed underglow triggers.

After further testing, it looks like the root cause is definitely either one or both of the original Aqara motion sensor. I removed both from ZHA and rebooted the VM multiple times and everything booted up normally.

Is there an explanation as to why HASS works fine when I add the sensors and even use everything normally, but the moment I reboot HASS, the whole thing breaks?