ZHA not loading

Hya,

after updating HA to latest (2022.2.2), i’ve find out the following error.

Sonoff Zigbee 3.0 USB Dongle Plus, s/n: 529856d799c9eb11a1a68b4f1d69213e - ITead

Zigbee Home Automation

Not loaded

Log shows:

2022-02-06 13:31:34 ERROR (MainThread) [homeassistant.loader] Unexpected exception importing component homeassistant.components.zha
Traceback (most recent call last):
  File "/var/homeassistant/lib/python3.9/site-packages/homeassistant/loader.py", line 547, in get_component
    cache[self.domain] = importlib.import_module(self.pkg_path)
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/var/homeassistant/lib/python3.9/site-packages/homeassistant/components/zha/__init__.py", line 17, in <module>
    from . import api
  File "/var/homeassistant/lib/python3.9/site-packages/homeassistant/components/zha/api.py", line 21, in <module>
    from .core.const import (
  File "/var/homeassistant/lib/python3.9/site-packages/homeassistant/components/zha/core/__init__.py", line 4, in <module>
    from .device import ZHADevice
  File "/var/homeassistant/lib/python3.9/site-packages/homeassistant/components/zha/core/device.py", line 27, in <module>
    from . import channels, typing as zha_typing
  File "/var/homeassistant/lib/python3.9/site-packages/homeassistant/components/zha/core/channels/__init__.py", line 13, in <module>
    from . import (  # noqa: F401
  File "/var/homeassistant/lib/python3.9/site-packages/homeassistant/components/zha/core/channels/base.py", line 18, in <module>
    from ..const import (
  File "/var/homeassistant/lib/python3.9/site-packages/homeassistant/components/zha/core/const.py", line 7, in <module>
    import bellows.zigbee.application
  File "/var/homeassistant/lib/python3.9/site-packages/bellows/zigbee/application.py", line 9, in <module>
    import zigpy.application
  File "/var/homeassistant/lib/python3.9/site-packages/zigpy/application.py", line 8, in <module>
    import zigpy.appdb
  File "/var/homeassistant/lib/python3.9/site-packages/zigpy/appdb.py", line 60, in <module>
    sqlite3 = _import_compatible_sqlite3(min_version=MIN_SQLITE_VERSION)
  File "/var/homeassistant/lib/python3.9/site-packages/zigpy/appdb.py", line 53, in _import_compatible_sqlite3
    raise RuntimeError(
RuntimeError: zigpy requires SQLite 3.24.0 or newer. If your distribution does not provide a more recent release, install pysqlite3 with `pip install pysqlite3-binary`
2022-02-06 13:31:34 ERROR (MainThread) [homeassistant.setup] Setup failed for zha: Unable to import component: Exception importing homeassistant.components.zha

Any help is welcome.

Thx in advance

The reason among with a possible solution is obvious …

thank you. what i have:

# sqlite3 --version
3.38.0 2022-02-06 11:51:23 a7a5af327ba8bafcd58b828e3e7a10d0008bb780d55a6c573aa15896dcc8ab89

that’s why i asked.

Okay. But - is the version installed the version used by HA? What is your HA installation type?

HA core. bare metal on ubuntu. sqlite3 build by hand.

as required is SQLite 3.24.0 or newer, i built the latest from source.

it’s the only version. i had 3.22 instaled, due the error, i removed the 3.22 and built the 3.38.

Sorry, but I cannot help as I use HA Container to avoid that dependency hell.

thank you.

Just update sqlite3 using apt. It solved the problem for me.

# Before updating
sqlite3 --version
3.16.2 2017-01-06 16:32:41 a65a62893ca8319e89e48b8a38cf8a59c69a8209

# Update sqlite3
sudo apt install sqlite3

# My version is only 3.27, not 3.38
sqlite3 --version
3.27.2 2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0alt1