# I've lost everything. CONNECTION LOST TO MACHINE error - subflow connections

**URL:** <https://discourse.nodered.org/t/ive-lost-everything-connection-lost-to-machine-error-subflow-connections/24782>\
**Category:** General\
**Created:** [13 April 2020 22:34 UTC](https://discourse.nodered.org/t/ive-lost-everything-connection-lost-to-machine-error-subflow-connections/24782 "2020-04-13T22:34:50Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [13 April 2020 22:34 UTC](https://discourse.nodered.org/t/ive-lost-everything-connection-lost-to-machine-error-subflow-connections/24782/1 "2020-04-13T22:34:51Z")

</div>

And I don't think there is any going back.

I did backup the files, but alas they were in the same directory and so NODE-RED wiped the backups I made.

I've lost **all** my sub-flows......

**All** my tabs (there was about 30 of them).

Long post.

I am seeing this error coming up a bit these days from other people too.

I am on a NUC - intel i7 I think. It has power. It isn't a RasPi.

It has memory.

Some of the tabs are "disabled" and some aren't. (That's life)

This also ties in with the machine's _load_.

I'm using FF (on all machines) but the RasPies are all headless.

Now and then when I am editing flows on ANY machine, it just _locks up_.

I have a "performance" tab and it does some wild stuff.

I'll get to that later. (maybe a later post).

I saw that NR had made .backup files of my stuff.

I **coppied** them to a file name -BACKUP to make it even more different.  
Wiped.

I won't do anything with Node-Red just now.  
I've also disabled it `sudo systemctl disable nodered.service`

On an off chance: Can I get those files back?

* * *

# The problem/s that are/were happening.

When modifying flows on ANY machine, it would just _lock up_ (I know I have said this, but to keep things altogether).  
The performance tab would show loads ranging from 20 --\> thousands (sometimes) but maybe 70's 80's.

Fluctuations all over the place.

After some time it would settle down and _things would be normal_.

Two things I have learnt:  
1 - if I open `top` (hold on!) and look I would see the CPU load at (or greater than) 100%.  
There would be Node-red listed and now and then `web-services` (or something like that) listed showing massive load.  
2 - it wasn't always on the machine of interest. Though mostly I think it was.

(Yeah, this isn't helping me really)

I have a few _foreign_ nodes installed as they seem to help me get things done.  
No offence to anyone for what I am about to say. It is my best recollection of things.  
WAY way back, I added `ui_level`.

Shortly there after that machine would _lock up_ as per what is happening now.

I have a few more nodes like that and I am slightly suspicious there is something going on with them.  
Though I did mention it at the time and tried to give as much information, I could never prove anything.

Moving on:  
Another thing I learnt was this `web-services` thing.....  
It was really stumping me.  
Yes, I had some fancy dashboards, but it just didn't _feel_ right.

The other day I found the problem.  
That entry `web-services` hogging 99% of the CPU load, and there were multiple lines of it too!  
That is/was a _loop_ in a flow.  
Luckily I found it fairly quickly with help of my other thread about message counting and frequency.  
[This thread](https://discourse.nodered.org/t/help-finding-the-source-of-this-error/24181)  
I found the problem.

The frequency of message parsing was \> 600 **per second**.

I would try to do things and NR was just _dead in the water_.  
After several things, I stated it in `--safe` mode and added the code to catch that error.

# _So: where's all this going?_

Well,  
That _loop_ generated these `web-services` errors and all that.  
Though I am not exactly seeing that now, I am wondering if all the flows I have are _spiking_ the load of NR at times and causing this _lag_?

I'd better post this as I am really stuck and would prefer to get things back to normal.  
(Yeah, back up. I did. I just didn't realise NR wiped it's own directory as much as it does.)

If you are still reading:  
I would like to get my old files back if at all possible.

Sorry if I left this a bit _in the air_. I wanted to get it out there ASAP to get help, but also wanted to share what I have recently seen. I'll get back to my theories when I calm down more than I am just now.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [13 April 2020 23:01 UTC](https://discourse.nodered.org/t/ive-lost-everything-connection-lost-to-machine-error-subflow-connections/24782/2 "2020-04-13T23:01:54Z")

</div>

The .backup files are the previous versions of the files - created whenever you deploy a new version. They are not a backup of the latest version.

Node-RED doesn't create multiple copies of the flow files. You need to be backing them up yourself.

If you have deleted all the files, and have no backups, then there isn't a lot we can do.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [13 April 2020 23:57 UTC](https://discourse.nodered.org/t/ive-lost-everything-connection-lost-to-machine-error-subflow-connections/24782/3 "2020-04-13T23:57:32Z")

</div>

I was more thinking at an OS level.

I made copies of the files but they were in the NR directory.

If they were deleted, is there a way to get them back at the OS level?

(yes outside the forums area, but I should ask)

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [14 April 2020 00:41 UTC](https://discourse.nodered.org/t/ive-lost-everything-connection-lost-to-machine-error-subflow-connections/24782/4 "2020-04-14T00:41:37Z")

</div>

I'm back home now. (Was out buying _the necessities_.)

Not assigning blame, but more on/of the story:

# The story - more of it.

I was playing around with a flow wanting to tweak it.  
This is on a RasPi and I didn't want to _bother_ it with all the testing, so I decided to do it on the NUC.

I needed to use my `timestamp` node (subflow).  
I dragged it into the edit area, _wrote_ the flow and deployed.  
Pressed the button and: (drum roll) **nothing**.

"That's weird"

Shortly there after I opened the subflow and: (another drum roll)  
All the connections from the _IN/OUT_ to the other nodes were missing.  
All the other _internal_ (node to node) connections existed.

Ok, two things:  
1 - I hadn't fixed that subflow on THIS machine. Though I had fixed it on all the remote machines, because they use it, and it is working.  
2 - The problem still exists.

I can't (now) say. It's all gone-ski.

I connected the wires and deployed it.  
Waiting waiting waiting.

Connection lost to server. (or what ever that message is)

This is a _red flag_ to me (well, a flag of some colour, as it is being mentioned a lot recently in the forum) as it has been happening a fair bit to me of late.  
I've just (usually waited).

Stupid me, I didn't this time.

That is now water under the bridge. I've lost a lot of work. Such is.

I don't know if I lost all the installed nodes or not. I'll find out when I am confident enough to get NR running again on this machine.

However, this `CONNECTION LOST TO SERVER` is definitely annoying, and I too am seeing it too.

I mentioned how I discovered that _loops_ in the code lock up the machine and how I did some tracing on it to **prove** that is correct.

I'll stop now, as I think I have said enough for now to explain the story better than I did with the first post.

For the sake of showing what I see here are some examples that I see for the load on the web page after I simply pressed an `inject` node a few times to list events.

And the screen shot which started this whole lot of hurt for me.

 ![Screenshot from 2020-04-14 07-49-34](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/c/dc5e41507baa7326570e9b7a5f7e4ff852e4192d.png)  
 ![Screenshot from 2020-04-14 11-35-12](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/8/7893b973a14f4b98de32933919609b8979e658db.png)  
 ![Screenshot from 2020-04-14 11-35-13](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/5/15d7a10bcc67109acd16256475ab080c138a677d.png)  
 ![Screenshot from 2020-04-14 11-35-15](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/f/bf6946d5e03e9b849e5299fddbeacd08d47b4692.png)  
 ![Screenshot from 2020-04-14 11-35-22](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/4/44d4535a71c18ed6dd04c3e06e3aae9b2bc2410a.png)

---

<div class="post-metadata">

**Author:** ![edje11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/edje11/32/572_2.png) [@edje11](https://discourse.nodered.org/u/edje11)\
**Post date:** [14 April 2020 08:45 UTC](https://discourse.nodered.org/t/ive-lost-everything-connection-lost-to-machine-error-subflow-connections/24782/5 "2020-04-14T08:45:30Z")

</div>

Maybe a bit to late now for you.  
I'm backing up my flows twice a week automatic to Dropbox with the dsm node and this [script](https://github.com/cflurin/node-red-contrib-dsm/wiki/Backup).  
Then you have a copy outside the house and it's saved by date so you can always go back.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [14 April 2020 08:49 UTC](https://discourse.nodered.org/t/ive-lost-everything-connection-lost-to-machine-error-subflow-connections/24782/6 "2020-04-14T08:49:47Z")

</div>

Yeah. A bit late.

I have a script I use on other remote machines and I have now got it working on this machine.

Not weekly, or anything that elaborate.

It is just a script I can run when I know I am going to be doing anything "dangerous".

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [14 April 2020 08:58 UTC](https://discourse.nodered.org/t/ive-lost-everything-connection-lost-to-machine-error-subflow-connections/24782/7 "2020-04-14T08:58:02Z")

</div>

> [@Trying\_to\_learn](#):
>
> It is just a script I can run when I know I am going to be doing anything "dangerous".

Have you never considered using the Projects option?

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [14 April 2020 09:00 UTC](https://discourse.nodered.org/t/ive-lost-everything-connection-lost-to-machine-error-subflow-connections/24782/8 "2020-04-14T09:00:21Z")

</div>

`projects` option.

What's that?

(Yeah, I ask dumb questions)

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [14 April 2020 09:02 UTC](https://discourse.nodered.org/t/ive-lost-everything-connection-lost-to-machine-error-subflow-connections/24782/9 "2020-04-14T09:02:26Z")

</div>

[https://nodered.org/docs/user-guide/projects/](https://nodered.org/docs/user-guide/projects/)

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [14 April 2020 09:05 UTC](https://discourse.nodered.org/t/ive-lost-everything-connection-lost-to-machine-error-subflow-connections/24782/10 "2020-04-14T09:05:54Z")

</div>

(I deserved that)

Yeah, it relies on _the internet_. Good if you live in a first world country.  
I live in Oz.

Dial up is fast.

I have only just touched the _git_ thing.

It is another thing I have to learn how to use.  
I'm not sure I should do that if I can't get this part working good.

When I get time (and I know there is probably no excuse for that just now - globally) I may look into it.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [14 April 2020 09:06 UTC](https://discourse.nodered.org/t/ive-lost-everything-connection-lost-to-machine-error-subflow-connections/24782/11 "2020-04-14T09:06:49Z")

</div>

Backing up to Dropbox is much easier than projects, also it can be run automatically so it's easy to fit & forget (until you need a backup).  
I started off with projects, but got myself in all sorts of problems.  
Unless you are confident with git, I'd leave it alone Andrew. (Just my personal opinion)

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [14 April 2020 09:14 UTC](https://discourse.nodered.org/t/ive-lost-everything-connection-lost-to-machine-error-subflow-connections/24782/12 "2020-04-14T09:14:27Z")

</div>

Thanks Paul.

yeah, I think I shall _leave well enough alone_ just now and use my script to back up the flows.  
I know that is painful/wasteful as it backs up everything.

But I guess: Nothing is perfect. I just need to use what I find best.

Though what I may also do is export big blocks of code to files as I have done anyway in the past.

I may need to get into this _GIT_ thing more one day... But I think baby steps at this time.  
Thanks.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [14 April 2020 09:22 UTC](https://discourse.nodered.org/t/ive-lost-everything-connection-lost-to-machine-error-subflow-connections/24782/13 "2020-04-14T09:22:36Z")

</div>

> [@Trying\_to\_learn](#):
>
> Yeah, it relies on _the internet_ .

No it doesn't, you can have the repository on the same machine or on another machine on your network.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [14 April 2020 09:26 UTC](https://discourse.nodered.org/t/ive-lost-everything-connection-lost-to-machine-error-subflow-connections/24782/14 "2020-04-14T09:26:29Z")

</div>

Oh. So (dumb question) why do I need keys?

(From the link I was shown)

> The feature relies on having the `git` and `ssh-keygen` command line tools available. Node-RED will check for them on start-up and let you know if they are missing.

As I said, I think I had maybe better leave it alone.

When _we can venture out_ again (when ever that is) I may have to ask for a 1 on 1 from someone who can _talk the talk, and walk the walk_ and get them to show me what it all is about.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [13 June 2020 09:28 UTC](https://discourse.nodered.org/t/ive-lost-everything-connection-lost-to-machine-error-subflow-connections/24782/15 "2020-06-13T09:28:50Z")

</div>

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