Flow Recovery

1,169 views
Skip to first unread message

naesk

unread,
Jun 4, 2016, 1:41:45 PM6/4/16
to Node-RED
Recently Node-Red has failed to load the flows.json file, and I'm not sure for the reason :(

I'm looking for a method outside of Node-Red to recover the flows individually from the flows.json with the relevant objects (tab name,objects and wires) in order to import them back into Node-Red progressively so as to get some of my system back up and running.

Mark Setrem

unread,
Jun 4, 2016, 2:41:59 PM6/4/16
to Node-RED

It would be good to get a bit more info from you to try to understand what caused the problem 

So what platform are you running node-red on?
How do you start node-red, what does it say when its starts?


Hopefully we can then work out why its not starting and fix the issue rather than recreate your flows.

However your flows.json file will be stored within your .node-red directory usually with the name "flows_<nameofpc>.json"
Also in the directory will be a backup ".flows_<nameofpc>.json.backup"

So you could try copying both files to a safe place and then copying ".flows_<nameofpc>.json.backup" to "flows_<nameofpc>.json" and restarting node-red


Walter Kraembring

unread,
Jun 5, 2016, 4:36:09 AM6/5/16
to Node-RED
Another way I have used myself is to have a second node-red running. I have my production system for the home automation running in a Pi (in the following named the first node-red) and a second one just for experimental before I decide to add it to the production system. If you have your flow and a second node-red running, you can try this:

1) Open your flow in a text editor copy the content to your clipboard

2) In the second node-red, import from clipboard, paste and click OK

Now you should see your flow in one or several new tabs

Don't deploy!!!!

You can now selectively mark and export those parts of the flow that you know is working and then import those into your first node-red. In this way you can avoid those parts that did not work

Once finished, deploy the settings on your first node-red. On the second, you can just refresh the page without deploying and you have restored the original view

Nicholas O'Leary

unread,
Jun 5, 2016, 4:44:12 AM6/5/16
to Node-RED

I think we need to understand why Node-RED is failing to load your flows.

Some questions to get started:

1. NR logs the flow filename it is using on startup. Does that match the file you expect it to be using?

2. When it fails to load the file what does the log say?

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+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
For more options, visit https://groups.google.com/d/optout.

Julian Knight

unread,
Jun 6, 2016, 11:09:37 AM6/6/16
to Node-RED
I think that's a really useful set of ideas Walter. 

There are some limitations to the approach as not all nodes are actually sharable. For example, some of the hardware interface nodes don't support being called from 2 instances because the hardware cannot properly be shared. So a tweak to your approach is to put all hardware interfaces into a separate instance where you can control the updates separately.

Toshi Bass

unread,
Jun 7, 2016, 2:11:41 PM6/7/16
to Node-RED
I've had the same same problem a few times, usually I make a mistake in a function node or something and for whatever reason Node-Red fails to load the flows.raspberrypi.json file, so I cannot modify my mistake, solution, I backup /home/pi/.node-red/flows.raspberrypi.json file then open it in a text editor and copy the contents to the clipboard, then I delete the file and make a new file called  node-red new_file.json  which is essentially a blank canvas, start node-red then I choose import clipboard and paste in my flows. modify the mistake and deploy done.

Nicholas O'Leary

unread,
Jun 7, 2016, 2:24:08 PM6/7/16
to Node-RED

Toshi and all... we'd really like to see such a failing flow file, along with what log messages Node-RED shows on startup regarding it, so we can understand better what you're seeing and try to do something about it.

Nick


On Tue, 7 Jun 2016, 19:11 Toshi Bass, <toshib...@gmail.com> wrote:
I've had the same same problem a few times, usually I make a mistake in a function node or something and for whatever reason Node-Red fails to load the flows.raspberrypi.json file, so I cannot modify my mistake, solution, I backup /home/pi/.node-red/flows.raspberrypi.json file then open it in a text editor and copy the contents to the clipboard, then I delete the file and make a new file called  node-red new_file.json  which is essentially a blank canvas, start node-red then I choose import clipboard and paste in my flows. modify the mistake and deploy done.

--
Reply all
Reply to author
Forward
0 new messages