# NodeRED crashed after var undefined

**URL:** <https://discourse.nodered.org/t/nodered-crashed-after-var-undefined/41683>\
**Category:** General\
**Created:** [26 February 2021 13:59 UTC](https://discourse.nodered.org/t/nodered-crashed-after-var-undefined/41683 "2021-02-26T13:59:10Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicedevil](https://avatars.discourse-cdn.com/v4/letter/n/858c86/32.png) [@nicedevil](https://discourse.nodered.org/u/nicedevil)\
**Post date:** [26 February 2021 13:59 UTC](https://discourse.nodered.org/t/nodered-crashed-after-var-undefined/41683/1 "2021-02-26T13:59:10Z")

</div>

Heya I just noticed that my node-red keeps crashing all day long.  
Inside the logs I could find that node-red seems to have a problem after a function node tries to get an undefined variable.

here an example on how I defined those variables in the past:

`var test = flow.get("test") || false;`

In the past this worked like "Set the value to flow.test and if that is undefined the variable was set to false".... but this doesn't seem to work anymore. Did I miss a changelog for this behaviour?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [26 February 2021 14:10 UTC](https://discourse.nodered.org/t/nodered-crashed-after-var-undefined/41683/2 "2021-02-26T14:10:04Z")

</div>

It is very unlikely that that is crashing node-red. Can you show us the logs before and after node-red crashes?

---

<div class="post-metadata">

**Author:** ![nicedevil](https://avatars.discourse-cdn.com/v4/letter/n/858c86/32.png) [@nicedevil](https://discourse.nodered.org/u/nicedevil)\
**Post date:** [26 February 2021 14:14 UTC](https://discourse.nodered.org/t/nodered-crashed-after-var-undefined/41683/3 "2021-02-26T14:14:58Z")

</div>

sure 🙂 my node-red is running as instance of ioBroker.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/3/03bfc7ebd24db37198480d1f13035b56532689aa.png)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 February 2021 14:22 UTC](https://discourse.nodered.org/t/nodered-crashed-after-var-undefined/41683/4 "2021-02-26T14:22:16Z")

</div>

Does something in the error message tie it to that function? The messages in ioBroker are not normal node-red messages.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [26 February 2021 14:23 UTC](https://discourse.nodered.org/t/nodered-crashed-after-var-undefined/41683/5 "2021-02-26T14:23:27Z")

</div>

NOTE, i am not at all familiar with "running node-red in ioBroker" so i am speculating.

It looks like this nuki node module is not correctly handling errors.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/8/f8ca586e3cd6d902aabfd6179f9242d5568c364e.png)

do you know what that is? How this nuki api node module is installed?

---

<div class="post-metadata">

**Author:** ![nicedevil](https://avatars.discourse-cdn.com/v4/letter/n/858c86/32.png) [@nicedevil](https://discourse.nodered.org/u/nicedevil)\
**Post date:** [26 February 2021 14:25 UTC](https://discourse.nodered.org/t/nodered-crashed-after-var-undefined/41683/6 "2021-02-26T14:25:54Z")

</div>

I know what nuki is (smart lock) but that error is just there because the module is recharging right now... You can ignore those errors because it is just for small amount of time there, the error for crashing persists if nuki works as expected.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 February 2021 15:21 UTC](https://discourse.nodered.org/t/nodered-crashed-after-var-undefined/41683/7 "2021-02-26T15:21:49Z")

</div>

Did you see my question?

> [@Colin](#):
>
> Does something in the error message tie it to that function?

---

<div class="post-metadata">

**Author:** ![nicedevil](https://avatars.discourse-cdn.com/v4/letter/n/858c86/32.png) [@nicedevil](https://discourse.nodered.org/u/nicedevil)\
**Post date:** [26 February 2021 15:26 UTC](https://discourse.nodered.org/t/nodered-crashed-after-var-undefined/41683/8 "2021-02-26T15:26:11Z")

</div>

@Colin sry did miss your question 😕 but @Steve-Mcl maybe I have to correct myself... I just stopped the link to the nuki node and now it seems to work, but I tested it only 30 minutes for now... the recharging is done and the error isn't appearing anymore o\_O

it is now all the same except the connection to the API node from nuki... but it wasn't happening before.... mhhh will take care of it for future and will report back if that will happen again! ty for now!

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 February 2021 15:29 UTC](https://discourse.nodered.org/t/nodered-crashed-after-var-undefined/41683/9 "2021-02-26T15:29:00Z")

</div>

Are you calling the nuki module from code you have written yourself? A function node for example? If so then you should catch errors from nuki and take appropriate action then it would not crash node-red.

---

<div class="post-metadata">

**Author:** ![nicedevil](https://avatars.discourse-cdn.com/v4/letter/n/858c86/32.png) [@nicedevil](https://discourse.nodered.org/u/nicedevil)\
**Post date:** [26 February 2021 15:29 UTC](https://discourse.nodered.org/t/nodered-crashed-after-var-undefined/41683/10 "2021-02-26T15:29:27Z")

</div>

no it is a plugin from palette 🙂

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 February 2021 15:34 UTC](https://discourse.nodered.org/t/nodered-crashed-after-var-undefined/41683/11 "2021-02-26T15:34:23Z")

</div>

Which one is it? There are two that reference nuki when I do a search.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [27 April 2021 15:34 UTC](https://discourse.nodered.org/t/nodered-crashed-after-var-undefined/41683/12 "2021-04-27T15:34:45Z")

</div>

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