Nodered export/import | copy/paste clipboard

Greetings. I'll use a very simple flow example comprising of an injection node and a debug node for my question:


Both nodes have the name ‘sensor01’ in them, as well as in other fields/variables.

Problem: if I do a copy/paste to nodered's internal clipboard, new nodes' IDs will be auto-generated, runtime can be saved - no problem.

But, lets say I want to EDIT the clipboard contents BEFORE pasting. In this case, I use the EXPORT nodes to clipboard, edit on a non-intrusive text editor, COPY that and IMPORT back to nodered with, say, changes like 'sensor01' now to 'sensor02'. Doing it this way, even with unique nodes ID (no duplicates) is crashing my nodered v.4.0.2, ultimately giving me a '502 - Bad Gateway' , restarting and not saving the changes.

Questions: Why can´t I bring back via IMPORT clipboard contents? Even if I don't change ANYTHING in the original EXPORTed clipboard contents, I still get nodered to 'crash'. If nodered editor finds the duplicate IDs, the option to 'copy' nodes appear but, alas, crashes anyways.

Any suggestions? Any way to EDIT contents from nodered's internal clipboard within itself w/o EXPORT? Thanks! :red_circle:

Welcome to the forum

At what point does it crash?

Please post the original export and the edited one so we can try it.

In order to make flows readable and usable it is necessary to surround them with three backticks (also known as a left quote or backquote ```)

``` 
   code goes here 
```

See this post for more details - How to share code or flow json

1 Like

Thank you - here's the sample code:

[{"id":"bb89c9e04a21c459","type":"inject","z":"3c0b43231e70ec35","name":"sensor01","props":[{"p":"asking","v":"sensor01","vt":"str"},{"p":"meaning","v":"of everything","vt":"str"},{"p":"answer","v":"42","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":1080,"y":140,"wires":[["3611609dafe34c86"]]},{"id":"3611609dafe34c86","type":"debug","z":"3c0b43231e70ec35","name":"sensor01","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1260,"y":140,"wires":[]}]

If a 'select' the flow/nodes and COPY/PASTE - no issues. But I can´t EDIT the contents (changing the 'sensor01' to 'sensor02' for ex).
If I, then, 'select' the flow/nodes and EXPORT/EDIT/IMPORT, then the editor EITHER crashes when trying to SAVE or brings the 'duplicate message' and asking if I want to COPY/OVERWRITE. Whatever I select, will crash, restart without saving. Hope this helps, thanks again! :red_circle:

When you import do you see this popup? Which option do you pick?

I am still not clear. Tell us exactly what to do with that flow to see the problem.

Also please stop node red and then start it again in a command window and post the resulting startup log.

Thank you all - I was in the process of acquiring the requested info and going step-x-step collecting the COPY/PASTE vs EXPORT/IMPORT but now the '502 - Bad Gateway' problem is NOT showing/'crashing'; actually now the SAVE takes about a minute or so, but it WORKS. I tried it 3 times, including changing the data 'sensor01' to 'sensor02' and 'sensor03' everywhere and, other than taking/pausing for a minute, it actually saves it - of course, when I was about to document the issue it's now gone. I suspect a memory issue since I know I'm running low on memory on the server hosting the nodeRED.
Since I can´t replicate this any longer, I will upgrade the server memory (soon) and try again. If the problem persists or comes back then I'll open a new post with all relevant info. Thank you again! :red_circle:

I've been chosing 'Import copy' - but now is working. See my other reply. Thanks, :red_circle: