Warning "Encrypted credentials not found"

Hi all,

I successfully installed Node Red on a Windows VM and it works.
Now I installed it on my Raspberry Pi and I always get the warning "Encrypted credentials not found" at startup and I cannot start any flows. I already tried to set/change the credentialsSecret, adminAuth and httpNodeAuth settings but that didn't change anything. Also also completely reinstalled the Raspberry OS and installed Node Red again. But nothing helps.
Any ideas?
Thank you

Can you stop and restart node red in a command window and post the full startup log here please. Copy/paste not screenshot please. You can stop it and restart using
node-red-stop
node-red-start

Here is the startup log:

admin@raspberrypi:~ $ node-red-pi
18 Jul 06:05:03 - [info] 

Welcome to Node-RED
===================

18 Jul 06:05:03 - [info] Node-RED version: v3.0.2
18 Jul 06:05:03 - [info] Node.js  version: v16.20.1
18 Jul 06:05:03 - [info] Linux 6.1.21-v8+ arm LE
18 Jul 06:05:06 - [info] Loading palette nodes
18 Jul 06:05:11 - [info] Settings file  : /home/admin/.node-red/settings.js
18 Jul 06:05:11 - [info] Context store  : 'default' [module=memory]
18 Jul 06:05:11 - [info] User directory : /home/admin/.node-red
18 Jul 06:05:11 - [warn] Projects disabled : editorTheme.projects.enabled=false
18 Jul 06:05:11 - [info] Flows file     : /home/admin/.node-red/flows.json
18 Jul 06:05:11 - [info] Creating new flow file
18 Jul 06:05:11 - [warn] Encrypted credentials not found
18 Jul 06:05:11 - [info] Server now running at http://127.0.0.1:1880/
18 Jul 06:05:11 - [info] Starting flows
18 Jul 06:05:11 - [info] Started flows

I cannot start any flows.

Can you give some more detail?

That startup log says that Node-red has started, but there are no flows to deploy.

Are you trying to access the editor from a browser on your PC?
The URL needs to be the IP address of the Pi, not 127.0.0.1, and port 1880

As you can see from the log the flows have been started. For some reason you have lost the credentials. That probably means that either the credentials secret in the pi is not the same as in the VM or you have not transferred the secrets file. To recover you can go to each of the nodes that have credentials in them and put them in again.
If you want to work out why it does not work then tell us exactly how you transferred the setup from the VM to the Pi, and in particular tell us how you have setup the credential secret in the VM.

[Edit] Also note these lines in the log

That means you have not copied the flows file across correctly. I suspect that you are not using the same version of node-red on the two systems. The default flows and credentials filename changed between versions at some point.

I only try to access from the Pi itself. I get the editor open but when I select "Restart Flows" I always get:

msg : string[31]
"Encrypted credentials not found"

in the debug window. I thought the flow does not work, but it does. Still I get this warning.

I did not try to transfer anything from my Windows PC. I do all on my Raspberry PI. And it seems to work (kind of) but I always get this warning. Also I get this warning in the debug window when restarting flows.

I just created a new flow and now the startup log looks like this:

Welcome to Node-RED
===================

18 Jul 10:49:40 - [info] Node-RED version: v3.0.2
18 Jul 10:49:40 - [info] Node.js  version: v16.20.1
18 Jul 10:49:40 - [info] Linux 6.1.21-v8+ arm LE
18 Jul 10:49:41 - [info] Loading palette nodes
18 Jul 10:49:44 - [info] Settings file  : /home/admin/.node-red/settings.js
18 Jul 10:49:44 - [info] Context store  : 'default' [module=memory]
18 Jul 10:49:44 - [info] User directory : /home/admin/.node-red
18 Jul 10:49:44 - [warn] Projects disabled : editorTheme.projects.enabled=false
18 Jul 10:49:44 - [info] Flows file     : /home/admin/.node-red/flows.json
18 Jul 10:49:44 - [warn] Encrypted credentials not found
18 Jul 10:49:44 - [info] Server now running at http://127.0.0.1:1880/
18 Jul 10:49:44 - [info] Starting flows
18 Jul 10:49:44 - [info] Started flows

Have you added credentials to any node & deployed?

Have you set the secret in your settings file?

Is something broke / not working or are you just curious about the message?

I added the credentialsSecret adminAuth and httpNodeAuth settings in the settings file.
To be honest contrary to my assumption all seems to work. So I am just curious about this message since it disappeared on my Windows installation of Node Red after making the mentioned settings.

It disappeared because you actually created a credential that got written to disk (created the file).

That applies to the Windows VM installation but not to the Raspberry Pi. There is still have it and I don't know how to get rid of id.

Any further ideas?

For example add an mqtt node and enter an IP address for the broker (doesn't matter if it isn't running a broker) then deploy.

Deploying seems to work but with every restart of the flows I get the mentioned message in the debug window.

You aren't by any chance using the overlay filesystem?

When you deploy does it create a credential file?
Is it still there when you reboot?

If you create a new flow and deploy, is that still there when you reboot?

I did not change configuration regarding filesystem. I am just using the original Raspberry Pi OS and installed Node Red.
After reboot my flows are still there.
I don't see a credentials file. Should it be located in ~/.node-red?
While Node Red is running the folder contains these files:

admin@raspberrypi:~/.node-red $ ls -a
.                   .config.users.json.backup  node_modules       settings.js
..                  flows.json                 package.json
.config.nodes.json  .flows.json.backup         package-lock.json
.config.users.json  lib                        .sessions.json

Please answer definitively

Have you set any credential (any at all) and deployed on the problematic device?

After deploying a change with creds, you should see another file (named something ?creds?)

Then restart node-red - do you still see the warning?

Then restart the PI, does the file still exist?

If the flow file that Node-red is using is ~/.node-red/flows.json then the credentials file should be ~/.node-red/flows_cred.json
Can you please show us the output of these commands?

Edit: Added one more grep command.

whoami
grep WorkingDirectory /etc/systemd/system/multi-user.target.wants/nodered.service
grep User= /etc/systemd/system/multi-user.target.wants/nodered.service
find /home -name flows.json -ls
grep flowFile: /home/*/.node-red/settings.js
touch ~/.node-red/flows_cred.json

Now reboot, login and do
ls -l ~/.node-red/*.json

In ~/.node-red/settings.js I have set the credentialSecret value.
After deploying changes I don't see any file with "creds" in the name.

admin@raspberrypi:~/.node-red $ whoami
admin
admin@raspberrypi:~/.node-red $ grep WorkingDirectory /etc/systemd/system/multi-user.target.wants/nodered.service
grep: /etc/systemd/system/multi-user.target.wants/nodered.service: No such file or directory
admin@raspberrypi:~/.node-red $ grep User= /etc/systemd/system/multi-user.target.wants/nodered.service
grep: /etc/systemd/system/multi-user.target.wants/nodered.service: No such file or directory
admin@raspberrypi:~/.node-red $ find /home -name flows.json -ls
   145741      4 -rw-r--r--   1 admin    admin        1144 Jul 19 21:06 /home/admin/.node-red/flows.json
admin@raspberrypi:~/.node-red $ grep flowFile: /home/*/.node-red/settings.js
    flowFile: "flows.json",
admin@raspberrypi:~/.node-red $ touch ~/.node-red/flows_cred.json

I will reply again for ls output after reboot