core: ZHA - Conbee II doesn't start

The problem

Upgraded to the latest beta and ZHA with a Conbee II-stick doesn’t start. Did several restarts, but no luck so far.

What is version of Home Assistant Core has the issue?

core-2021.7.0b

What was the last working version of Home Assistant Core?

core-2021.6.6

What type of installation are you running?

Home Assistant OS

Integration causing the issue

ZHA

Link to integration documentation on our website

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

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.config_entries
Source: components/zha/core/gateway.py:152
First occurred: 13:34:12 (1 occurrences)
Last logged: 13:34:12

Error setting up entry ConBee II, s/n: DE2153392 - dresden elektronik ingenieurtechnik GmbH for zha
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, 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 66, in new
    await app._load_db()
  File "/usr/local/lib/python3.9/site-packages/zigpy/application.py", line 55, 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 80, in new
    await listener.initialize_tables()
  File "/usr/local/lib/python3.9/site-packages/zigpy/appdb.py", line 65, in initialize_tables
    await self._run_migrations()
  File "/usr/local/lib/python3.9/site-packages/zigpy/appdb.py", line 684, in _run_migrations
    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: node_descriptors_v4.ieee

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 23 (19 by maintainers)

Commits related to this issue

Most upvoted comments

Yep, you’re right. user_version is 3 but it looks like a successful v4 migration already took place, both _v4 tables are fully populated.

Zigpy doesn’t currently handle downgrades very well but once I fix zigpy/zigpy#711 to handle v4 -> v3 -> v4, it should be good.

Well this could be what was causing it. I did downgrade because I had some other issues with the beta. Then I upgraded again and found out that the ZHA wasn’t working.