User name and password gets reset on restart pod


I'm using few nodes like email, azure storage and sql node where i need to set user name and passwords, whenever there is restart of pod on instance these properties gets reset and I will need to enter manually.
Please suggest how can I save those credentials in flow file or any other approach so that it does not gets reset, since it's blocker for my flows.

I’m not that familiar with liber eyes but I assume you must set up some sort of long term storage and use that for storing your flows so that when you restart they get reloaded correctly.

Hi, I'm using azure blob storage to store flow file however when I restart node red in local it works fine and credentials doesn't get reset, but on server it's not keeping the credentials

Hi dceejay,

Can you please help me how can I set flows_cred.json file path in settings file we have key as flowFile for flows.json but not for cred file

the creds file will be written to the same directory as the flow file

this will always happen UNLESS you mount a persistent volume on your pod.

yes I've a mount directory for flow file and defined mount directory path but same way i want to give path for credential file

can you please help me, where can I give path for credential file just like flow file in settings file

I gave path flow file also place the creds file in same location but still credentials are not added back

There's no option on the settings.js AFAIK to define a path for the creds file.
Anyhow, adding a path there wont prevent you from losing the flow and creds files on a pod restart; can you attach the yaml definition of the pod?

You are going to need to add a credentialSecret entry to the settings.js file and have this file persisted as well.

The problem you will be hitting is that by default on startup Node-RED will generate a random key to encrypt the flows_cred.json file with.

When you restart if you haven't added a fixed credentialSecretto the settings.js file it will generate a new one, which it will not be able to use to decrypt your old flows_cred.json file. So it will wipe all the creds out and start again.

1 Like

Hi, I've done configuration in yaml file to copy cred file after pod restart now I'm not loosing the creds but not able to deploy flow and flows_cred.json.$$$ is getting generated, gettting below error

Error saving flows: EBUSY: resource busy or locked, rename 'flows_cred.json.$$$' -> 'flows_cred.json

You can not write to files that are mounted onto pods as credentials or ConfigMaps, they are mounted as read-only

You will do much better using a database plugin to store flows/creds/settings

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.