Hi all,
Over the past couple of months, I haven’t been able to update my HA instance, because every time I do my zigbee integration fails. The configuration screen shows an error stating “failed to set up”. I finally got a chance to dig in deeper today, and here’s what I found in the logs:
HA has the following: `Logger: homeassistant.config_entries
Source: components/zha/core/gateway.py:152
First occurred: 4:25:23 PM (1 occurrences)
Last logged: 4:25:23 PM
Error setting up entry HubZ Smart Home Controller, s/n: C13019EA - Silicon Labs for zha
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 304, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/usr/src/homeassistant/homeassistant/components/zha/__init__.py", line 102, in async_setup_entry
await zha_gateway.async_initialize()
File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 152, in async_initialize
self.application_controller = await app_controller_cls.new(
File "/usr/local/lib/python3.9/site-packages/zigpy/application.py", line 61, in new
await app._load_db()
File "/usr/local/lib/python3.9/site-packages/zigpy/application.py", line 50, in _load_db
self._dblistener = await zigpy.appdb.PersistingListener.new(database_file, self)
File "/usr/local/lib/python3.9/site-packages/zigpy/appdb.py", line 85, in new
await listener.initialize_tables()
File "/usr/local/lib/python3.9/site-packages/zigpy/appdb.py", line 72, in initialize_tables
await self._run_migrations()
File "/usr/local/lib/python3.9/site-packages/zigpy/appdb.py", line 571, in _run_migrations
await migration()
File "/usr/local/lib/python3.9/site-packages/zigpy/appdb.py", line 709, in _migrate_to_v7
await self._migrate_tables(
File "/usr/local/lib/python3.9/site-packages/zigpy/appdb.py", line 593, in _migrate_tables
await self.execute(
File "/usr/local/lib/python3.9/site-packages/aiosqlite/core.py", line 184, in execute
cursor = await self._execute(self._conn.execute, sql, parameters)
File "/usr/local/lib/python3.9/site-packages/aiosqlite/core.py", line 129, in _execute
return await future
File "/usr/local/lib/python3.9/site-packages/aiosqlite/core.py", line 102, in run
result = function()
sqlite3.IntegrityError: UNIQUE constraint failed: attributes_cache_v7.ieee, attributes_cache_v7.endpoint_id, attributes_cache_v7.cluster, attributes_cache_v7.attrid
`
I searched and found a couple other people have posted this issue, but absolutely no resolution or traction toward solving it.
I also have the following database issue in my logs, which isn’t there if i reinstall a backup:
Logger: zigpy.appdb
Source: /usr/local/lib/python3.9/site-packages/zigpy/appdb.py:69
First occurred: 4:25:23 PM (1 occurrences)
Last logged: 4:25:23 PM
SQLite database file is corrupted! row 98 missing from index attributes_idx_v6 row 99 missing from index attributes_idx_v6 row 100 missing from index attributes_idx_v6 row 101 missing from index attributes_idx_v6 row 102 missing from index attributes_idx_v6 wrong # of entries in index attributes_idx_v6
Anyone have any advice as to where to start with this?