Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash - DatabaseEntry with ID already exists #22584

Open
Nezz opened this issue May 10, 2024 · 1 comment
Open

Crash - DatabaseEntry with ID already exists #22584

Nezz opened this issue May 10, 2024 · 1 comment
Labels
problem Something isn't working

Comments

@Nezz
Copy link

Nezz commented May 10, 2024

What happened?

I'm trying to reset three Tradfri lights on the same chandelier. When I do this, Z2M crashes.

[2024-05-10 21:52:36] warning: 	z2m: Device '0x980c33fffef167d8' left the network
Error: DatabaseEntry with ID '19' already exists
    at Database.insert (/app/node_modules/zigbee-herdsman/src/controller/database.ts:38:19)
    at Device.undelete (/app/node_modules/zigbee-herdsman/src/controller/model/device.ts:439:25)
    at Controller.onDeviceJoined (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:573:20)
[21:52:56] INFO: Preparing to start...
[21:52:57] INFO: Socat not enabled
[21:53:02] INFO: Starting Zigbee2MQTT...

What did you expect to happen?

Three lights to get paired, Z2M not to crash

How to reproduce it (minimal and precise)

  1. Attach three lights to the same chandelier (e.g. https://www.zigbee2mqtt.io/devices/LED2201G8.html or https://www.zigbee2mqtt.io/devices/LED1732G11.html)
  2. (Optional, but seems to increase repro rate) Have them paired to Z2M
  3. Reset them using the wall switch using this method: https://www.youtube.com/watch?v=mJm9YpPrGzk

This triggers an undelete which does not seem to be concurrency safe.

Zigbee2MQTT version

1.37.1

Adapter firmware version

221226

Adapter

SONOFF Zigbee 3.0 USB Dongle Plus TI CC2652P + CP2102(N)

Setup

Add-on on HAOS on x86-64

Debug log

Before the crash
After the crash

@Nezz Nezz added the problem Something isn't working label May 10, 2024
Koenkk added a commit to Koenkk/zigbee-herdsman that referenced this issue May 12, 2024
@Koenkk
Copy link
Owner

Koenkk commented May 12, 2024

Pushed a fix, can you check if it works?

Changes will be available in the dev branch in a few hours from now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants