Flows and dashboard palette disappeared

Hi

I'm running nodered on a headless RPi and my flows suddenly disappeared !

I was trying to setup mosquitto, then start nodered, and the connexion from remote machine at IP:1880 give me a blank flow.

Also, the dashboard palette that was installed isn't visible anymore !

Always check the node-red log first. What does it say?

Sounds like you started node-red differently to how you normally started it.

Can you see anything abnormal in the log ?

i@pi3:~ $ node-red-log

 
[sudo] password for pi: 
===================
2 Apr 16:54:37 - [info] Node-RED version: v3.0.2
2 Apr 16:54:37 - [info] Node.js  version: v16.19.1
2 Apr 16:54:37 - [info] Linux 6.1.19-v8+ arm64 LE
2 Apr 16:54:42 - [info] Loading palette nodes
2 Apr 16:54:47 - [info] Settings file  : /home/pi/.node-red/settings.js
2 Apr 16:54:47 - [info] Context store  : 'default' [module=memory]
2 Apr 16:54:47 - [info] User directory : /home/pi/.node-red
2 Apr 16:54:47 - [warn] Projects disabled : editorTheme.projects.enabled=false
2 Apr 16:54:47 - [info] Flows file     : /home/pi/.node-red/flows.json
2 Apr 16:54:47 - [info] Creating new flow file
2 Apr 16:54:47 - [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.
---------------------------------------------------------------------
2 Apr 16:54:47 - [warn] Encrypted credentials not found
2 Apr 16:54:47 - [info] Starting flows
2 Apr 16:54:47 - [info] Started flows
2 Apr 16:54:47 - [info] Server now running at http://127.0.0.1:1880/

For sure, I might have started nodered in different ways

  • node-red
  • node-red-start
  • systemctl start nodered.sevice

How can I fix that ?

Yes, that.

Do a search on the system for flows.json

cd /
find . -name flows.json

If it can't find it (it will take a while because you are searching from the root of the fs), try again with sudo file ... in case you were previously running with different permissions.

Even on my i5 cpu server, that search takes minutes. On a Pi it will take much longer.

Also, what does
ls -al /home/pi/.node-red
show?
Also
ls -l /home
How did you install node-red?

It sounds like you are not logged in as the same user that you installed Node-red as ?

Here below are the return I had to the command you asked

pi@pi3:/ $ sudo find . -name flows.json
pi@pi3:/ $ ls -al /home/pi/.node-red
total 72
drwxr-xr-x 4 pi pi 4096 Apr 2 13:08 .
drwxr-xr-x 5 pi pi 4096 Apr 3 19:45 ..
-rw-r--r-- 1 pi pi 14741 Apr 1 22:59 .config.nodes.json
-rw-r--r-- 1 pi pi 95 Apr 1 22:59 .config.runtime.json
-rw-r--r-- 1 pi pi 541 Apr 2 13:08 .config.users.json
-rw-r--r-- 1 pi pi 468 Apr 2 13:08 .config.users.json.backup
drwxr-xr-x 3 pi pi 4096 Apr 1 22:59 lib
drwxr-xr-x 2 pi pi 4096 Apr 1 22:59 node_modules
-rw-r--r-- 1 pi pi 120 Apr 1 22:59 package.json
-rw-r--r-- 1 pi pi 22614 Apr 1 22:59 settings.js
pi@pi3:/ $ ls -l /home
total 4
drwxr-xr-x 5 pi pi 4096 Apr 3 19:45 pi
pi@pi3:/ $

@ smcgann99
I think I'm logged as always : As pi.

What is in package.json ?

p i@pi3:~/.node-red $ ls -al
total 84
drwxr-xr-x 4 pi pi 4096 Apr 3 21:36 .
drwxr-xr-x 5 pi pi 4096 Apr 3 19:45 ..
-rw-r--r-- 1 pi pi 14741 Apr 1 22:59 .config.nodes.json
-rw-r--r-- 1 pi pi 95 Apr 1 22:59 .config.runtime.json
-rw-r--r-- 1 pi pi 541 Apr 2 13:08 .config.users.json
-rw-r--r-- 1 pi pi 468 Apr 2 13:08 .config.users.json.backup
-rw-r--r-- 1 pi pi 2727 Apr 3 21:36 .flows.json.backup
-rw-r--r-- 1 pi pi 2730 Apr 3 21:36 flows.json
-rw-r--r-- 1 pi pi 79 Apr 3 21:29 flows_cred.json
drwxr-xr-x 3 pi pi 4096 Apr 1 22:59 lib
drwxr-xr-x 2 pi pi 4096 Apr 1 22:59 node_modules
-rw-r--r-- 1 pi pi 120 Apr 1 22:59 package.json
-rw-r--r-- 1 pi pi 22614 Apr 1 22:59 settings.js

Hi @hary,

Print the contents of package.json

cat /home/pi/.node-red/package.json

pi@pi3:~/.node-red $ cat /home/pi/.node-red/package.json
{
"name": "node-red-project",
"description": "A Node-RED Project",
"version": "0.0.1",
"private": true
}pi@pi3:~/.node-red $

Well as far as I can see there isn't any evidence that there were ever any flows there. Are you sure you are connected to the right pi?

Yes sir, sure.

But you give me some doubt now !

The dashboard palette has gone also.

Yes there is nothing there. There are no installed nodes, as can be seen from package.json.

Did the flows disappear when you rebooted, and if so when was the last time you rebooted?

I don't know exactly when it did happen.
I was struggling making mosquitto working. I made so many manipulations, I don't remember..
Then, I came back to nodered to try my nodes with mosquitto and when I opened my browser at myIP:1880, there was a blank page ! Only 1 blank flow !

I think you alrady did this but maybe try once more:
What does sudo find / -name flows.json -ls 2>/dev/null show you?

Do you have Docker or other fancy VM software on this machine?

As an experiment, add a node to the flow, deploy it, then power the pi down (remove power completely) for a minute or so, then power it up again and see if the flow is still there.

Further to @jbudd's post, does the command
which docker
show anything?

@ jbudd

pi@pi3:~ $ sudo find / -name flows.json -ls 2>/dev/null
[sudo] password for pi: 
    58006      4 -rw-r--r--   1 pi       pi           2730 Apr  3 22:43 /home/pi/.node-red/flows.json
pi@pi3:~ $ 

No, no Docker, no VM.
I'm absolute nerd, so I follow the basic install informations.

@Colin
Today, the flow I made yesterday is still there.

pi@pi3:~ $ which docker
pi@pi3:~ $ 

There is no other flows.json on the machine.
You don't seem to be trapped inside a Docker container.
Your disk/sd card has not failed and become read-only, nor do you currently have the overlay filesystem enabled.

The only thing I can think of to explain it is that the overlay filesystem was enabled when you installed NR, in which case all trace would disappear when you rebooted.

What date did you install Node-red?
What does ls -l /var/log/nodered-install* show?
There should be a non-zero size file for each [recent] time you installed Node-red (except if the overlay filesystem was enabled).