Node-red-contrib-persist & localhost

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.

What do the logs say?

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

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:

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

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

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.

Could you copy and paste them here?

Simple Flow with persist debug data after deploy

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/
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

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.

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

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