# RangeError: Maximum call stack size exceeded

**URL:** <https://discourse.nodered.org/t/rangeerror-maximum-call-stack-size-exceeded/80751>\
**Category:** General\
**Created:** [23 August 2023 13:43 UTC](https://discourse.nodered.org/t/rangeerror-maximum-call-stack-size-exceeded/80751 "2023-08-23T13:43:26Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![davut](https://avatars.discourse-cdn.com/v4/letter/d/858c86/32.png) [@davut](https://discourse.nodered.org/u/davut)\
**Post date:** [23 August 2023 13:43 UTC](https://discourse.nodered.org/t/rangeerror-maximum-call-stack-size-exceeded/80751/1 "2023-08-23T13:43:26Z")

</div>

Hello,

How can I fix this?

RangeError: Maximum call stack size exceeded  
at ClientSessionImpl.isChannelValid (C:\Users\MEPP\_IBA\node\_modules\node-red-contrib-iiot-opcua\node\_modules\node-opcua-client\source\private\client\_session\_impl.ts:1544:26)  
at ClientSessionImpl.\_performMessageTransaction (C:\Users\MEPP\_IBA\node\_modules\node-red-contrib-iiot-opcua\node\_modules\node-opcua-client\source\private\client\_session\_impl.ts:1646:19)  
at ClientSessionImpl.processTransactionQueue (C:\Users\MEPP\_IBA\node\_modules\node-red-contrib-iiot-opcua\node\_modules\node-opcua-client\source\private\client\_session\_impl.ts:1612:14)  
at C:\Users\MEPP\_IBA\node\_modules\node-red-contrib-iiot-opcua\node\_modules\node-opcua-client\source\private\client\_session\_impl.ts:1632:22  
at ClientSessionImpl.\_performMessageTransaction (C:\Users\MEPP\_IBA\node\_modules\node-red-contrib-iiot-opcua\node\_modules\node-opcua-client\source\private\client\_session\_impl.ts:1651:20)  
at ClientSessionImpl.processTransactionQueue (C:\Users\MEPP\_IBA\node\_modules\node-red-contrib-iiot-opcua\node\_modules\node-opcua-client\source\private\client\_session\_impl.ts:1612:14)  
at C:\Users\MEPP\_IBA\node\_modules\node-red-contrib-iiot-opcua\node\_modules\node-opcua-client\source\private\client\_session\_impl.ts:1632:22  
at ClientSessionImpl.\_performMessageTransaction (C:\Users\MEPP\_IBA\node\_modules\node-red-contrib-iiot-opcua\node\_modules\node-opcua-client\source\private\client\_session\_impl.ts:1651:20)  
at ClientSessionImpl.processTransactionQueue (C:\Users\MEPP\_IBA\node\_modules\node-red-contrib-iiot-opcua\node\_modules\node-opcua-client\source\private\client\_session\_impl.ts:1612:14)  
at C:\Users\MEPP\_IBA\node\_modules\node-red-contrib-iiot-opcua\node\_modules\node-opcua-client\source\private\client\_session\_impl.ts:1632:22

---

<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:** [23 August 2023 13:45 UTC](https://discourse.nodered.org/t/rangeerror-maximum-call-stack-size-exceeded/80751/2 "2023-08-23T13:45:48Z")

</div>

Start node-red in safe mode, undo your last change, deploy.

```auto
node-red --safe

```

---

<div class="post-metadata">

**Author:** ![davut](https://avatars.discourse-cdn.com/v4/letter/d/858c86/32.png) [@davut](https://discourse.nodered.org/u/davut)\
**Post date:** [24 August 2023 05:49 UTC](https://discourse.nodered.org/t/rangeerror-maximum-call-stack-size-exceeded/80751/3 "2023-08-24T05:49:10Z")

</div>

it doesn't work. Still same problem.

---

<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:** [24 August 2023 07:44 UTC](https://discourse.nodered.org/t/rangeerror-maximum-call-stack-size-exceeded/80751/4 "2023-08-24T07:44:53Z")

</div>

> [@davut](#):
>
> it doesn't work

What doesn't work. Safe mode? Or undoing your previous changes? deploying?

Please be more explicit & provide details.

---

<div class="post-metadata">

**Author:** ![davut](https://avatars.discourse-cdn.com/v4/letter/d/858c86/32.png) [@davut](https://discourse.nodered.org/u/davut)\
**Post date:** [24 August 2023 07:49 UTC](https://discourse.nodered.org/t/rangeerror-maximum-call-stack-size-exceeded/80751/5 "2023-08-24T07:49:13Z")

</div>

I tried with safe mode than I made undoing previous changes. Deploying working. But I'm facing still same problem

---

<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:** [24 August 2023 08:05 UTC](https://discourse.nodered.org/t/rangeerror-maximum-call-stack-size-exceeded/80751/6 "2023-08-24T08:05:51Z")

</div>

Sorry. That is still not clear.

Are you saying: " safe mode allowed you to get Node-RED running but it crashed after deploying changes".

I suggest that you disable parts of your flows until you get to a point where node red runs. E.g start up in safe mode. Disable some nodes deploy, did it crash? Repeat that until you find which nodes are crashing it.

---

<div class="post-metadata">

**Author:** ![davut](https://avatars.discourse-cdn.com/v4/letter/d/858c86/32.png) [@davut](https://discourse.nodered.org/u/davut)\
**Post date:** [24 August 2023 08:38 UTC](https://discourse.nodered.org/t/rangeerror-maximum-call-stack-size-exceeded/80751/7 "2023-08-24T08:38:01Z")

</div>

I want to run totaly 8 node. But now Its running to 1,2,3,4,5 nodes same time. If I run the node 6 or node 7 or node 8 at same time ,happening crashing. You can see below image.

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

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [24 August 2023 21:26 UTC](https://discourse.nodered.org/t/rangeerror-maximum-call-stack-size-exceeded/80751/8 "2023-08-24T21:26:24Z")

</div>

How often, how quickly are you calling those opcua nodes ? And what are you doing in each set of templates. If you are hitting them too fast they may be backing up data in memory and causing the crash

---

<div class="post-metadata">

**Author:** ![davut](https://avatars.discourse-cdn.com/v4/letter/d/858c86/32.png) [@davut](https://discourse.nodered.org/u/davut)\
**Post date:** [25 August 2023 05:42 UTC](https://discourse.nodered.org/t/rangeerror-maximum-call-stack-size-exceeded/80751/9 "2023-08-25T05:42:21Z")

</div>

I'm calling each nodes 5s. Aproxmitly there are 400 tags and I want to add more. I'm taking tags from kepserver(temperature,pressuare,lenght,width etc.) than I showing them. Maybe I have to increase maximum-call-stack limit but I dont know how?

---

<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:** [25 August 2023 17:35 UTC](https://discourse.nodered.org/t/rangeerror-maximum-call-stack-size-exceeded/80751/10 "2023-08-25T17:35:04Z")

</div>

Instead of reading, you might be better off subscribing.

If you must read, then you need to take into consideration the amount of time it takes to process hundreds of tags. So stagger requests or wire things in series to avoid all 400 being requested at once.

Lastly, could you bypass kepserver and go directly to the device? You might have more lick avoiding opcua

Oh one more - do you REALLY need that many tags? If yes, then you might need to rearrange the tags into arrays of data and minimise the number of tags

---

<div class="post-metadata">

**Author:** ![davut](https://avatars.discourse-cdn.com/v4/letter/d/858c86/32.png) [@davut](https://discourse.nodered.org/u/davut)\
**Post date:** [28 August 2023 11:25 UTC](https://discourse.nodered.org/t/rangeerror-maximum-call-stack-size-exceeded/80751/11 "2023-08-28T11:25:02Z")

</div>

How can I do subscribing?

I cannot bypass kepserver because there are alot of PLC. I cannot read tags from each PLC.

How can I increase maximum-call-stack limit?

---

<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:** [28 August 2023 11:42 UTC](https://discourse.nodered.org/t/rangeerror-maximum-call-stack-size-exceeded/80751/12 "2023-08-28T11:42:59Z")

</div>

> [@davut](#):
>
> How can I do subscribing

The node has built in examples. `ctrl-i` → `examples`

> [@davut](#):
>
> How can I increase maximum-call-stack limit?

Dont. Just be more responsible on your polling and the amounf of data you request (i.e. access data in arrays and/or time gap your requests etc)

---

<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:** [28 August 2023 12:48 UTC](https://discourse.nodered.org/t/rangeerror-maximum-call-stack-size-exceeded/80751/13 "2023-08-28T12:48:36Z")

</div>

> [@davut](#):
>
> How can I increase maximum-call-stack limit?

Usually in such cases increasing the limit would not help, it would just delay the error a little. Usually the cause is that the stack is continually building up as the system is not able to keep up with demands. As Steve says, the solution is to change the strategy.

---

<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 October 2023 12:48 UTC](https://discourse.nodered.org/t/rangeerror-maximum-call-stack-size-exceeded/80751/14 "2023-10-27T12:48:52Z")

</div>

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