Nodered 0.20.2 crashes - TypeError: Converting circular structure to JSON


I upgraded my Node-Red install to version 0.20.2 and now it's constantly restarting or crashing with the following error:

18 Mar 14:49:50 - TypeError: Converting circular structure to JSON
    at JSON.stringify (<anonymous>)
    at getStateOfItems (/usr/lib/node_modules/node-red-contrib-openhab2/77-openhab2.js:100:50)
    at (/usr/lib/node_modules/node-red-contrib-openhab2/77-openhab2.js:148:14)
    at EventSource.emit (events.js:189:13)
    at _emit (/usr/lib/node_modules/node-red-contrib-openhab2/node_modules/@joeybaker/eventsource/lib/eventsource.js:209:17)
    at ClientRequest.<anonymous> (/usr/lib/node_modules/node-red-contrib-openhab2/node_modules/@joeybaker/eventsource/lib/eventsource.js:136:7)
    at Object.onceWrapper (events.js:277:13)
    at ClientRequest.emit (events.js:189:13)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:556:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17)

The specific case in which this error is reproducable:

  • Have Openhab nodes available (node-red-contrib-openhab2 - v1.1.4)
  • Have huemagic nodes available that contain a Hue bridge configuration (node-red-contrib-huemagic - v1.9.0)

Just having my openhab nodes in a flow does not cause any problems
Just having the HueMagic nodes in a flow does not cause any problems

A soon as you make the combination, only when the hue bridge is configured, the above error is triggered.

I've also tried changing to other HUE nodes and this triggers the exact same behaviour.

Downgrading to version 0.18.x seems to resolve the issue.

Please point me in the right direction for a possible solution.


Node-red version: 0.20.2
node.js version: 10.15.3
OS: Ubuntu 18.04 LTS

Looks like an issue that the author of node-red-contrib-openhab needs to resolve. There is already an issue open on the nodes github page

Working on a fix - expect Node-RED 0.20.3 soon