# Node-red-contrib-persist & localhost

**URL:** <https://discourse.nodered.org/t/node-red-contrib-persist-localhost/89713>\
**Category:** General\
**Created:** [23 July 2024 22:28 UTC](https://discourse.nodered.org/t/node-red-contrib-persist-localhost/89713 "2024-07-23T22:28:32Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![sradoff](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sradoff/32/93079_2.png) [@sradoff](https://discourse.nodered.org/u/sradoff)\
**Post date:** [23 July 2024 22:28 UTC](https://discourse.nodered.org/t/node-red-contrib-persist-localhost/89713/1 "2024-07-23T22:28:32Z")

</div>

I have inserted Node-red-contrib-persist into a recent flow running the most current version of node-red. After a Deploy, the dashboard can no longer be displayed. Both Microsoft Edge and Google Chrome report “Connection Refused.” This has occurred on two different Win11 systems and RaspberryPI. The only way out of this problem is to replace node-red and the local node-red folder.

---

<div class="post-metadata">

**Author:** ![HaroldPetersInskipp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/haroldpetersinskipp/32/42319_2.png) [@HaroldPetersInskipp](https://discourse.nodered.org/u/HaroldPetersInskipp)\
**Post date:** [23 July 2024 22:32 UTC](https://discourse.nodered.org/t/node-red-contrib-persist-localhost/89713/2 "2024-07-23T22:32:26Z")

</div>

What do the logs say?

---

<div class="post-metadata">

**Author:** ![sradoff](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sradoff/32/93079_2.png) [@sradoff](https://discourse.nodered.org/u/sradoff)\
**Post date:** [23 July 2024 22:45 UTC](https://discourse.nodered.org/t/node-red-contrib-persist-localhost/89713/3 "2024-07-23T22:45:16Z")

</div>

I am unfamiliar with the logs. Can you provide me direction?

---

<div class="post-metadata">

**Author:** ![HaroldPetersInskipp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/haroldpetersinskipp/32/42319_2.png) [@HaroldPetersInskipp](https://discourse.nodered.org/u/HaroldPetersInskipp)\
**Post date:** [23 July 2024 23:22 UTC](https://discourse.nodered.org/t/node-red-contrib-persist-localhost/89713/4 "2024-07-23T23:22:47Z")

</div>

On Raspberry Pi they can be found in `/var/log/`  
On Windows it depends on how you are starting Node-RED but they should look something like this on startup:

```auto
Welcome to Node-RED
===================

23 Jul 16:29:50 - [info] Node-RED version: v4.0.2
23 Jul 16:29:50 - [info] Node.js version: v20.7.0
23 Jul 16:29:50 - [info] Windows_NT 10.0.19045 x64 LE
23 Jul 16:29:50 - [info] Loading palette nodes
23 Jul 16:29:55 - [info] Settings file : C:\Users\Bannd\.node-red\settings.js
23 Jul 16:29:55 - [info] Context store : 'memoryOnly' [module=memory]
23 Jul 16:29:55 - [info] Context store : 'file' [module=localfilesystem]
23 Jul 16:29:55 - [info] User directory : \Users\Bannd\.node-red
23 Jul 16:29:55 - [warn] Projects disabled : editorTheme.projects.enabled=false
23 Jul 16:29:55 - [info] Flows file : \Users\Bannd\.node-red\flows.json
23 Jul 16:29:55 - [info] Server now running at http://127.0.0.1:6969/
23 Jul 16:29:55 - [info] Starting flows
23 Jul 16:29:57 - [info] Started flows

```

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [24 July 2024 09:20 UTC](https://discourse.nodered.org/t/node-red-contrib-persist-localhost/89713/5 "2024-07-24T09:20:31Z")

</div>

> [@sradoff](#):
>
> Connection Refused

Do you have auth turned on for the Editor? Because the API it defines requires "persist.write" permission:

> <https://github.com/DeanCording/node-red-contrib-persist/blob/master/persist.js#L171>

---

<div class="post-metadata">

**Author:** ![sradoff](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sradoff/32/93079_2.png) [@sradoff](https://discourse.nodered.org/u/sradoff)\
**Post date:** [25 July 2024 00:33 UTC](https://discourse.nodered.org/t/node-red-contrib-persist-localhost/89713/6 "2024-07-25T00:33:47Z")

</div>

Thanks all for your feedback. Currently I am testing the flows on a Win11 node-red installation. I made sure the target directory has R/W permissions for persists nodes..

The persists nodes appears to work properly in a test flow. I have built a couple of flows that appear to work without persists nodes. Once I install the persists nodes and integrate them with my existing flows and deploy, connection is lost. The console comes up with extensive errors. I have to remove the .node-red directory and replace it with one where there are no persist nodes to deploy successfully. I am still chasing the issue.

---

<div class="post-metadata">

**Author:** ![HaroldPetersInskipp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/haroldpetersinskipp/32/42319_2.png) [@HaroldPetersInskipp](https://discourse.nodered.org/u/HaroldPetersInskipp)\
**Post date:** [25 July 2024 01:09 UTC](https://discourse.nodered.org/t/node-red-contrib-persist-localhost/89713/7 "2024-07-25T01:09:39Z")

</div>

> [@sradoff](#):
>
> The console comes up with extensive errors.

Could you copy and paste them here?

---

<div class="post-metadata">

**Author:** ![sradoff](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sradoff/32/93079_2.png) [@sradoff](https://discourse.nodered.org/u/sradoff)\
**Post date:** [25 July 2024 13:19 UTC](https://discourse.nodered.org/t/node-red-contrib-persist-localhost/89713/8 "2024-07-25T13:19:11Z")

</div>

Simple Flow with persist debug data after deploy

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/9/196f2fae2c64bbcb6fbcbd16c46e788c0d9cb657.png)

Console prior to flow with persist  
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.

25 Jul 08:57:42 - [warn] Encrypted credentials not found  
25 Jul 08:57:42 - [info] Waiting for missing types to be registered:  
25 Jul 08:57:42 - [info] - persist-store  
25 Jul 08:57:42 - [info] Server now running at [http://127.0.0.1:1880/](http://127.0.0.1:1880/)  
25 Jul 08:59:55 - [info] Installing module: node-red-contrib-persist, version: 1.1.1  
25 Jul 08:59:58 - [info] Installed module: node-red-contrib-persist  
25 Jul 08:59:58 - [info] Missing type registered: persist-store  
25 Jul 08:59:58 - [info] Starting flows  
25 Jul 08:59:58 - [info] Started flows  
25 Jul 08:59:58 - [info] Added node types:  
25 Jul 08:59:58 - [info] - node-red-contrib-persist:persist-store  
25 Jul 08:59:58 - [info] - node-red-contrib-persist:persist in  
25 Jul 08:59:58 - [info] - node-red-contrib-persist:persist out  
25 Jul 09:00:18 - [info] Stopping flows  
25 Jul 09:00:18 - [info] Stopped flows  
25 Jul 09:00:18 - [info] Updated flows  
25 Jul 09:00:18 - [info] Starting flows  
25 Jul 09:00:18 - [warn] [RED.events] Deprecated use of "nodes-started" event from "C:\Users\srado.node-red\node\_modules\node-red-contrib-persist\persist.js:164:20". Use "flows:started" instead.  
25 Jul 09:00:18 - [info] Started flows

Console with persist after deploy

 ![deploy failure](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/1/319864a092876b27e091dcdf63f21ec6563cb33d.png)

---

<div class="post-metadata">

**Author:** ![M-a-r-t-i-n](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/m-a-r-t-i-n/32/52391_2.png) [@M-a-r-t-i-n](https://discourse.nodered.org/u/M-a-r-t-i-n)\
**Post date:** [25 July 2024 15:09 UTC](https://discourse.nodered.org/t/node-red-contrib-persist-localhost/89713/9 "2024-07-25T15:09:17Z")

</div>

I've had this error message with the persist node in the past. To fix it you edit this file;

"C:\Users\srado.node-red\node\_modules\node-red-contrib-persist\persist.js:

and change the 2 occurrences of "nodes-started" to "flows:started"

you will probably have restart node-red again afterwards.

the image below shows the code changes. Left window shows the correct code.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/8/3854ab8840b0150db48cee528c96001fead5eb46.png)

---

<div class="post-metadata">

**Author:** ![sradoff](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sradoff/32/93079_2.png) [@sradoff](https://discourse.nodered.org/u/sradoff)\
**Post date:** [31 July 2024 14:26 UTC](https://discourse.nodered.org/t/node-red-contrib-persist-localhost/89713/10 "2024-07-31T14:26:39Z")

</div>

Thank you for the assist. I had already discovered this solution.

---

<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:** [14 August 2024 14:27 UTC](https://discourse.nodered.org/t/node-red-contrib-persist-localhost/89713/11 "2024-08-14T14:27:24Z")

</div>

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