Failed to decrypt credentials

792 views
Skip to first unread message

Folgore

unread,
Mar 14, 2018, 6:11:23 AM3/14/18
to Node-RED
Goodmorning, I have received this error at startup the node-red:

14 Mar 10:59:21 - [warn] Error loading credentials: SyntaxError: Unexpected token M in JSON at position 0
14 Mar 10:59:21 - [warn] Error loading flows: Error: Failed to decrypt credentials


Now, I deleted the .node-red folder for recovery the flows, but I need to download all the nodes and restore the backup. What is the correct procedure for recovery?

Thank's
error.PNG

Nick O'Leary

unread,
Mar 14, 2018, 6:19:09 AM3/14/18
to Node-RED Mailing List
Hi,

the key to decrypt credentials is stored in ~/.node-red/.config.json - unless you provide your own key in your settings file.

So if you've deleted the .node-red directory then you've lost your encryption key.

There have been a couple similar reports where the .config.json file is being wiped - we haven't managed to track that down yet - we certainly don't delete it ourselves.

So...

1. strong recommend you set credentialSecret to a value you remember in your settings file. When you first set it, the runtime will migrate from the automatically generated credential secret to the one you want to use when you next deploy changes. (assuming it still has the automatically generated secret...)

2. if you simply don't know the credential secret then you will have to delete your credentials file and restart node-red. The credentials file sites alongside your flow file and has _cred in the name. You will then need to re-enter any credential properties in your flow.


Nick

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/57ca73fb-76a1-48d1-a712-07a7e48e4066%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Folgore

unread,
Mar 14, 2018, 6:36:12 AM3/14/18
to Node-RED
If it can help you, it's the second time I've received this error.
1. it was frozen during the deployment and I stopped and restarted node-red (on reboot it gave the error)
2. First, I had not done anything, just turned on the PC

I do not use my crypts and I have never deleted the config.json file

I am using a PC with Windows 10.

Il giorno mercoledì 14 marzo 2018 11:19:09 UTC+1, Nick O'Leary ha scritto:
Hi,

the key to decrypt credentials is stored in ~/.node-red/.config.json - unless you provide your own key in your settings file.

So if you've deleted the .node-red directory then you've lost your encryption key.

There have been a couple similar reports where the .config.json file is being wiped - we haven't managed to track that down yet - we certainly don't delete it ourselves.

So...

1. strong recommend you set credentialSecret to a value you remember in your settings file. When you first set it, the runtime will migrate from the automatically generated credential secret to the one you want to use when you next deploy changes. (assuming it still has the automatically generated secret...)

2. if you simply don't know the credential secret then you will have to delete your credentials file and restart node-red. The credentials file sites alongside your flow file and has _cred in the name. You will then need to re-enter any credential properties in your flow.


Nick
On 14 March 2018 at 10:11, Folgore <dario....@gmail.com> wrote:
Goodmorning, I have received this error at startup the node-red:

14 Mar 10:59:21 - [warn] Error loading credentials: SyntaxError: Unexpected token M in JSON at position 0
14 Mar 10:59:21 - [warn] Error loading flows: Error: Failed to decrypt credentials


Now, I deleted the .node-red folder for recovery the flows, but I need to download all the nodes and restore the backup. What is the correct procedure for recovery?

Thank's

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages