Node Red sudden fatal error

Yesterday while doing some benign thing in node red, it stalled and the container restarted itself. When going past the “node red has started” message, it now usses the full CPU power for several minutes, before quitting with the message:

<--- Last few GCs --->
[5452:0xb2690210]   202152 ms: Mark-sweep 987.1 (1046.1) -> 980.1 (1047.1) MB, 13848.7 / 0.1 ms  (average mu = 0.119, current mu = 0.011) allocation failure scavenge might not succeed
[5452:0xb2690210]   219623 ms: Mark-sweep 988.1 (1047.3) -> 981.3 (1048.3) MB, 17297.2 / 0.1 ms  (average mu = 0.059, current mu = 0.010) allocation failure scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

I have tried the following remedies:

  • rebooting the RP4
  • stopping and starting the node red addon
  • recovering the node red addon from a previous backup
  • removing the node red addon - rebooting - adding the node red addon once again

All do nothing to help getting it back working.

Any ideas what this could be?

This is my system:
Raspberry Pi 4 8GB
Node-RED version: v2.2.2
Node.js version: v16.14.2
Linux 5.10.103-v7l+ arm LE

Version core-2022.5.4
Installation Type Home Assistant Supervised
Development false
Supervisor true
Docker true
User root
Virtual Environment false
Python Version 3.9.9
Operating System Family Linux
Operating System Version 5.10.103-v7l+
CPU Architecture armv7l
Timezone Europe/Zurich
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 5000
Installed Version 1.24.5
Stage running
Available Repositories 1053
Downloaded Repositories 13
Logged In false
Reach Certificate Server ok
Reach Authentication Server ok
Reach Home Assistant Cloud ok

Home Assistant Supervisor

Host Operating System Raspbian GNU/Linux 10 (buster)
Update Channel stable
Supervisor Version supervisor-2022.05.3
Docker Version 20.10.16
Disk Total 116.9 GB
Disk Used 15.2 GB
Healthy true
Supported Unsupported
Supervisor API ok
Version API ok
Installed Add-ons Duck DNS (1.14.0), Mosquitto broker (6.1.2), AirCast (3.3.0), MariaDB (2.4.0), Nginx Proxy Manager (0.11.0), File editor (5.3.3), Log Viewer (0.13.0), Google Assistant SDK (2.5.0), Let’s Encrypt (4.11.0), Check Home Assistant configuration (3.6.0), Home Assistant Google Drive Backup (0.107.2), Samba share (9.3.0), Node-RED (11.1.2)

You have to remove the nodered folder. Go to /config/nodered look for flows.json copy it to a safe place. Remove the addon and reboot your entire system not just HA. Rename the nodered folder nodered.old reboot everything again, then reinstall.