[Bug] TypeError: Cannot read properties of undefined (reading 'getCharacteristic')
yandy-r opened this issue · 8 comments
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
I'm not sure if this is related to #794 but, just updated the plugin to 1.9.3 and now it won't start up. I can't even return to previous versions as the error sticks around.
[1/4/2024, 8:11:17 AM] [homebridge-z2m] Child bridge process ended
[1/4/2024, 8:11:17 AM] [homebridge-z2m] Process Ended. Code: 1, Signal: null
[1/4/2024, 8:11:24 AM] [homebridge-z2m] Restarting Process...
[1/4/2024, 8:11:24 AM] [homebridge-z2m] Launched child bridge with PID 13445
[1/4/2024, 8:11:24 AM] Registering platform 'homebridge-z2m.zigbee2mqtt'
[1/4/2024, 8:11:25 AM] [homebridge-z2m] Loaded homebridge-z2m v1.9.3 child bridge successfully
[1/4/2024, 8:11:25 AM] Loaded 36 cached accessories from cachedAccessories.0E9E6F255C11.
/homebridge/node_modules/homebridge/node_modules/hap-nodejs/dist/lib/Accessory.js:1800
.getCharacteristic(Characteristic_1.Characteristic.Identify)
^
TypeError: Cannot read properties of undefined (reading 'getCharacteristic')
at Accessory._sideloadServices (/homebridge/node_modules/homebridge/node_modules/hap-nodejs/dist/lib/Accessory.js:1800:13)
at Function.Accessory.deserialize (/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:2188:15)
at Function.deserialize (/homebridge/node_modules/homebridge/src/platformAccessory.ts:172:33)
at /homebridge/node_modules/homebridge/src/bridgeService.ts:240:34
at Array.map (<anonymous>)
at BridgeService.loadCachedPlatformAccessoriesFromDisk (/homebridge/node_modules/homebridge/src/bridgeService.ts:239:58)
at ChildBridgeFork.startBridge (/homebridge/node_modules/homebridge/src/childBridgeFork.ts:142:5)
Related devices
All z2m
Related Devices
No response
Steps To Reproduce
- Update plugin to 1.9.3
- Restart child bridge or homebridge
- Plugin crash
- Older versions do the same thing now
Expected behavior
No response
Device entry
No response
Status update
No response
Messages from this plugin
No response
This plugin
1.9.3
Homebridge
1.7.0
Zigbee2MQTT
1.35.0
Homebridge Config UI X (if applicable)
4.54.2
Turns out that "removing the cached Coordinators" made it run again. Was that the fix for 1.9.3? Just curious to see if it's something I need to look out for until further notice, and I guess that would make it related to #794 after all.
Turns out that "removing the cached Coordinators" made it run again. Was that the fix for 1.9.3? Just curious to see if it's something I need to look out for until further notice, and I guess that would make it related to #794 after all.
@yandy-r how do you removed cached coordinators ?
Homebridge Settings -> Remove Single Cached Accessory (near the bottom) -> Then look fo the one you want to remove
Turns out that "removing the cached Coordinators" made it run again. Was that the fix for 1.9.3? Just curious to see if it's something I need to look out for until further notice, and I guess that would make it related to #794 after all.
@yandy-r how do you removed cached coordinators ?
Homebridge Settings -> Remove Single Cached Accessory (near the bottom) -> Then look fo the one you want to remove
@yandy-r That's my error - how to know which accessory to remove ? - I don't see ID !
[1/4/2024, 3:23:34 PM] Loaded 21 cached accessories from cachedAccessories.0E4F3B3A4F53.
/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/dist/lib/Accessory.js:1800
.getCharacteristic(Characteristic_1.Characteristic.Identify)
^
TypeError: Cannot read properties of undefined (reading 'getCharacteristic')
at Accessory._sideloadServices (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/dist/lib/Accessory.js:1800:13)
at Function.Accessory.deserialize (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:2188:15)
at Function.deserialize (/var/lib/homebridge/node_modules/homebridge/src/platformAccessory.ts:172:33)
at /var/lib/homebridge/node_modules/homebridge/src/bridgeService.ts:240:34
at Array.map ()
at BridgeService.loadCachedPlatformAccessoriesFromDisk (/var/lib/homebridge/node_modules/homebridge/src/bridgeService.ts:239:58)
at ChildBridgeFork.startBridge (/var/lib/homebridge/node_modules/homebridge/src/childBridgeFork.ts:142:5)
[1/4/2024, 3:23:35 PM] [homebridge-z2m] Child bridge process ended
@yandy-r ohh i figure it out - i removed Coordinator - i had 5 coordinators no idea why and i removed all of them.
Previously the Coordinator was never created as it was marked as supported: false
by the information provided by Zigbee2MQTT.
Since Zigbee2MQTT v1.35 it actually changed to supported: true
, which caused data to be referenced for the Coordinator that is actually not supplied by Zigbee2MQTT.
That last part is fixed, but I did not do anything specific to get rid of any "Coordinator accessories" that might have been incorrectly created.
I would suggest to clean them by hand indeed, as indicated in a previous comment.
Previously the Coordinator was never created as it was marked as
supported: false
by the information provided by Zigbee2MQTT.Since Zigbee2MQTT v1.35 it actually changed to
supported: true
, which caused data to be referenced for the Coordinator that is actually not supplied by Zigbee2MQTT.That last part is fixed, but I did not do anything specific to get rid of any "Coordinator accessories" that might have been incorrectly created.
I would suggest to clean them by hand indeed, as indicated in a previous comment.
Understood and thank you, this could be closed it seems
Yeah i updated Z2M to 1.35 before updating Homebridge add-on Z2M and it start crashes and creating this Coordinator Device , after updating to latest version of the add-on - Coordinator was still there and need to delete it manually to be able to start the add-on.