core icon indicating copy to clipboard operation
core copied to clipboard

ZHA integration not loading after 2023.3.0b2 upgrade

Open timiman opened this issue 2 years ago • 21 comments

The problem

After upgrading from 2023.3.0b1 to 2023.3.0b2 there is a constant message of "Home Assistant is starting, not everything will be available until it is finished." on UI, which possibly preventing ZHA integration to load. I've left it about 3h thinking it is an on-going db migration job or something but the message is still there.

What version of Home Assistant Core has the issue?

2023.3.0b2

What was the last working version of Home Assistant Core?

2023.3.0b1

What type of installation are you running?

Home Assistant OS

Integration causing the issue

ZHA, sqlite3

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?

Logger: homeassistant.components.recorder.util
Source: components/recorder/util.py:232
Integration: Recorder (documentation, issues)
First occurred: 11:07:38 am (1 occurrences)
Last logged: 11:07:38 am

The system could not validate that the sqlite3 database at //config/home-assistant_v2.db was shutdown cleanly

Additional information

Is there a way to find which task is taken so long or have been stuck ? The other logs seem clear ( Supervisor, Host ). If it is a database issue is there a way to repair it, because I cannot find any command through Terminal or on VM Box window.

Also, if I try to add a new ZHA integration, the pop-up modal get stuck at "Please wait, starting configuration wizard for Zigbee Home Automation".

timiman avatar Feb 25 '23 09:02 timiman

Also the Log Book is empty, the Automations are gone and no history data can be shown on UI at all. Possibly a Recorder issue ?

timiman avatar Feb 25 '23 10:02 timiman

I can observe exactly the same behavior after upgrading. Same behavior same log. Probably fixed with PR88751? Sounds like it could be the reason behind this bug.

Basher92 avatar Feb 25 '23 10:02 Basher92

I hope #88751 will cure this issue. I also hope that the state HA is in now will not prevent the upgrade task to be performed !

Also, when trying to restart from the new UI dialog, I get a "The system cannot restart while a database upgrade is in progress." message, thus pointing that something bad is going on DB wise.

timiman avatar Feb 25 '23 11:02 timiman

I can observe exactly the same behavior after upgrading. Same behavior same log.

bekovan avatar Feb 25 '23 11:02 bekovan

2023.3.0b3 has been released including #88751. Shortly will be available.

timiman avatar Feb 25 '23 11:02 timiman

What I was afraid of happened. The stuck task does not allow the update process to begin. Any other ways to update to 2023.3.0b3 ?

timiman avatar Feb 25 '23 12:02 timiman

@timiman you where just beating me with some minutes, same issue & same question here

bekovan avatar Feb 25 '23 12:02 bekovan

Using "ha core update --version 2023.3.0b3 --backup" wont initiate the update

timiman avatar Feb 25 '23 12:02 timiman

that's what I was afraid off. Restore and downgrade didn't work for me either... EDIT: Worked for me now

Basher92 avatar Feb 25 '23 13:02 Basher92

that's what I was afraid off. Restore and downgrade didn't work for me either... EDIT: Worked for me now

Didn´t work for me because: 23-02-25 14:46:20 ERROR (MainThread) [supervisor.utils] Can't execute update while a task is in progress

Denis19xx avatar Feb 25 '23 13:02 Denis19xx

did the task timed out or did you force this ?

bekovan avatar Feb 25 '23 14:02 bekovan

The task has been running for several hours. Then I restarted the host, unfortunately the same problem.

Denis19xx avatar Feb 25 '23 14:02 Denis19xx

I disabled ZHA, waited for around 30min. till it really showed being disabled. Restarted my HA machine, and the update showed up and I immediately pressed install. That worked for me

Basher92 avatar Feb 25 '23 15:02 Basher92

I also deactivated ZHA in the integrations section but the start still doesn't go through completely. Do I need to disable ZHA somewhere else? image

Denis19xx avatar Feb 25 '23 15:02 Denis19xx

I've recovered using a 7-days old backup of the VM. In my case nothing else helped

timiman avatar Feb 25 '23 15:02 timiman

I got it! In my case, disabling Zha AND removing the SkyConnect Stick helped. Then restart the system, update to 0b3, reboot and activate everything again + connect the stick.

Denis19xx avatar Feb 25 '23 15:02 Denis19xx

Reformat SSD + restore from manual backup update to 2023.3.0b1 did the job for me, kind of brute force solution

bekovan avatar Feb 25 '23 16:02 bekovan

Upgrade to b3

dmulcahey avatar Feb 25 '23 16:02 dmulcahey

Same problem. but i dont seem to be able to restore backup or run update 😔

Waghead avatar Feb 26 '23 09:02 Waghead

Upgrade to b3

If only it was that easy. Dave

meremortals70 avatar Feb 27 '23 05:02 meremortals70

I got it! In my case, disabling Zha AND removing the SkyConnect Stick helped. Then restart the system, update to 0b3, reboot and activate everything again + connect the stick.

Didn’t work for me unfortunately

meremortals70 avatar Feb 27 '23 05:02 meremortals70

I have tried update from 2023.2.5 to 2023.3.0 and 2023.3.1 but ZHA refuses to start. I even tried to migrate from Nortek HUSBZB-1 to SkyConnect but still same result - ZHA failed to start. Fortunately I can downgrade to 2023.2.5 where all works. zha_error

juhanjuku avatar Mar 05 '23 19:03 juhanjuku

That's very likely a completely different issue. Post more logs here (or better yet: create a new issue). And make sure you're not using any broken/outdated custom quirks.

TheJulianJES avatar Mar 05 '23 20:03 TheJulianJES

Thanks', it was quirk. When I commented out custom quirks, ZHA starts normally.

juhanjuku avatar Mar 06 '23 07:03 juhanjuku

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.