Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
12.21k stars 1.68k forks source link

Mesh disassembled after cold reboot #16550

Closed leoluk closed 1 year ago

leoluk commented 1 year ago

What happened?

After a power reset of the NUC with zigbee2mqtt on it, all but 5 devices are gone (of 55).

Previous boot:

debug 2023-02-05 19:49:32: Loaded state from file /app/data/state.json
info  2023-02-05 19:49:32: Logging to console and directory: '/app/data/log/2023-02-05.19-49-31' filename: log.txt
debug 2023-02-05 19:49:32: Removing old log directory '/app/data/log/2022-10-14.09-43-24'
info  2023-02-05 19:49:32: Starting Zigbee2MQTT version 1.28.2 (commit #360a777)
info  2023-02-05 19:49:32: Starting zigbee-herdsman (0.14.68)
debug 2023-02-05 19:49:32: Using zigbee-herdsman with settings: '{"adapter":{"concurrent":null,"delay":null,"disableLED":false},"backupPath":"/app/data/coordinator_backup.json","databaseBackupPath":"/app/data/database.db.backup","databasePath":"/app/data/database.db","network":{"channelList":[25],"extendedPanID":<snip>,"networkKey":"HIDDEN","panID":<snip>},"serialPort":{"path":"/dev/ttyUSB0"}}'
info  2023-02-05 19:49:37: zigbee-herdsman started (resumed)
info  2023-02-05 19:49:37: Coordinator firmware version: '{"meta":{"maintrel":1,"majorrel":2,"minorrel":7,"product":1,"revision":20220219,"transportrev":2},"type":"zStack3x0"}'
debug 2023-02-05 19:49:37: Zigbee network parameters: {"channel":25,"extendedPanID":"<snip>","panID":<snip>}
info  2023-02-05 19:49:37: Set transmit power to '5'
info  2023-02-05 19:49:37: Currently 55 devices are joined:
info  2023-02-05 19:49:37: Küche Luftreiniger (<snip>): E2007 - IKEA STARKVIND air purifier (Router)
[... 54 more ...]

Then, devices (NUC + dongle) rebooted due to power cut.

After next boot, all devices gone. A few rejoined directly after booting, but nothing else:

debug 2023-02-05 19:51:53: Loaded state from file /app/data/state.json
info  2023-02-05 19:51:53: Logging to console and directory: '/app/data/log/2023-02-05.19-51-52' filename: log.txt
debug 2023-02-05 19:51:53: Removing old log directory '/app/data/log/2022-11-06.13-27-29'
info  2023-02-05 19:51:53: Starting Zigbee2MQTT version 1.28.2 (commit #360a777)
info  2023-02-05 19:51:53: Starting zigbee-herdsman (0.14.68)
debug 2023-02-05 19:51:53: Using zigbee-herdsman with settings: '{"adapter":{"concurrent":null,"delay":null,"disableLED":false},"backupPath":"/app/data/coordinator_backup.json","databaseBackupPath":"/app/data/database.db.backup","databasePath":"/app/data/database.db","network":{"channelList":[25],"extendedPanID":[<snip>],"networkKey":"HIDDEN","panID":<snip>},"serialPort":{"path":"/dev/ttyUSB0"}}'
info  2023-02-05 19:51:57: zigbee-herdsman started (resumed)
info  2023-02-05 19:51:57: Coordinator firmware version: '{"meta":{"maintrel":1,"majorrel":2,"minorrel":7,"product":1,"revision":20220219,"transportrev":2},"type":"zStack3x0"}'
debug 2023-02-05 19:51:58: Zigbee network parameters: {"channel":25,"extendedPanID":"<snip>","panID":<snip>}
info  2023-02-05 19:51:58: Set transmit power to '5'
info  2023-02-05 19:51:58: Currently 0 devices are joined:
info  2023-02-05 19:51:58: Zigbee: disabling joining new devices.
info  2023-02-05 19:51:58: Connecting to MQTT server at mqtt://10.88.0.1
debug 2023-02-05 19:51:58: Using MQTT login with username: z2m
info  2023-02-05 19:51:58: Connected to MQTT server
info  2023-02-05 19:51:58: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload '{"state":"online"}'
info  2023-02-05 19:51:58: Started frontend on port 0.0.0.0:8080
info  2023-02-05 19:51:58: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload '{"state":"online"}'
info  2023-02-05 19:52:11: Device 'Test2 CO2' joined
info  2023-02-05 19:52:11: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"Test2 CO2","ieee_address":"0x00158d00038756fa"},"type":"device_joined"}'
info  2023-02-05 19:52:11: MQTT publish: topic 'zigbee2mqtt/Test2 CO2/availability', payload '{"state":"online"}'
info  2023-02-05 19:52:11: Starting interview of 'Test2 CO2'
info  2023-02-05 19:52:11: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"Test2 CO2","ieee_address":"0x00158d00038756fa","status":"started"},"type":"device_interview"}'
debug 2023-02-05 19:52:21: Received MQTT message on 'homeassistant/status' with data 'online'
debug 2023-02-05 19:52:30: Received Zigbee message from 'Test2 CO2', type 'readResponse', cluster 'genBasic', data '{"modelId":"TPZRCO2HT-Z3"}' from endpoint 1 with groupID 0
debug 2023-02-05 19:52:30: Skipping message, definition is undefined and still interviewing
[...]

Everything's still there in configuration.yaml and state.json, but not coordinator_backup.json. I don't have an old snapshot of coordinator_backup.json.

Any chance to get the mesh back in order without resetting 50 devices (some neatly hidden in walls or behind covers)?

What did you expect to happen?

No response

How to reproduce it (minimal and precise)

No response

Zigbee2MQTT version

1.28.2

Adapter firmware version

20220219

Adapter

SONOFF Zigbee 3.0

Debug log

No response

leoluk commented 1 year ago

Halp! This just happened again, just one device left after a reboot:

image
leoluk commented 1 year ago

I've painstakingly rebuilt my mesh... perhaps this was related to the recent issues with overly frequent database writes, even though that shouldn't cause data loss if the writes are done atomically (write + rename)...

Closing this unless it reoccurs.