Flow changes not surving a reboot :(

I had this happen once before (I don't reboot my main machine very often) but when it happened I just put it down to some glitch in the matrix but it#s happened again :frowning:

I have a flow that looks out for files xxx (1).scad and renames them to xxx.scad

In the past few weeks I added ability to launch exec script to auto-generate an .stl file from it

I had to power cycle the house yesterday (to reset EV charger) and then yesterday I realised that my flow modification had gone and when I checked date of flows.json it was dated 18th October :frowning:

Going try a bit more attention in future to try and work out what's going on

Hopefully my NVME drive hasn't gone read-only!

Backup the .node-red directory to a USB stick or similar and do a full power cycle, with power off for 30 seconds. Reboot and check the flows.

Just trying out a few things first
e.g. I've made changes and deployed but the datetime of my flows hasn't changed

simon@simon-HP-Desktop-M01-F1xxx:~/.node-red$ ls -l --sort=time
total 3372
drwxr-xr-x   6 simon simon    4096 Oct 28 10:01 context
-rw-rw-r--   1 simon simon 1281506 Oct 18 17:37 flows.json
-rwxr-xr-x   1 simon simon  387659 Oct 16 11:44 package-lock.json
-rwxr-xr-x   1 simon simon    2307 Oct 16 11:44 package.json
drwxr-xr-x 598 simon simon   20480 Oct 16 11:44 node_modules
-rw-rw-r--   1 simon simon     203 Jul 24 17:47 flows_cred.json
-rw-rw-r--   1 simon simon   14445 May 31 11:26 alert.mp3
-rw-rw-r--   1 simon simon 1549106 Nov 20  2024 flows.oldjson
-rwxr-xr-x   1 simon simon   20488 Dec 20  2023 settings.js
-rwxr-xr-x   1 simon simon    6746 Sep 12  2023 alexaFile.txt
-rwxr-xr-x   1 simon simon   20502 Sep 10  2023 settings1881.js
drwxr-xr-x   2 simon simon    4096 Aug 30  2023 storage-9999d6bdbd001279
drwxr-xr-x   4 simon simon    4096 Aug 30  2023 node-red-matter
-rwxr-xr-x   1 simon simon  109222 Dec  2  2022 multicam.png
drwxr-xr-x   3 simon simon    4096 Jan 28  2022 lib

Just making sure I'm looking at the right machine :slight_smile:

I've also added a backup flow for this machine. I didn't previously have one as my main machine is generally just an NR playground and doesn't run any of the house IoT stuff

[edit] But of course the backup won't be any good if the flows.json file isn't actually being updated on the computer drive.
I've had Pi SD cards go read only but hopefully my 1TB NVME hasn't!

Can you check your settings.js for the readOnly option?

Something like readOnly: true

Just a thought... :thinking:

do a ls -la to also show hidden files... what dates are on the flows backup files ? (Sadly you've done a deploy since so they may be overwritten)

simon@simon-HP-Desktop-M01-F1xxx:~/.node-red$ ls -la --sort=time
total 6408
drwxr-x---  90 simon simon   73728 Oct 29 03:00 ..
drwxr-xr-x   6 simon simon    4096 Oct 28 10:01 context
drwxr-xr-x   7 simon simon    4096 Oct 18 17:37 .
-rw-rw-r--   1 simon simon 1281506 Oct 18 17:37 flows.json
-rw-rw-r--   1 simon simon 1281505 Oct 18 17:37 .flows.json.backup
-rw-rw-r--   1 simon simon   81959 Oct 16 11:45 .config.nodes.json
-rw-rw-r--   1 simon simon   82069 Oct 16 11:45 .config.nodes.json.backup
-rwxr-xr-x   1 simon simon  387659 Oct 16 11:44 package-lock.json
-rwxr-xr-x   1 simon simon    2307 Oct 16 11:44 package.json
drwxr-xr-x 598 simon simon   20480 Oct 16 11:44 node_modules
-rw-rw-r--   1 simon simon    2054 Jul 30 14:30 .config.users.json
-rw-rw-r--   1 simon simon    2061 Jul 30 14:30 .config.users.json.backup
-rw-rw-r--   1 simon simon     203 Jul 24 17:47 flows_cred.json
-rw-rw-r--   1 simon simon     263 Jul 24 17:47 .flows_cred.json.backup
-rw-rw-r--   1 simon simon     163 Jun 10 18:10 .config.runtime.json
-rw-rw-r--   1 simon simon     133 Jun 10 18:10 .config.runtime.json.backup
-rw-rw-r--   1 simon simon   14445 May 31 11:26 alert.mp3
-rw-rw-r--   1 simon simon 1549106 Nov 20  2024 flows.oldjson
-rw-rw-r--   1 simon simon 1549351 Nov 20  2024 .flows.json
-rwxr-xr-x   1 simon simon   20488 Dec 20  2023 settings.js
-rwxr-xr-x   1 simon simon    6746 Sep 12  2023 alexaFile.txt
-rwxr-xr-x   1 simon simon   20502 Sep 10  2023 settings1881.js
drwxr-xr-x   2 simon simon    4096 Aug 30  2023 storage-9999d6bdbd001279
drwxr-xr-x   4 simon simon    4096 Aug 30  2023 node-red-matter
-rwxr-xr-x   1 simon simon  109222 Dec  2  2022 multicam.png
drwxr-xr-x   3 simon simon    4096 Jan 28  2022 lib

readOnly not set

    /** If you installed the optional node-red-dashboard you can set it's path
     * relative to httpNodeRoot
     * Other optional properties include
     *  readOnly:{boolean},
     *  middleware:{function or array}, (req,res,next) - http middleware
     *  ioMiddleware:{function or array}, (socket,next) - socket.io middleware
     */

Restart node red in a command window and check the output to make sure you are using the flows file that you think you are.

Are you absolutely certain that the dir listing you have shown is for the same pi that you are accessing via the node-red editor?

"absolutely" no :slight_smile: but all clues point to me looking at the flows on this (my main desktop HP machine)

Not going to restart NR/machine until I get a working backup system running again

It looks odd that context has a newer timestamp than .

Is .node-red or any of it's subdirectories a link to a different file, on a network drive maybe?

This is my main desktop machine that I'm typing this on

NR is just in the standard /home/username/.node-red folder

I start it up manually each time I reboot by simply opening new terminal window
image

I'm in no illusion that it is probably me doing something wrong but by golly, I'm stumped as to what that is :slight_smile:

A chatbot explained to me that it's perfectly normal for a subdirectory to have a more recent timestamp than it's containing directory.

That is maybe a bit unusual but it should work. If Node-red crashed it wouldn't restart but you would see a notification in the editor.

I was going to suggest echo hello > ~/.node-red/testfile, rebooting and seeing if it's still there, and trying to read the file from Node-red, but

Your filesystem isn't full? df -h

Progress!

I've found that my flows.json is being saved in my /home/simon folder instead of /home/simon/.node-red

I've found the issue

Turns out I don't manually start NR on this machine - I scripted it and got folder wrong!

image

#Plonker :slight_smile:

4 Likes

Good to hear you found the problem.

It is nice to see, this happens not only to me ... Doesn't help you, I know, however, makes a lot of people feel better too, I assume :slight_smile:

Glad you found a solution!