While creating a flow, my Pi device seemed to freeze, but when I ran top it was not frozen, it was slammed. I had just tried to do a deploy, and the animated slide bar was endless moving back and forth. So I decided to check the flow file... why? Because I have seen twice before where the flow file disappeared. Any you guessed it, the flow file is gone!
root@pi3modelb1:/home/pi/.node-red# ls -l
total 108
drwxr-xr-x 2 pi pi 4096 Sep 4 18:03 context
drwxr-xr-x 2 pi pi 4096 Sep 4 18:03 cronplusdata
-rw-r--r-- 1 pi pi 144 Sep 8 03:21 flows_cred.json
drwxr-xr-x 2 pi pi 4096 Aug 31 18:48 JsonDB
drwxr-xr-x 3 pi pi 4096 Aug 30 22:04 lib
drwxr-xr-x 208 pi pi 12288 Sep 8 02:48 node_modules
-rw-r--r-- 1 pi pi 1136 Sep 8 02:48 package.json
-rw-r--r-- 1 pi pi 68278 Sep 8 02:48 package-lock.json
-rw-r--r-- 1 pi pi 538 Aug 31 21:59 settings.js
root@pi3modelb1:/home/pi/.node-red#
This is on a Pi 3 Model B. See below where and how the Pi device processor is (still) slammed. .
top - 21:54:08 up 2 days, 1:30, 1 user, load average: 3.40, 3.35, 2.03
Tasks: 94 total, 1 running, 51 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.6 us, 0.7 sy, 65.5 ni, 33.2 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 999812 total, 48016 free, 621804 used, 329992 buff/cache
KiB Swap: 102396 total, 60300 free, 42096 used. 307944 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
21254 pi 25 5 680224 593992 28472 S 262.1 59.4 6:06.51 node
321 root 20 0 52932 2712 1248 S 5.4 0.3 228:21.51 pigpiod
625 root 20 0 50420 2128 1248 S 0.4 0.2 5:37.55 python3
18494 root 20 0 0 0 0 I 0.4 0.0 0:00.86 kworker/u8:1-ev
21209 root 20 0 11660 4360 3604 S 0.4 0.4 0:00.42 sshd
Maybe someone has an idea what or how this can happen? I have left the Pi device for now, and it is still slammed for about 15 minutes. Whatever happened, my flow file is gone. So I lost the latest version of flow I was working on. Looks like the only option I have it to stop NR.
[Some Time Later...]
I checked it one more time... now about an hour later, and the CPU load of node is still 262% which is insane. Although the deploy progress animation finished (or timed out?). The flow file is still missing.
root@pi3modelb1:/home/pi/.node-red# ls -l
total 108
drwxr-xr-x 2 pi pi 4096 Sep 4 18:03 context
drwxr-xr-x 2 pi pi 4096 Sep 4 18:03 cronplusdata
-rw-r--r-- 1 pi pi 144 Sep 8 03:21 flows_cred.json
drwxr-xr-x 2 pi pi 4096 Aug 31 18:48 JsonDB
drwxr-xr-x 3 pi pi 4096 Aug 30 22:04 lib
drwxr-xr-x 208 pi pi 12288 Sep 8 02:48 node_modules
-rw-r--r-- 1 pi pi 1136 Sep 8 02:48 package.json
-rw-r--r-- 1 pi pi 68278 Sep 8 02:48 package-lock.json
-rw-r--r-- 1 pi pi 538 Aug 31 21:59 settings.js
Here is the kicker, the backup flow file is also gone. So the safe save code logic may need to be reviewed? It was my understanding that this should not happen, that the backup flows file and the current flows file should not be missing at the same time?
-rw-r--r-- 1 pi pi 25726 Sep 8 02:48 .config.json.backup
-rw-r--r-- 1 pi pi 144 Sep 8 02:47 .flows_cred.json.backup
This Pi device is not the same one that I have seen this issue on in the past, this is not the same SSD card. I have seen this on a Pi4, PiZero, and now on a Pi3. So this is not a case of the same device or media being in common to the now, 3 separate times I have seen this issue. Nor is it the same OS image or even same NR install, but it is the same version of OS, i.e. Buster (Debian 10). This time I checked for the flow file, back flow file, before I finally killed NR. It seemed that stopping NR could break the safe save logic. I was careful to not repeat that step. Oh, and this is not on the same version of NR either. Happened once on 1.0.6, 1.1.0, and now 1.1.3. Version of node.js are those installed with NR install of course.