Dirnei / node-red-contrib-zigbee2mqtt-devices

Node-red nodes for controlling and managing zigbee devices managed by zigbee2mqtt
MIT License
30 stars 7 forks source link

Node-RED restarting: TypeError: Cannot read property 'replace' of undefined #101

Closed Harald-U closed 3 years ago

Harald-U commented 3 years ago

Seems to be an issue with an IKEA TRADFRI Remote (E1810). After a while when I press a key on the remote or sometimes all by itself Node-RED restarts. I get the following error in the Node_RED logs:

31 Mar 11:00:24 - [red] Uncaught Exception:,
31 Mar 11:00:24 - TypeError: Cannot read property 'replace' of undefined,
    at MqttSubscription.callback (/data/node_modules/node-red-contrib-zigbee2mqtt-devices/dist/nodes/devices-ikea.js:61:49),
    at MqttSubscription.invokeIfMatch (/data/node_modules/node-red-contrib-zigbee2mqtt-devices/dist/lib/mqtt.js:28:18),
    at /data/node_modules/node-red-contrib-zigbee2mqtt-devices/dist/zigbee2mqtt-config.js:33:25,
    at Array.forEach (<anonymous>),
    at /data/node_modules/node-red-contrib-zigbee2mqtt-devices/dist/zigbee2mqtt-config.js:32:36,
    at MqttClient.handler (/usr/src/node-red/node_modules/@node-red/nodes/core/network/10-mqtt.js:320:25),
    at MqttClient.emit (events.js:326:22),
    at MqttClient._handlePublish (/usr/src/node-red/node_modules/mqtt/lib/client.js:1277:12),
    at MqttClient._handlePacket (/usr/src/node-red/node_modules/mqtt/lib/client.js:410:12),
    at work (/usr/src/node-red/node_modules/mqtt/lib/client.js:321:12),
    at Writable.writable._write (/usr/src/node-red/node_modules/mqtt/lib/client.js:335:5),
    at doWrite (/usr/src/node-red/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:409:139),
    at writeOrBuffer (/usr/src/node-red/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:398:5),
    at Writable.write (/usr/src/node-red/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:307:11),
    at Socket.ondata (_stream_readable.js:718:22),
    at Socket.emit (events.js:314:20),
    at addChunk (_stream_readable.js:297:12),
    at readableAddChunk (_stream_readable.js:272:9),
    at Socket.Readable.push (_stream_readable.js:213:10),
    at TCP.onStreamRead (internal/stream_base_commons.js:188:23),
npm ERR! code ELIFECYCLE,
npm ERR! errno 1,
npm ERR! node-red-docker@1.2.9 start: `node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"`,
npm ERR! Exit status 1,

npm ERR! Failed at the node-red-docker@1.2.9 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /data/.npm/_logs/2021-03-31T09_00_24_270Z-debug.log

After this the logs shows Node-RED restarting.

The mentioned debug log is pretty useless.

node v12.20.1 npm v6.14.10 Node-RED v1.2.9 node-red-contrib-zigbee2mqtt-devices v0.19.2 Zigbee2MQTT v1.18.1

I already deleted and reinstalled node-red-contrib-zigbee2mqtt-devices, didn't help.

Any ideas? Thanks!

Dirnei commented 3 years ago

Does it work now? Or is the bug still existing?

Harald-U commented 3 years ago

I am not using node-red-contrib-zigbee2mqtt-devices at the moment. The numerous restarts of Node-RED completely messed up the rest of my setup (dashboards without data). Currently I have implemented the functions I need with MQTT nodes an some other nodes. The stack trace I posted is very similar to the one in issue https://github.com/Dirnei/node-red-contrib-zigbee2mqtt-devices/issues/93#issue-798279157 Could it be the same problem?