# Debug node causing RangeError: Maximum call stack size exceeded

**URL:** https://discourse.nodered.org/t/debug-node-causing-rangeerror-maximum-call-stack-size-exceeded/27776
**Category:** General
**Created:** [4 June 2020 15:27 UTC](https://discourse.nodered.org/t/debug-node-causing-rangeerror-maximum-call-stack-size-exceeded/27776 "2020-06-04T15:27:54Z")
**Posts on this page:** 10
**Page:** 2

<div class="post-metadata">

### Author: ![lenny1972](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lenny1972/32/13210_2.png) [@lenny1972](https://discourse.nodered.org/u/lenny1972)
#### Post date: [5 June 2020 10:39 UTC](https://discourse.nodered.org/t/debug-node-causing-rangeerror-maximum-call-stack-size-exceeded/27776/21 "2020-06-05T10:39:49Z")

</div>

> [@Colin](#):
>
> I also hadn't realised that you are able to see the errors. I presumed it was flooding so rapidly that the debug node never got a chance to show anything. Again I don't think you had mentioned that you are seeing errors caught.

I've implemented the log on a file just for debug purposes after the NR restart happened. I really don't know if I will be able to get/see te errors cathed by the catch node..I hope so in order to understand the NR restart cause 🙂

---

<div class="post-metadata">

### Author: ![ristomatti](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ristomatti/32/5857_2.png) [@ristomatti](https://discourse.nodered.org/u/ristomatti)
#### Post date: [5 June 2020 10:57 UTC](https://discourse.nodered.org/t/debug-node-causing-rangeerror-maximum-call-stack-size-exceeded/27776/22 "2020-06-05T10:57:22Z")

</div>

> [@lenny1972](#):
>
> I really don't know if I will be able to get/see te errors cathed by the catch node..I hope so in order to understand the NR restart cause 🙂

If it happens to be connectivity related, maybe you can "speed things up" by disconnecting the Pi's ethernet/wifi?

---

<div class="post-metadata">

### Author: ![lenny1972](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lenny1972/32/13210_2.png) [@lenny1972](https://discourse.nodered.org/u/lenny1972)
#### Post date: [6 June 2020 14:21 UTC](https://discourse.nodered.org/t/debug-node-causing-rangeerror-maximum-call-stack-size-exceeded/27776/23 "2020-06-06T14:21:00Z")

</div>

Unfortunately the radnom restart happend again but I didn't find any writing in the log file I've created.  
The strange think is that the error in the syslog is always the same but I didn't get any entry in my personal log file. If - in the syslog file, the debug node throws an error saying that that it received a large number of message that it cannot manage (if I've understood what is behind the error message) I cannot really understand why another node connected to the same "catch" node and taht writes on a local file didn't wrute anything on that file..

> Jun 6 15:17:58 raspberrypi Node-RED[10142]: 6 Jun 15:17:58 - [warn] [debug:Errori rilevati sul flow CAMPIONAMENTO SENSORI] Message exceeded maximum number of catches  
> Jun 6 15:17:58 raspberrypi Node-RED[10142]: 6 Jun 15:17:58 - [error] [debug:Errori rilevati sul flow CAMPIONAMENTO SENSORI] RangeError: Maximum call stack size exceeded

I'm surely missing something....Any clues?

---

<div class="post-metadata">

### Author: ![ristomatti](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ristomatti/32/5857_2.png) [@ristomatti](https://discourse.nodered.org/u/ristomatti)
#### Post date: [6 June 2020 14:45 UTC](https://discourse.nodered.org/t/debug-node-causing-rangeerror-maximum-call-stack-size-exceeded/27776/24 "2020-06-06T14:45:00Z")

</div>

It's difficult to say anything without knowing how you have set the logging up / without seeing your flow. Could you export and share it? Read this first if you haven't yet:

> [@How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506):
>
> To share code samples or flow json in this forum, you need to take care to format it properly so that it is displayed correctly. The easiest way to do that is to click the 'Preformatted Text' button in the toolbar: [image] Then paste in your code or flow json. You should end up with three back-tick characters - ``` - on their own line before and after the code. On standard US English keyboards, this is on the same key as the ~ character. Using the backticks will ens…

---

<div class="post-metadata">

### Author: ![lenny1972](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lenny1972/32/13210_2.png) [@lenny1972](https://discourse.nodered.org/u/lenny1972)
#### Post date: [6 June 2020 15:22 UTC](https://discourse.nodered.org/t/debug-node-causing-rangeerror-maximum-call-stack-size-exceeded/27776/25 "2020-06-06T15:22:26Z")

</div>

Unfortunately, the node that writes on a local file is located in another tab so I cannot share the json flow file. Anyway I've now put a delay node (configure as a "rate limit") between the catch node and the debug node (that throws me the "maximum call stack size exceeded" error).  
I can share the json file of this new configuration (that is really basic).

```auto
[{"id":"2759c1fb.04553e","type":"debug","z":"a6dfd68e.7bd928","name":"Errori rilevati sul flow CAMPIONAMENTO SENSORI","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"error","x":1380,"y":140,"wires":[]},{"id":"57c5d207.5f6c6c","type":"catch","z":"a6dfd68e.7bd928","name":"Errrori rilevati dal flow \"CAMPIONAMENTO SENSORI\"","scope":null,"x":668.3333740234375,"y":138.33334350585938,"wires":[["26e607ac.208b58"]]},{"id":"26e607ac.208b58","type":"delay","z":"a6dfd68e.7bd928","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":990,"y":140,"wires":[["2759c1fb.04553e","eb0b8bf0.dc641"]]}]

```

In this way any message collected by the catch node will be slow down and go to the debug node at a rate of 1 msg every second.

I'll leave it in test for some day and see it this fix the error.

---

<div class="post-metadata">

### Author: ![ristomatti](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ristomatti/32/5857_2.png) [@ristomatti](https://discourse.nodered.org/u/ristomatti)
#### Post date: [6 June 2020 15:27 UTC](https://discourse.nodered.org/t/debug-node-causing-rangeerror-maximum-call-stack-size-exceeded/27776/26 "2020-06-06T15:27:16Z")

</div>

I checked your flow. Nothing much to see there but you probably want to check also "system log" in the debug node after the catch node. Otherwise it'll just catch the errors for display on the Node-RED editor and you'll miss them again.

---

<div class="post-metadata">

### Author: ![lenny1972](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lenny1972/32/13210_2.png) [@lenny1972](https://discourse.nodered.org/u/lenny1972)
#### Post date: [6 June 2020 15:31 UTC](https://discourse.nodered.org/t/debug-node-causing-rangeerror-maximum-call-stack-size-exceeded/27776/27 "2020-06-06T15:31:33Z")

</div>

> [@ristomatti](#):
>
> o check also "system log" in the debug node after the catch node

I don't get your point. What exactly do yu mean with "system log"? Do you refer to the syslog? After the "debug" node I don't have anything.... 🙄

---

<div class="post-metadata">

### Author: ![ristomatti](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ristomatti/32/5857_2.png) [@ristomatti](https://discourse.nodered.org/u/ristomatti)
#### Post date: [6 June 2020 15:36 UTC](https://discourse.nodered.org/t/debug-node-causing-rangeerror-maximum-call-stack-size-exceeded/27776/28 "2020-06-06T15:36:33Z")

</div>

In the edit dialog of the debug node in your flow. Add a checkmark to "system log". I'd take a screenshot unless I was on mobile. Otherwise the messages it receives from the catch node are only displayed in the sidebar debug tab.

---

<div class="post-metadata">

### Author: ![lenny1972](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lenny1972/32/13210_2.png) [@lenny1972](https://discourse.nodered.org/u/lenny1972)
#### Post date: [6 June 2020 15:49 UTC](https://discourse.nodered.org/t/debug-node-causing-rangeerror-maximum-call-stack-size-exceeded/27776/29 "2020-06-06T15:49:34Z")

</div>

Ah ok I understood. I've configure the debug mode as you suggested. Thanks for your advice

---

<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: [5 August 2020 15:49 UTC](https://discourse.nodered.org/t/debug-node-causing-rangeerror-maximum-call-stack-size-exceeded/27776/30 "2020-08-05T15:49:39Z")

</div>

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

[Previous page](https://discourse.nodered.org/t/debug-node-causing-rangeerror-maximum-call-stack-size-exceeded/27776.md?page=1)
