# User name and password gets reset on restart pod

**URL:** https://discourse.nodered.org/t/user-name-and-password-gets-reset-on-restart-pod/63287
**Category:** General
**Created:** [31 May 2022 09:16 UTC](https://discourse.nodered.org/t/user-name-and-password-gets-reset-on-restart-pod/63287 "2022-05-31T09:16:44Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![An-ji](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/an-ji/32/26678_2.png) [@An-ji](https://discourse.nodered.org/u/An-ji)
#### Post date: [31 May 2022 09:16 UTC](https://discourse.nodered.org/t/user-name-and-password-gets-reset-on-restart-pod/63287/1 "2022-05-31T09:16:44Z")

</div>

Hi,

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.

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [1 June 2022 20:04 UTC](https://discourse.nodered.org/t/user-name-and-password-gets-reset-on-restart-pod/63287/2 "2022-06-01T20:04:23Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![An-ji](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/an-ji/32/26678_2.png) [@An-ji](https://discourse.nodered.org/u/An-ji)
#### Post date: [2 June 2022 02:34 UTC](https://discourse.nodered.org/t/user-name-and-password-gets-reset-on-restart-pod/63287/3 "2022-06-02T02:34:51Z")

</div>

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

---

<div class="post-metadata">

### Author: ![An-ji](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/an-ji/32/26678_2.png) [@An-ji](https://discourse.nodered.org/u/An-ji)
#### Post date: [2 June 2022 11:06 UTC](https://discourse.nodered.org/t/user-name-and-password-gets-reset-on-restart-pod/63287/4 "2022-06-02T11:06:55Z")

</div>

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

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [2 June 2022 15:58 UTC](https://discourse.nodered.org/t/user-name-and-password-gets-reset-on-restart-pod/63287/5 "2022-06-02T15:58:26Z")

</div>

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

---

<div class="post-metadata">

### Author: ![lu4t](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lu4t/32/32276_2.png) [@lu4t](https://discourse.nodered.org/u/lu4t)
#### Post date: [2 June 2022 17:14 UTC](https://discourse.nodered.org/t/user-name-and-password-gets-reset-on-restart-pod/63287/6 "2022-06-02T17:14:52Z")

</div>

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

---

<div class="post-metadata">

### Author: ![An-ji](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/an-ji/32/26678_2.png) [@An-ji](https://discourse.nodered.org/u/An-ji)
#### Post date: [3 June 2022 05:03 UTC](https://discourse.nodered.org/t/user-name-and-password-gets-reset-on-restart-pod/63287/7 "2022-06-03T05:03:08Z")

</div>

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

---

<div class="post-metadata">

### Author: ![An-ji](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/an-ji/32/26678_2.png) [@An-ji](https://discourse.nodered.org/u/An-ji)
#### Post date: [3 June 2022 05:13 UTC](https://discourse.nodered.org/t/user-name-and-password-gets-reset-on-restart-pod/63287/8 "2022-06-03T05:13:21Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/4/b480d246fa3abdddb46f01619c9a0f0ae9864945.png)

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

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/c/aca4a84e01b230462ce165ce4cae10dab486dbf0.png)

---

<div class="post-metadata">

### Author: ![lu4t](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lu4t/32/32276_2.png) [@lu4t](https://discourse.nodered.org/u/lu4t)
#### Post date: [3 June 2022 06:18 UTC](https://discourse.nodered.org/t/user-name-and-password-gets-reset-on-restart-pod/63287/9 "2022-06-03T06:18:26Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)
#### Post date: [4 June 2022 01:12 UTC](https://discourse.nodered.org/t/user-name-and-password-gets-reset-on-restart-pod/63287/10 "2022-06-04T01:12:16Z")

</div>

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 `credentialSecret`to 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.

---

<div class="post-metadata">

### Author: ![An-ji](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/an-ji/32/26678_2.png) [@An-ji](https://discourse.nodered.org/u/An-ji)
#### Post date: [28 June 2022 12:07 UTC](https://discourse.nodered.org/t/user-name-and-password-gets-reset-on-restart-pod/63287/11 "2022-06-28T12:07:57Z")

</div>

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

---

<div class="post-metadata">

### Author: ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)
#### Post date: [28 June 2022 21:14 UTC](https://discourse.nodered.org/t/user-name-and-password-gets-reset-on-restart-pod/63287/12 "2022-06-28T21:14:21Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [27 August 2022 21:14 UTC](https://discourse.nodered.org/t/user-name-and-password-gets-reset-on-restart-pod/63287/13 "2022-08-27T21:14:34Z")

</div>

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