Hubitat nodes crashing Node-RED

Hi all!

I am hitting an issue with (some) node-red-contrib-hubitat nodes crashing node-RED, requiring a --safe restart and disabling flows until i can get it to stay working. The following error appears in an SSH terminal during the crash, grateful for any guidance to identify the culprit:

24 Nov 08:51:40 - [info] Started flows
24 Nov 08:51:40 - [red] Uncaught Exception:
24 Nov 08:51:40 - TypeError: Cannot read property 'attributes' of undefined
at HubitatDeviceNode._inputCallback (/home/bkdfkup/.node-red/node_modules/node-red-contrib-hubitat/nodes/device.js:171:56)
at /usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:203:26
at Object.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/hooks.js:113:9)
at HubitatDeviceNode.Node._emitInput (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:195:11)
at HubitatDeviceNode.Node.emit (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:179:25)
at HubitatDeviceNode.Node.receive (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:476:10)
at Immediate. (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:657:52)
at processImmediate (node:internal/timers:463:21)
at process.topLevelDomainCallback (node:domain:144:15)
at process.callbackTrampoline (node:internal/async_hooks:127:14)

I'd suggest you raise an issue against the Hubitat node with that stack trace. I looks like its missing the error handling it should have it it tries to access an unknown device.

In this instance, I can see we could also add some error handling in the core of Node-RED to capture this and report it back without causing the Uncaught Exception - something for 1.2.6.

Thanks for the advice. I have submitted an issue to fblackburn1/node-red-contrib-hubitat as recommended.

Its an odd one, as it only happened after updating the nodes, and only happens if the device node has an input (in my case a timestamp set at intervals) configured.

OK, i have narrowed it down to this only occurring if "Inject once after 0.1 seconds, then" is enabled in the inject node. If this is disabled, all works as expected, with the Hubitat node updating its values every 1 second. It seems odd that the initial injection is having an impact.

I suspect its a timing issue - injecting the message so early that the hubitat node hasn't finished initialising itself.

Possibly, I have posted the same findings to Git, so hopefully the dev can provide advice.

Thanks for your assistance

1 Like

Check this...

2 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.