# Lost connection to server, reconnecting

**URL:** <https://discourse.nodered.org/t/lost-connection-to-server-reconnecting/17667>\
**Category:** General\
**Created:** [8 November 2019 08:18 UTC](https://discourse.nodered.org/t/lost-connection-to-server-reconnecting/17667 "2019-11-08T08:18:14Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![nygma2004](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nygma2004/32/1308_2.png) [@nygma2004](https://discourse.nodered.org/u/nygma2004)\
**Post date:** [8 November 2019 08:18 UTC](https://discourse.nodered.org/t/lost-connection-to-server-reconnecting/17667/1 "2019-11-08T08:18:15Z")

</div>

I know that several similar topics have been created, but I was advised to create a new topic.  
My editor started displaying this message a few weeks ago. I did not install new nodes, most recent it node-red-contrib-fs but after removing it the issue did not disappear.  
This issue started when I was using v0.19.xx (?) version, but I have upgraded to the latest node-red version and also updated by linux as well.

UI works, my flows are running, I can even make changes and deploy flows.

This is my startup log:

```auto
Starting Node-RED graphical event wiring tool...
Started Node-RED graphical event wiring tool.
8 Nov 09:02:51 - [info]
Welcome to Node-RED
===================
8 Nov 09:02:52 - [info] Node-RED version: v1.0.2
8 Nov 09:02:52 - [info] Node.js version: v10.17.0
8 Nov 09:02:52 - [info] Linux 4.9.35-v7+ arm LE
8 Nov 09:02:53 - [info] Loading palette nodes
8 Nov 09:03:24 - [info] Worldmap version 2.1.4
8 Nov 09:03:25 - [info] Dashboard version 2.17.1 started at /ui
8 Nov 09:03:26 - [info] Settings file : /home/pi/.node-red/settings.js
8 Nov 09:03:26 - [info] HTTP Static : /home/pi/node-red-static
8 Nov 09:03:26 - [info] Context store : 'default' [module=memory]
8 Nov 09:03:26 - [info] User directory : /home/pi/.node-red
8 Nov 09:03:26 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable
8 Nov 09:03:26 - [info] Flows file : /home/pi/.node-red/flows_OpenHAB.json
8 Nov 09:03:27 - [info] Server now running at https://127.0.0.1:1880/
8 Nov 09:03:28 - [info] Starting flows
8 Nov 09:03:32 - [info] [worldmap:4dac5582.33b0cc] started at /worldmap
8 Nov 09:03:32 - [info] Started flows
(node:480) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 open listeners added. Use emitter.setMaxListeners() to increase limit
(node:480) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit
(node:480) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 open listeners added. Use emitter.setMaxListeners() to increase limit
(node:480) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:1c25415d.b8427f] opened /home/pi/sqlite/nodered ok
8 Nov 09:03:33 - [info] [sqlitedb:3187c06b.70165] opened /home/pi/sqlite/diagnostic ok
8 Nov 09:03:33 - [info] [sqlitedb:3187c06b.70165] opened /home/pi/sqlite/diagnostic ok
8 Nov 09:03:33 - [info] [sqlitedb:3187c06b.70165] opened /home/pi/sqlite/diagnostic ok
8 Nov 09:03:33 - [info] [sqlitedb:3187c06b.70165] opened /home/pi/sqlite/diagnostic ok
8 Nov 09:03:33 - [info] [sqlitedb:3187c06b.70165] opened /home/pi/sqlite/diagnostic ok
8 Nov 09:03:33 - [info] [sqlitedb:3187c06b.70165] opened /home/pi/sqlite/diagnostic ok
8 Nov 09:03:33 - [info] [sqlitedb:3187c06b.70165] opened /home/pi/sqlite/diagnostic ok
8 Nov 09:03:33 - [info] [sqlitedb:3187c06b.70165] opened /home/pi/sqlite/diagnostic ok
8 Nov 09:03:33 - [info] [sqlitedb:3187c06b.70165] opened /home/pi/sqlite/diagnostic ok
8 Nov 09:03:33 - [info] [sqlitedb:3187c06b.70165] opened /home/pi/sqlite/diagnostic ok
8 Nov 09:03:33 - [info] [sqlitedb:3187c06b.70165] opened /home/pi/sqlite/diagnostic ok
8 Nov 09:03:33 - [info] [sqlitedb:3187c06b.70165] opened /home/pi/sqlite/diagnostic ok
8 Nov 09:03:33 - [info] [sqlitedb:3187c06b.70165] opened /home/pi/sqlite/diagnostic ok
8 Nov 09:03:33 - [info] [sqlitedb:3187c06b.70165] opened /home/pi/sqlite/diagnostic ok
8 Nov 09:03:33 - [info] [sqlitedb:3187c06b.70165] opened /home/pi/sqlite/diagnostic ok
8 Nov 09:03:33 - [info] [sqlitedb:3187c06b.70165] opened /home/pi/sqlite/diagnostic ok
8 Nov 09:03:33 - [info] [sqlitedb:3187c06b.70165] opened /home/pi/sqlite/diagnostic ok
8 Nov 09:03:33 - [info] [sqlitedb:3187c06b.70165] opened /home/pi/sqlite/diagnostic ok
8 Nov 09:03:33 - [info] [sqlitedb:3bdf3d0e.e69262] opened /home/pi/sqlite/tracker ok
8 Nov 09:03:33 - [info] [sqlitedb:3bdf3d0e.e69262] opened /home/pi/sqlite/tracker ok
8 Nov 09:03:33 - [info] [sqlitedb:3bdf3d0e.e69262] opened /home/pi/sqlite/tracker ok
8 Nov 09:03:33 - [info] [sqlitedb:3bdf3d0e.e69262] opened /home/pi/sqlite/tracker ok
8 Nov 09:03:33 - [info] serial port /dev/ttyUSB1 opened at 57600 baud 8N1
8 Nov 09:03:33 - [info] [mqtt-broker:cea5258a.b34038] Connected to broker: node-red@mqtt://192.168.1.80:1883
8 Nov 09:03:33 - [error] [function:Generate list] TypeError: Cannot read property 'length' of undefined
8 Nov 09:03:33 - [error] [json:cb6467a8.255be8] Unexpected token O in JSON at position 0
8 Nov 09:03:33 - [info] [mqtt-broker:gBridge MQTT] Connected to broker: mqtts://mqtt.gbridge.io:8883
8 Nov 09:03:38 - [error] [sqlite:Diag DB] Error: SQLITE_ERROR: near ",": syntax error

```

My linux version is:

```auto
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 8.0 (jessie)
Release: 8.0
Codename: jessie

```

---

<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:** [8 November 2019 08:37 UTC](https://discourse.nodered.org/t/lost-connection-to-server-reconnecting/17667/2 "2019-11-08T08:37:15Z")

</div>

I would start by fixing the easy problems such as the SQL syntax error and the function node error. It is remarkable how often fixing the obvious problems makes others go away even if they look unrelated.

---

<div class="post-metadata">

**Author:** ![nygma2004](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nygma2004/32/1308_2.png) [@nygma2004](https://discourse.nodered.org/u/nygma2004)\
**Post date:** [8 November 2019 09:32 UTC](https://discourse.nodered.org/t/lost-connection-to-server-reconnecting/17667/3 "2019-11-08T09:32:41Z")

</div>

I have resolved the SQL syntax errors and the function node errors. Restarted NR, there are no errors any more, but the issue persists.  
Could it be the MaxListenersExceededWarning warning?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [8 November 2019 09:50 UTC](https://discourse.nodered.org/t/lost-connection-to-server-reconnecting/17667/4 "2019-11-08T09:50:36Z")

</div>

Lost connections to MQTT are almost always caused by a duplicate MQTT client id.

Max Listeners is just a warning. Annoying but not fatal.

---

<div class="post-metadata">

**Author:** ![nygma2004](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nygma2004/32/1308_2.png) [@nygma2004](https://discourse.nodered.org/u/nygma2004)\
**Post date:** [8 November 2019 09:50 UTC](https://discourse.nodered.org/t/lost-connection-to-server-reconnecting/17667/5 "2019-11-08T09:50:46Z")

</div>

OK fun fact. I logged into the same editor from a different laptop. And it works.  
So it must be an issue with the Chrome running on my computer. I have deleted the cookies and temp files already. Did not help so far.

---

<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:** [8 November 2019 09:58 UTC](https://discourse.nodered.org/t/lost-connection-to-server-reconnecting/17667/6 "2019-11-08T09:58:01Z")

</div>

Delete the cache too.

---

<div class="post-metadata">

**Author:** ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)\
**Post date:** [8 November 2019 10:32 UTC](https://discourse.nodered.org/t/lost-connection-to-server-reconnecting/17667/7 "2019-11-08T10:32:24Z")

</div>

> [@nygma2004](#):
>
> (node:480) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 open listeners added. Use emitter.setMaxListeners() to increase limit

I had this warning for a long time on one rpi.  
I removed node-red-dashboard on this rpi and the warning is gone.

---

<div class="post-metadata">

**Author:** ![nygma2004](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nygma2004/32/1308_2.png) [@nygma2004](https://discourse.nodered.org/u/nygma2004)\
**Post date:** [8 November 2019 10:37 UTC](https://discourse.nodered.org/t/lost-connection-to-server-reconnecting/17667/8 "2019-11-08T10:37:06Z")

</div>

Did that too and nothing so far. I deleted everything except browsing history, password and sign-in data, and form data.  
NR works fine from Edge, so definitely Chrome related problem.

---

<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:** [8 November 2019 17:04 UTC](https://discourse.nodered.org/t/lost-connection-to-server-reconnecting/17667/9 "2019-11-08T17:04:00Z")

</div>

Can I check where you are seeing that error, is it the editor, the dashboard (so whichever it is doesn't work at all) or errors in the debug pane or somewhere else?

---

<div class="post-metadata">

**Author:** ![nygma2004](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nygma2004/32/1308_2.png) [@nygma2004](https://discourse.nodered.org/u/nygma2004)\
**Post date:** [9 November 2019 08:13 UTC](https://discourse.nodered.org/t/lost-connection-to-server-reconnecting/17667/10 "2019-11-09T08:13:28Z")

</div>

The error is in the editor. I nothing comes up in the debug and the node statuses are not showing either.

---

<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:** [9 November 2019 09:10 UTC](https://discourse.nodered.org/t/lost-connection-to-server-reconnecting/17667/11 "2019-11-09T09:10:13Z")

</div>

Is the browser developer console (or whatever it is called in Chrome) showing any errors.

---

<div class="post-metadata">

**Author:** ![nygma2004](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nygma2004/32/1308_2.png) [@nygma2004](https://discourse.nodered.org/u/nygma2004)\
**Post date:** [9 November 2019 10:17 UTC](https://discourse.nodered.org/t/lost-connection-to-server-reconnecting/17667/12 "2019-11-09T10:17:09Z")

</div>

Good point. Yes I see the following error coming up every second:  
WebSocket connection to 'wss://192.168.1.80:1880/comms' failed: Error in connection establishment: net::ERR\_CERT\_AUTHORITY\_INVALID  
I am using a self signed certificate for Node-Red, but that has not stopped me before. Could it be something on my virus scanner blocking this communication?

---

<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:** [9 November 2019 10:32 UTC](https://discourse.nodered.org/t/lost-connection-to-server-reconnecting/17667/13 "2019-11-09T10:32:42Z")

</div>

I think it will be a Chrome issue. You probably need to tell Chrome to accept the certificate. I presume that you are using https to access node red so it is using tls for the websocket too, but I am out of my comfort zone here so other than suggesting that google for that error and Chrome then I probably can't help much more.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [9 November 2019 10:49 UTC](https://discourse.nodered.org/t/lost-connection-to-server-reconnecting/17667/14 "2019-11-09T10:49:25Z")

</div>

Ah! Now we can see. I believe this is actually a problem of Google's making, they keep trying to stop people from using self-signed certificates. Claiming that they are "Not Secure"! Which is rubbish since they can actually be significantly more secure if done correctly.

Before you go down this route though, do try briefly turning off your antimalware tool to make sure it isn't that.

I fear that, to make this work with Chrome, you would need to generate a full certificate chain with a trusted root CA certificate that you add to Chrome's trusted root certificate store.

Or maybe ditch Google's self-service browser for an alternative one. I just am not sure whether those checks are now built into Chromium which would stop it working on any Chromium based browser. If not, I recommend switching to the Vivaldi browser. Better privacy, some nice features and no phoning home to Google.

---

<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:** [9 November 2019 11:07 UTC](https://discourse.nodered.org/t/lost-connection-to-server-reconnecting/17667/15 "2019-11-09T11:07:58Z")

</div>

Is Chrome letting you browse to [https://192.168.1.80:1880](https://192.168.1.80:1880) to get the flow layout, or the dashboard layout if you use it? If so it is a bit odd that it allows https but not wss, or am I missing something here?

---

<div class="post-metadata">

**Author:** ![nygma2004](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nygma2004/32/1308_2.png) [@nygma2004](https://discourse.nodered.org/u/nygma2004)\
**Post date:** [9 November 2019 11:49 UTC](https://discourse.nodered.org/t/lost-connection-to-server-reconnecting/17667/16 "2019-11-09T11:49:32Z")

</div>

@Colin: the dashboard and the editor loads, but the editor is not able to connect to the websocket to e.g. update the debug view, or the node status.

---

<div class="post-metadata">

**Author:** ![nygma2004](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nygma2004/32/1308_2.png) [@nygma2004](https://discourse.nodered.org/u/nygma2004)\
**Post date:** [9 November 2019 11:51 UTC](https://discourse.nodered.org/t/lost-connection-to-server-reconnecting/17667/17 "2019-11-09T11:51:49Z")

</div>

@TotallyInformation Thanks for the comments. I have turn off all the settings in my firewall and virus scanner, but since Edge can connect, it appears to be a Chome things and nothing else. I will install Vivaldi and use that for the time being. I am assuming this issue will impact all of us using self-signed certificates going forward, it is just the question of time and when Chrome is getting updated.

---

<div class="post-metadata">

**Author:** ![nygma2004](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nygma2004/32/1308_2.png) [@nygma2004](https://discourse.nodered.org/u/nygma2004)\
**Post date:** [9 November 2019 12:02 UTC](https://discourse.nodered.org/t/lost-connection-to-server-reconnecting/17667/18 "2019-11-09T12:02:43Z")

</div>

For those facing the same issue. I have Chrome Version 78.0.3904.97 (Official Build) (64-bit) (got updated just now).  
As mentioned by @TotallyInformation and also mentioned [here](https://stackoverflow.com/questions/5312311/secure-websockets-with-self-signed-certificate) Chrome is silently aborting web socket requests to self signed certificate sites.  
The workaround I am using for now (edited) **only for Node-Red** , is I have created a new shortcut to Chome and added

> --ignore-certificate-errors

to the end of the command line. Node Red editor runs fine in this Chrome instance.

Let's see how long this is going to last.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [9 November 2019 13:02 UTC](https://discourse.nodered.org/t/lost-connection-to-server-reconnecting/17667/19 "2019-11-09T13:02:35Z")

</div>

> [@nygma2004](#):
>
> The workaround I am using for now

That is a **really bad idea**. Since it leaves you open to all sorts of attacks on the Internet. At least, please _only_ use that for Node-RED and even then only on a local connection where you can be certain of the path between you and the server.

You probably know that but I just want to make sure that everyone else knows it too.

* * *

By the way, if you want to continue to use self-signed certificates, I recommend using the answer in that question you linked to which will show you how to create and consume them "correctly":

> <https://stackoverflow.com/questions/5312311/secure-websockets-with-self-signed-certificate/27940375#27940375>

* * *

Unfortunately, I can't tell you which Chromium browsers might work (I use Vivaldi and Microsoft Edge Dev) because it looks like I issued myself a trusted root certificate back in 2017 and installed it into my trusted certificate store on my dev PC 🤣

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/8/8b1e7cae0dd1d716aba100fae2d2ab3dfb9e0a6f.png)

---

<div class="post-metadata">

**Author:** ![hugobox](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hugobox/32/2948_2.png) [@hugobox](https://discourse.nodered.org/u/hugobox)\
**Post date:** [13 November 2019 19:54 UTC](https://discourse.nodered.org/t/lost-connection-to-server-reconnecting/17667/20 "2019-11-13T19:54:06Z")

</div>

I just had this problem on Chrome v.77, every time I tried refreshing the tab, the Lost Connection error would show up after about 10 seconds. I found a simple workaround that might help others: I simply killed the tab and opened a new one. No more errors, and websockets are working fine.

[Next page](https://discourse.nodered.org/t/lost-connection-to-server-reconnecting/17667.md?page=2)
