Foddy / node-red-contrib-huemagic

Philips Hue node to control bridges, lights, groups, motion sensors, temperature sensors and Lux sensors using Node-RED.
https://flows.nodered.org/node/node-red-contrib-huemagic
Apache License 2.0
201 stars 67 forks source link

Node Red Restarting on Deployment after configuring the HUE Bridge Node Only #318

Closed Rollem1 closed 2 years ago

Rollem1 commented 2 years ago

Hi Foddy,

Great work on this project!

I've hit an issue - I've updated from version 3.x to version 4.1.0 - Node red goes into a constant loop of rebooting on first deployment. This does not appear to be related to the another issue raised where messages were sent too soon before the Hue Bridge node is configured.

I have deleted all the hue magic nodes including the bridge. Node Red then loads without issue.

Just adding back the Hue Bridge node without any others - configuring it and hitting deploy - Node red goes into a loop of rebooting again.

If the Hue Bridge node is disabled then it deploys correctly. You can then enable the Hue bridge node and everything is fine until node red is restarted. Then it gets into the rebooting loop.

On looking at the logs I see lots of this:-

This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason: TypeError: Cannot read properties of undefined (reading 'length') at new HueBridgeMessage (/home/pi/.node-red/node_modules/node-red-contrib-huemagic/huemagic/utils/messages.js:17:61) at HueBridge.get (/home/pi/.node-red/node_modules/node-red-contrib-huemagic/huemagic/hue-bridge-config.js:306:23) at /home/pi/.node-red/node_modules/node-red-contrib-huemagic/huemagic/hue-bridge.js:84:30 at EventEmitter. (/home/pi/.node-red/node_modules/node-red-contrib-huemagic/huemagic/hue-bridge-config.js:556:7) at EventEmitter.emit (node:events:390:28) at EventEmitter.emit (node:domain:475:12) at HueBridge.pushUpdatedState (/home/pi/.node-red/node_modules/node-red-contrib-huemagic/huemagic/hue-bridge-config.js:275:16) at Timeout._onTimeout (/home/pi/.node-red/node_modules/node-red-contrib-huemagic/huemagic/hue-bridge-config.js:177:13) at listOnTimeout (node:internal/timers:557:17) at processTimers (node:internal/timers:500:7) TypeError: Cannot read properties of undefined (reading 'length') at new HueBridgeMessage (/home/pi/.node-red/node_modules/node-red-contrib-huemagic/huemagic/utils/messages.js:17:61) at HueBridge.get (/home/pi/.node-red/node_modules/node-red-contrib-huemagic/huemagic/hue-bridge-config.js:306:23) at /home/pi/.node-red/node_modules/node-red-contrib-huemagic/huemagic/hue-bridge.js:84:30 at EventEmitter. (/home/pi/.node-red/node_modules/node-red-contrib-huemagic/huemagic/hue-bridge-config.js:556:7) at EventEmitter.emit (node:events:390:28) at EventEmitter.emit (node:domain:475:12) at HueBridge.pushUpdatedState (/home/pi/.node-red/node_modules/node-red-contrib-huemagic/huemagic/hue-bridge-config.js:275:16) at Timeout._onTimeout (/home/pi/.node-red/node_modules/node-red-contrib-huemagic/huemagic/hue-bridge-config.js:177:13) at listOnTimeout (node:internal/timers:557:17) at processTimers (node:internal/timers:500:7) This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason: TypeError: Cannot read properties of undefined (reading 'length') at new HueBridgeMessage (/home/pi/.node-red/node_modules/node-red-contrib-huemagic/huemagic/utils/messages.js:17:61) at HueBridge.get (/home/pi/.node-red/node_modules/node-red-contrib-huemagic/huemagic/hue-bridge-config.js:306:23) at /home/pi/.node-red/node_modules/node-red-contrib-huemagic/huemagic/hue-bridge.js:84:30 at EventEmitter. (/home/pi/.node-red/node_modules/node-red-contrib-huemagic/huemagic/hue-bridge-config.js:556:7) at EventEmitter.emit (node:events:390:28) at EventEmitter.emit (node:domain:475:12) at HueBridge.pushUpdatedState (/home/pi/.node-red/node_modules/node-red-contrib-huemagic/huemagic/hue-bridge-config.js:275:16) at Timeout._onTimeout (/home/pi/.node-red/node_modules/node-red-contrib-huemagic/huemagic/hue-bridge-config.js:177:13) at listOnTimeout (node:internal/timers:557:17) at processTimers (node:internal/timers:500:7)

Let me know of you need any more info

Thanks for your help, Jon

unclej84 commented 2 years ago

Looks like #302

Rollem1 commented 2 years ago

Looks like #302

Indeed it is - I'll close this topic and answer there.

Cheers, Jon