Node red flow getting corrupted on power off

182 views
Skip to first unread message

Steven Keller

unread,
Jul 11, 2014, 6:35:26 PM7/11/14
to node...@googlegroups.com
I have an embedded device, similar to a Pi with no monitor or keyboard.  I manage it through web interface and serial port.  I have had some issues during testing that the flow file gets corrupted if the power is suddenly removed.  (A real world possibility.)  On boot up I believe the error is something like "unexpected end".  The 2 or 3 times it has happened I still had my browser open to the flow and was able to re-Deploy to restore it.  However, in a real world situation that wouldn't be possible.  Could it be because I had the browser open to the workspace that caused the file to be corrupted?  I also had some debug tags running.  

I am getting ready to install this next week at a location that I won't be able to easily access.  Is there some way to make it more "fault tolerant"?

Thanks


Antoine Aflalo

unread,
Jul 12, 2014, 1:21:31 AM7/12/14
to node...@googlegroups.com

Hi Steven,

Node-RED is saving the flow only when you are pushing the deploy button. If I'm right that's the only time you have a write done on the file system. (other than when some Node do it by themselves)

Even with the Pi I had some power problem in the beginning that was leading to the corruption of the filesystem (even if it was an EXT4 with journalisation activated). Maybe it's also what you are experimenting. You should check the kernel log to see if there is any message about this.

Do you have the exact message that Node-RED gave you when you rebooted?

Antoine Aflalo

--
http://nodered.org
---
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.
For more options, visit https://groups.google.com/d/optout.

Steven Keller

unread,
Jul 17, 2014, 1:53:13 PM7/17/14
to node...@googlegroups.com
I have not been able to duplicate the problem again.  It makes me a bit nervous not knowing what it was exactly.  If I come across it again I will update this post.

Thanks!

Dave C-J

unread,
Jul 18, 2014, 3:47:32 AM7/18/14
to node...@googlegroups.com
Hi ,

as Antoine says the only time we write to that file is on deploy. More recent versions copy the existing flow file to a backup called flows.backup prior to writing the new file so there should be a one level backup available to you. Of course how much is still cached in memory prior to the actual physical write is down to the OS and the type of file system in use, we we don't have control over.

If you are really thinking about a remote embedded deployment I would take extra precautions such as making as much of the file system read-only as possible - and indeed there is no reason that all of the Node-RED files cannot be read-only - obviously then you can't just log in via web and re-deploy - you would have to ssh in - make the flow file read-write - then edit the flow and re-deploy then make it read-only again.

Plenty of guides from the simple to the complex... - depends how far you want to go.. https://wiki.debian.org/ReadonlyRoot


Reply all
Reply to author
Forward
0 new messages