# I am not understanding this "error" message I get when NR starts

**URL:** <https://discourse.nodered.org/t/i-am-not-understanding-this-error-message-i-get-when-nr-starts/14075>\
**Category:** General\
**Created:** [7 August 2019 03:01 UTC](https://discourse.nodered.org/t/i-am-not-understanding-this-error-message-i-get-when-nr-starts/14075 "2019-08-07T03:01:35Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [7 August 2019 03:01 UTC](https://discourse.nodered.org/t/i-am-not-understanding-this-error-message-i-get-when-nr-starts/14075/1 "2019-08-07T03:01:35Z")

</div>

I started NR today and saw this interesting message.

Trying to _follow the rabbit_ I got nowhere fast.

See pictures.

Ok, if the node got an erroneous message... But that "string" would need to come from somewhere.

That text is not something I would be sending as a user string. It would be a function or something like that.

So how would I go about finding out where it comes from?

 ![Screenshot%20from%202019-08-07%2012-54-40](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/5/59a265126b84a101b41272b42eee2bf559f11ee0.png) ![Screenshot%20from%202019-08-07%2012-55-13](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/8/8081327e0f4f920972227e0113d5b4204e17dd4a.png) ![Screenshot%20from%202019-08-07%2012-55-18](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/e/e58d1420c34f9c2c6efeb5ad6aef7b3e04a854e2.png)

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [7 August 2019 05:12 UTC](https://discourse.nodered.org/t/i-am-not-understanding-this-error-message-i-get-when-nr-starts/14075/2 "2019-08-07T05:12:22Z")

</div>

The log messages have a structure:

`type - originating node - error`

The TypeError is caused by the gate node, see [source code](https://github.com/drmibell/node-red-contrib-simple-gate/blob/master/gate.js).

I suspect it is caused by the error above it: 'Message exceeded maximum number of catches'

What are you injecting ? Or better: what are you _not_ injecting ? The gate requires a control topic as I read it.

---

<div class="post-metadata">

**Author:** ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)\
**Post date:** [7 August 2019 07:10 UTC](https://discourse.nodered.org/t/i-am-not-understanding-this-error-message-i-get-when-nr-starts/14075/3 "2019-08-07T07:10:37Z")

</div>

I suspect you need to set `msg.topic` on your inject nodes. Otherwise you will create an endless "try-catch" loop with your `catch` node, because you re-inject the error message into `gate`.

The message 'Message exceeded maximum number of catches' indicates that the `catch` node has an internal fail-safe to prevent endless loops.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [8 August 2019 05:29 UTC](https://discourse.nodered.org/t/i-am-not-understanding-this-error-message-i-get-when-nr-starts/14075/4 "2019-08-08T05:29:57Z")

</div>

> [@bakman2](#):
>
> I suspect it is caused by the error above it: 'Message exceeded maximum number of catches'
> 
> What are you injecting ? Or better: what are you _not_ injecting ? The gate requires a control topic as I read it.

In answer:  
It is booting, so I am not sure what is getting injected. I hope only the stuff I want.

Shall have to look into it further.

Thanks.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [8 August 2019 05:37 UTC](https://discourse.nodered.org/t/i-am-not-understanding-this-error-message-i-get-when-nr-starts/14075/5 "2019-08-08T05:37:05Z")

</div>

Thanks to both of you for the replies:  
@kuema and @bakman2

I think I found it.

Else where on another machine I was/am injecting things and they were not really at the right point.

Thus a message got to go to places it wasn't mean to be.

I hope it is now fixed.

Thanks both.

---

<div class="post-metadata">

**Author:** ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)\
**Post date:** [8 August 2019 05:46 UTC](https://discourse.nodered.org/t/i-am-not-understanding-this-error-message-i-get-when-nr-starts/14075/6 "2019-08-08T05:46:41Z")

</div>

Anyway, with the way you wired your catch node, you can run into this situation again, as soon as any other node on this tab fails with an error. If the `msg.topic` is not set, `gate` and `catch-all` will play message ping-pong again. 😀

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [8 August 2019 06:56 UTC](https://discourse.nodered.org/t/i-am-not-understanding-this-error-message-i-get-when-nr-starts/14075/7 "2019-08-08T06:56:56Z")

</div>

So does `msg.topic` need to be set it will . . . . . _fail_?

I know what I am doing is problematic. The idea is that I have this block of code that catches errors and helps me track them.

Of course if that block of code has an error.....

But the cause of the error was because I connected/injected a signal in another _flow_ (part of) that was injected in the wrong place.

---

<div class="post-metadata">

**Author:** ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)\
**Post date:** [8 August 2019 07:11 UTC](https://discourse.nodered.org/t/i-am-not-understanding-this-error-message-i-get-when-nr-starts/14075/8 "2019-08-08T07:11:15Z")

</div>

Looking at the code of the `gate` node, it implicitly requires the `msg.topic` to be a string. The type check in [line 46](https://github.com/drmibell/node-red-contrib-simple-gate/blob/38e7119e3fba86c032664df6d7890d2d27f4232f/gate.js#L46) needs to be improved. If `msg.topic` is anything other than a string or `undefined`, it will raise the TypeError you are seeing, because `toLowerCase()` is likely not present.

This is also a bug in the `gate` node, you should raise an issue there, too.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [8 August 2019 07:17 UTC](https://discourse.nodered.org/t/i-am-not-understanding-this-error-message-i-get-when-nr-starts/14075/9 "2019-08-08T07:17:16Z")

</div>

Yes, ok. But that was exassabated (?) by the error with how I constructed the other part of the flow.

What is annoying I wasn't told/get the flow name.  
But maybe that is because of how the error happened. But the catching of them is supposed to be informative.

---

<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:** [8 August 2019 09:59 UTC](https://discourse.nodered.org/t/i-am-not-understanding-this-error-message-i-get-when-nr-starts/14075/10 "2019-08-08T09:59:33Z")

</div>

> [@Trying\_to\_learn](#):
>
> What is annoying I wasn't told/get the flow name.

The error message gave you the name of the node and its id. With that information you can instantly get to the node in question whichever flow it is on.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/afe1c0e7e8074de3f75b336a9bc49b906ab0f87b.png)

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [8 August 2019 21:23 UTC](https://discourse.nodered.org/t/i-am-not-understanding-this-error-message-i-get-when-nr-starts/14075/11 "2019-08-08T21:23:23Z")

</div>

> [@knolleary](#):
>
> The error message gave you the name of the node and its id. With that information you can instantly get to the node in question whichever flow it is on.

Yes, and I agree.

I am only saying that in that piece of code I posted - though not seen as it isn't included - is a part that names the flow from which the error came.

I'm guessing that as the "Telemetry" flow is the main one, the error hasn't gone past that part of the flow by then.  
(This was realised shortly before me posting this reply.)

So for humans to see an error and examine it, it is _human readable_ and shows the type of error and from which flow.

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [15 August 2019 15:26 UTC](https://discourse.nodered.org/t/i-am-not-understanding-this-error-message-i-get-when-nr-starts/14075/12 "2019-08-15T15:26:39Z")

</div>

> [@kuema](#):
>
> This is also a bug in the `gate` node

Good catch. I will fix it shortly. In my defense, the assumption that `msg.topic` (if defined) will be a string comes from its origin in the MQTT topic, which is required to be one. Clearly, NR does not impose any such restriction. I am still a bit curious as to what @Trying_to_learn was injecting to make all this happen.

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [15 August 2019 17:31 UTC](https://discourse.nodered.org/t/i-am-not-understanding-this-error-message-i-get-when-nr-starts/14075/13 "2019-08-15T17:31:50Z")

</div>

> [@kuema](#):
>
> with the way you wired your catch node, you can run into this situation again, as soon as any other node on this tab fails with an error.

For the record, this is a general issue, not specific to the `gate` node. If any node downstream of a `catch` node throws an error, and the `catch` node is able to catch that error, you will end up with an infinite loop that is halted only by the fail-safe.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [15 August 2019 20:37 UTC](https://discourse.nodered.org/t/i-am-not-understanding-this-error-message-i-get-when-nr-starts/14075/14 "2019-08-15T20:37:41Z")

</div>

I think (yeah, I know....) it was an erroneous message that came from a place it shouldn't.

It only happened at/on boot which made it even harder to find.

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [16 August 2019 03:19 UTC](https://discourse.nodered.org/t/i-am-not-understanding-this-error-message-i-get-when-nr-starts/14075/15 "2019-08-16T03:19:02Z")

</div>

> [@kuema](#):
>
> bug in the `gate` node,

Fixed in version 0.2.4, uploaded to npm.
