The website is down, so I'm a little frantic/panicked, but will try and take my time here to explain the sequence of events....
My site has been running since March 22nd 2024 mostly trouble free.
A few days ago I happened to notice this error one time in the debug. (I was monitoring some strings, nothing that could have caused this):
"Flushing file /root/.node-red/.sessions.json to disk failed : Error: ENOENT: no such file or directory, rename '/root/.node-red/.sessions.json.$$$' -> '/root/.node-red/.sessions.json'"
I made a mental note to Google it since I have (in 9 years) never seen anything like it, but everything kept working and of course I forgot.
Fast forward a few days and scores of deploy and work on the site later....
A few hours ago I got a site monitoring alert that the server was unresponsive (site down alarm).
If you want to know why I have a site monitoring service, this thread will help: Dashboard load times > 30 sec with more than 250 connections to website
Normally I just check pm2 monit
and then do a pm2 restart
of the main node-red and we are back up and running.... Not this time.
This time when I checked pm2, I saw the memory use had gone wildly out of control...
I've never seen it so high. I've seen 3-5 Gb, but never 12.
When I restarted, I found node-red to be in a boot loop.
I then did a pm2 stop 0
Looking at the log shows this error:
I then tried making the file .sessions.json.$$$ but it still boot-loop.
I then tried removing all the .sessions files. Boot-loop.
I removed flows.json and get a worrying error....
< trim the last few lines with senstive stuff in them >
15 Feb 19:43:33 - [error] [sqlite:stdc] Error: SQLITE_ERROR: table allmsg already exists
15 Feb 19:43:34 - [error] [sqlite:mission] Error: SQLITE_ERROR: table missioncode already exists
Illegal instruction
At that point, node-red has crashed.
When I check dmesg
I see:
[3550905.921067] traps: node-red[905034] trap invalid opcode ip:1d3a55d sp:7ffc76390548 error:0 in node[400000+4bf1000]
[3551003.054291] traps: node-red[940484] trap invalid opcode ip:1d3a55d sp:7ffdaa030208 error:0 in node[400000+4bf1000]
[3551252.395371] traps: node-red[909663] trap invalid opcode ip:1d3a55d sp:7ffc7dccfa08 error:0 in node[400000+4bf1000]
Tons of these, but those are the past few.
Big clue?
The Illegal instruction
is thrown right when I click 'log in' on the editor credentials dialog.
Node-RED version: v4.0.9
15 Feb 20:10:55 - [info] Node.js version: v18.20.4
15 Feb 20:10:55 - [info] Linux 5.15.0-126-generic x64 LE
I then did npm install -g --unsafe-perm node-red
Still crashes.
So, fresh flows.json, fresh install of node-red and Im dead in the water.
I cant log into the editor.
Any suggestions gratefully accepted.