Node Red stopped - Max call stack size exceeded

Hi,
Node-red just suddenly stopped and I can't access it anymore. I was working on a flow when this happened and not matter what I try, I cant get it to display with the :1880.
Is there a way I can get this going as there are other flows that I don't really want to lose. Many thanks...

pi@raspberrypi:~ $ node-red-log
12 Oct 08:06:35 - [info] Dashboard version 2.15.2 started at /ui
12 Oct 08:06:44 - [info] Settings file : /home/pi/.node-red/settings.js
12 Oct 08:06:44 - [info] Context store : 'default' [module=memory]
12 Oct 08:06:44 - [info] User directory : /home/pi/.node-red
12 Oct 08:06:44 - [warn] Projects disabled : editorTheme.projects.enabled=false
12 Oct 08:06:44 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json
12 Oct 08:06:44 - [info] Server now running at https://127.0.0.1:1880/
12 Oct 08:06:44 - [warn]

Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.

12 Oct 08:06:45 - [info] Starting flows
12 Oct 08:06:47 - [info] Started flows
12 Oct 08:06:47 - [info] [mqtt-broker:192.168.0.75] Connected to broker: mqtt://192.168.0.75:1883
12 Oct 08:06:47 - [info] [mqtt-broker:a6e84369.179ad] Connected to broker: mqtt://localhost:1883
12 Oct 08:06:47 - [info] [mqtt-broker:207358c8.71b8d8] Connected to broker: mqtt://localhost:1883
12 Oct 08:06:47 - [error] [alexa-home-conf:cf271372.5849f] Error: connect ECONNREFUSED 34.240.81.189:8883
12 Oct 08:06:54 - [error] [bigtimer:Lounge] RangeError: Maximum call stack size exceeded
12 Oct 08:06:54 - [error] [bigtimer:Hallway] RangeError: Maximum call stack size exceeded

Start mode red with the --safe option and undo the last changes you made.
Most likely the lounge and hallway big timer.

I stop node-red (node-red-stop), start it with node-red --safe and get the following from SSH terminal

I then start with the :1880 and get as far as showing the node-red top black bar and then the pi locks up and I need to do a cold reset.

Could I modify the flows_raspberrypi.json by using the 'backup' that is in the same directory. Must be an auto backup ??

pi@raspberrypi:~ $ node-red --safe
12 Oct 08:35:18 - [info]

Welcome to Node-RED

12 Oct 08:35:19 - [info] Node-RED version: v0.20.5
12 Oct 08:35:19 - [info] Node.js version: v10.15.3
12 Oct 08:35:19 - [info] Linux 4.19.66+ arm LE
12 Oct 08:35:23 - [info] Loading palette nodes
12 Oct 08:35:44 - [info] Dashboard version 2.15.2 started at /ui
12 Oct 08:35:50 - [info] Settings file : /home/pi/.node-red/settings.js
12 Oct 08:35:50 - [info] Context store : 'default' [module=memory]
12 Oct 08:35:50 - [info] User directory : /home/pi/.node-red
12 Oct 08:35:50 - [warn] Projects disabled : editorTheme.projects.enabled=false
12 Oct 08:35:50 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json
12 Oct 08:35:50 - [info] Server now running at https://127.0.0.1:1880/
12 Oct 08:35:50 - [warn]


Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.

You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.

12 Oct 08:35:51 - [info] *****************************************************************
12 Oct 08:35:51 - [info] Flows stopped in safe mode. Deploy to start.
12 Oct 08:35:51 - [info] *****************************************************************

Got the black bar AND the blue background screen now but still locking up??

pi@raspberrypi:~ $ node-red-log
12 Oct 08:44:42 - [info] Server now running at https://127.0.0.1:1880/
12 Oct 08:44:42 - [warn]

Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.

12 Oct 08:44:43 - [info] Starting flows
12 Oct 08:44:45 - [info] Started flows
12 Oct 08:44:45 - [info] [mqtt-broker:192.168.0.75] Connected to broker: mqtt://192.168.0.75:1883
12 Oct 08:44:46 - [info] [mqtt-broker:a6e84369.179ad] Connected to broker: mqtt://localhost:1883
12 Oct 08:44:46 - [info] [mqtt-broker:207358c8.71b8d8] Connected to broker: mqtt://localhost:1883
12 Oct 08:44:46 - [error] [alexa-home-conf:cf271372.5849f] Error: connect ECONNREFUSED 34.240.81.189:8883
12 Oct 08:44:53 - [error] [bigtimer:Lounge] RangeError: Maximum call stack size exceeded
Stopping Node-RED graphical event wiring tool...
nodered.service: State 'stop-sigterm' timed out. Killing.
nodered.service: Killing process 303 (node-red) with signal SIGKILL.
nodered.service: Main process exited, code=killed, status=9/KILL
Stopped Node-RED graphical event wiring tool.
nodered.service: Unit entered failed state.
nodered.service: Failed with result 'timeout'.

There still seems to be a problem with the bigtimer node. You can start it in safe mode again and then make some changes to try and fix it. When you deploy it will start the flows running and you will see if you have fixed it. I would start by disconnecting the inputs from that node. If that fixes it then instead put a debug node there and see what you are feeding it.

Hi Colin, thanks for your help, the trouble is I cant start it (:1880) in safe mode (node-red --safe) so I cant access any of the flows. I just get the whirling icon in the IE page??

You posted it running in safe mode earlier, so I don't understand what you mean. All you have to do is to run node-red --safe.

Hi Colin, thats what I do, run it in --safe mode. After it starts in safe mode, i try to start the flows from a browser using :1880 (which is how I normally start it) and nothing happens. The furthest its gone is to display the black bar at the top with the node-red logo and the blue backdrop screen.??

Copy/paste what you see in the terminal from node-red --safe up to where you attempt to connect from the browser.
Make sure you refresh the browser rather than just opening it.

pi@raspberrypi:~ $ node-red --safe
12 Oct 08:35:18 - [info]

Welcome to Node-RED

12 Oct 08:35:19 - [info] Node-RED version: v0.20.5
12 Oct 08:35:19 - [info] Node.js version: v10.15.3
12 Oct 08:35:19 - [info] Linux 4.19.66+ arm LE
12 Oct 08:35:23 - [info] Loading palette nodes
12 Oct 08:35:44 - [info] Dashboard version 2.15.2 started at /ui
12 Oct 08:35:50 - [info] Settings file : /home/pi/.node-red/settings.js
12 Oct 08:35:50 - [info] Context store : 'default' [module=memory]
12 Oct 08:35:50 - [info] User directory : /home/pi/.node-red
12 Oct 08:35:50 - [warn] Projects disabled : editorTheme.projects.enabled=false
12 Oct 08:35:50 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json
12 Oct 08:35:50 - [info] Server now running at https://127.0.0.1:1880/
12 Oct 08:35:50 - [warn]

Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.

You should set your own key using the 'credentialSecret' option in

your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.

12 Oct 08:35:51 - [info] *****************************************************************
12 Oct 08:35:51 - [info] Flows stopped in safe mode. Deploy to start.
12 Oct 08:35:51 - [info] *****************************************************************

Now you are running in safe mode
What do you see when you access node-red in your browser?

Hi Colin,
It displays the black bar at the top with the node-red logo and the blue backdrop screen. The browser tab icon just keeps whirling and the pi locks up.

Sorry, I meant the pointer icon keeps whirling. The light blue background screen is completely blank...

You aren't trying to access the dashboard ui are you? You should be going to http://whatever:1880
Is the terminal still showing what it was before, that is:

and nothing else?
Can you do a screenshot showing what you are seeing?
Also have a look in the browser console and see if it is showing any errors.

So if that’s not working.

cd to your .node-red directory and rename your flows.json file.

Restart Node-RED (this will recreate a blank flows file)
Make sure you upgrade the big timer node to the latest version.
The import your old flows file.
Fix any issue with big timer BEFORE you hit deploy.

It would also worth contacting the author of the big timer node via his blog if you are using the latest version as an error in the nodes config shouldn’t cause Node-RED to crash.

Hi Ukmouse
The renaming of the flow files worked. I'm back in but with no flows. How do i import the old flows please?? Many thanks for your help...

In the Node-RED menu

Import > Clipboard

Select a file to import

OK, you are assuming that I actually saved them, which I didn't:joy:. Is there a way to get them back from the renamed flow files ??

Point it at the flow file you renamed.

Alternatively there is a hidden file in that directory with the same name as the flows file
but starting with a .and ending with .backup
you can rename that to the name of the flows file node-red is using. That will take you back to the state of the deploy before the one that caused you issues.

Your are a genius, all back now to how it was. Trying to get hold of Peter Scargill (bigtimer) but his web address not working.

Thanks to you (UKmouse) and others who helped me solve this problem, really appreciated...