# Nodered 0.20.2 crashes - TypeError: Converting circular structure to JSON

**URL:** <https://discourse.nodered.org/t/nodered-0-20-2-crashes-typeerror-converting-circular-structure-to-json/9127>\
**Category:** General\
**Created:** [18 March 2019 13:59 UTC](https://discourse.nodered.org/t/nodered-0-20-2-crashes-typeerror-converting-circular-structure-to-json/9127 "2019-03-18T13:59:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![snoekieboe](https://avatars.discourse-cdn.com/v4/letter/s/278dde/32.png) [@snoekieboe](https://discourse.nodered.org/u/snoekieboe)\
**Post date:** [18 March 2019 13:59 UTC](https://discourse.nodered.org/t/nodered-0-20-2-crashes-typeerror-converting-circular-structure-to-json/9127/1 "2019-03-18T13:59:02Z")

</div>

Hi,

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

```auto
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 EventSource.node.es.onopen (/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.

Thnx!

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

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [18 March 2019 14:08 UTC](https://discourse.nodered.org/t/nodered-0-20-2-crashes-typeerror-converting-circular-structure-to-json/9127/2 "2019-03-18T14:08:41Z")

</div>

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

> <https://github.com/pdmangel/node-red-contrib-openhab2/issues/36>

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [18 March 2019 15:02 UTC](https://discourse.nodered.org/t/nodered-0-20-2-crashes-typeerror-converting-circular-structure-to-json/9127/3 "2019-03-18T15:02:17Z")

</div>

Working on a fix - expect Node-RED 0.20.3 soon
