Corrupt flow export?

Hi,

I had a pi die, and was attempting to restore my last node-red export. It seems that the export didn't format correctly and is missing the delimiters.

Anyone have an easy fix, or should I start creating a macro to help expand out correctly.

Here is a snippet of what I ended up with:

[{id9cae0ae2.ed48a8,typetab,labelMain Control},{ide1868fe3.26484,typetab,labelAWS IOT},{ide30e5d05.38c8,typetab,labelUNIFI Clients},{id3a1d15d5.7b70da,typetab,label1wire & weather test},{ide6f8ec79.77b28,typetab,labelAudio Test},{id30d8bee8.bd67c2,typetab,labelFlow 1},{ide8acb282.bd776,typetab,labelE-Ink},{idc9f6c470.525a78,typesubflow,nameSubflow 1,info,in[],out[]},{idec0d1ecc.71321,typeui_tab,z,nameHome,icondashboard,order1},{idf50c77cb.f84c98,typeui_group,z,nameMain Display

Compared to the nomal formatting below. It seems to be missing the "quotes" and "colons."

[{"id":"b9884d5c.5211e","type":"inject","z":"2a15e348.a7c6dc",
"name":"","topic":"","payload":"hi","payloadType":"str","repeat"
:"","crontab":"","once":false,"x":294,"y":123,"wires":[["cb6af
000.5a3e6"]]},{"id":"cb6af000.5a3e6","type":"debug","z":"2a15e
348.a7c6dc","name":"","active":true,"console":"false","complet
e":"false","x":447,"y":123,"wires":[]}]

How did you do your export to end up with such a mess?

In principle it's possible to come up with a script to try and improve matters.
For example here is a sed file to partially fix your snippet

s/{id/\{\"id\":\"/g;
s/\,type/\",\"type\":\"/g;
s/\,label/\"\,\"label\":\"/g;
s/\,name/\"\,\"name\":\"/g;
s/\,icon/\"\,\"icon\":\"/g;
s/\}\,/\"\}\,/g

Each line of the script reformats a single key in the json and there are a lot of possible keys. (My simple flow file has 190)
Running it gives something like this. I've ringed a couple of problems.

  • What format data can occur within square brackets in a flows file?
  • Numeric values might get quoted.

So I imagine you will be better off rebuilding from scratch.

Edit - SD cards sometimes go read-only before actually dying. Are you sure you can't extract the undamaged flows file from the card?

Have you got a backup of the .node-red folder on the pi? That will contain the full flows file.

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