# Node-Red Connection Lost

**URL:** <https://discourse.nodered.org/t/node-red-connection-lost/1724>\
**Category:** Dashboard\
**Created:** [21 July 2018 06:18 UTC](https://discourse.nodered.org/t/node-red-connection-lost/1724 "2018-07-21T06:18:30Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![dedynobre](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dedynobre/32/950_2.png) [@dedynobre](https://discourse.nodered.org/u/dedynobre)\
**Post date:** [21 July 2018 06:18 UTC](https://discourse.nodered.org/t/node-red-connection-lost/1724/1 "2018-07-21T06:18:30Z")

</div>

Olá pessoal!

Na medida que vou mexendo vou no node-red mas gosto de usar.

Não sei é porque estou adicionando mais componentes mas fato é que constantemente ele fica aparecendo a mensagem; Connection lost. Isto está gerando um certo transtorno porque pelo que vi os valores de alguns componentes voltam para o minimo configurado, isso para o numeric input por exemplo.

Ja segui algumas orientações postadas aqui referente ao cache do chrome mas mesmo assim o erro continua.

Desde já agradeço.

---

<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:** [21 July 2018 10:51 UTC](https://discourse.nodered.org/t/node-red-connection-lost/1724/2 "2018-07-21T10:51:14Z")

</div>

Sorry, I'm not sure if anyone in this forum speaks Spanish.

---

<div class="post-metadata">

**Author:** ![dedynobre](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dedynobre/32/950_2.png) [@dedynobre](https://discourse.nodered.org/u/dedynobre)\
**Post date:** [21 July 2018 13:29 UTC](https://discourse.nodered.org/t/node-red-connection-lost/1724/3 "2018-07-21T13:29:49Z")

</div>

Translate:

Hello guys!

As I move I go to the node-red but I like to use it.

I do not know is because I'm adding more components but fact is that it constantly keeps appearing the message; Connection lost. This is generating a certain inconvenience because from what I saw the values of some components go back to the configured minimum, this for numeric input for example.

I have already followed some guidelines posted here regarding the chrome cache but the error still continues.

Thank you very much in advance.

---

<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:** [21 July 2018 15:17 UTC](https://discourse.nodered.org/t/node-red-connection-lost/1724/4 "2018-07-21T15:17:55Z")

</div>

Is this between your browser and the Node-RED server? Or is it MQTT related?

---

<div class="post-metadata">

**Author:** ![dedynobre](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dedynobre/32/950_2.png) [@dedynobre](https://discourse.nodered.org/u/dedynobre)\
**Post date:** [21 July 2018 15:23 UTC](https://discourse.nodered.org/t/node-red-connection-lost/1724/5 "2018-07-21T15:23:27Z")

</div>

Between your browser and the Node-RED server.

---

<div class="post-metadata">

**Author:** ![dedynobre](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dedynobre/32/950_2.png) [@dedynobre](https://discourse.nodered.org/u/dedynobre)\
**Post date:** [21 July 2018 15:32 UTC](https://discourse.nodered.org/t/node-red-connection-lost/1724/6 "2018-07-21T15:32:27Z")

</div>

In addition to this item that Connection Lost is having another behavior is that, from what you realize, the node-red is reinitiating or giving a deploy.  
I realize this because of the status.  
I do not know if the two conditions are related.

---

<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:** [21 July 2018 15:33 UTC](https://discourse.nodered.org/t/node-red-connection-lost/1724/7 "2018-07-21T15:33:45Z")

</div>

OK, can you please post the log from where Node-RED starts up? Should show us what is happening.

---

<div class="post-metadata">

**Author:** ![dedynobre](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dedynobre/32/950_2.png) [@dedynobre](https://discourse.nodered.org/u/dedynobre)\
**Post date:** [21 July 2018 15:34 UTC](https://discourse.nodered.org/t/node-red-connection-lost/1724/8 "2018-07-21T15:34:56Z")

</div>

What is the path of the log file?  
I'm running on raspberry pi

---

<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:** [21 July 2018 15:44 UTC](https://discourse.nodered.org/t/node-red-connection-lost/1724/9 "2018-07-21T15:44:11Z")

</div>

You should be able to see the log using the command `node-red-log` from a terminal shell.

If you are running manually from a shell, the log will be on the terminal anyway.

---

<div class="post-metadata">

**Author:** ![dedynobre](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dedynobre/32/950_2.png) [@dedynobre](https://discourse.nodered.org/u/dedynobre)\
**Post date:** [21 July 2018 15:50 UTC](https://discourse.nodered.org/t/node-red-connection-lost/1724/10 "2018-07-21T15:50:48Z")

</div>

21 Jul 11:14:05 - [info] Starting flows  
21 Jul 11:14:10 - [info] Started flows  
21 Jul 11:14:11 - [info] [mqtt-broker:MQTT Broker] Connected to broker: mqtt://1 92.168.2.56:1883  
21 Jul 11:14:12 - [warn] [api-current-state:514a4b3d.4bf574] local state cache m issing, sending empty payload  
21 Jul 11:14:12 - [warn] [api-current-state:b528fb9c.dc49f8] local state cache m issing, sending empty payload  
21 Jul 11:14:12 - [warn] [api-current-state:875ac872.eb1808] local state cache m issing, sending empty payload  
21 Jul 11:14:12 - [warn] [api-current-state:e40af32b.43652] local state cache mi ssing, sending empty payload  
21 Jul 11:14:12 - [warn] [api-current-state:a8164515.2ca678] local state cache m issing, sending empty payload  
21 Jul 11:14:19 - [error] [schedex:Controle Horario TV] TypeError: Cannot read p roperty 'hasOwnProperty' of undefined  
21 Jul 11:14:19 - [error] [schedex:Controle Horario TV] TypeError: Cannot read p roperty 'hasOwnProperty' of undefined  
21 Jul 12:30:10 - [info] Stopping flows  
21 Jul 12:30:11 - [info] [mqtt-broker:MQTT Broker] Disconnected from broker: mqt t://192.168.2.56:1883  
21 Jul 12:30:20 - [info] Stopped flows  
21 Jul 12:30:20 - [info] Starting flows  
21 Jul 12:30:22 - [info] Started flows  
21 Jul 12:30:24 - [info] [mqtt-broker:MQTT Broker] Connected to broker: mqtt://1 92.168.2.56:1883  
21 Jul 12:30:24 - [warn] [api-current-state:514a4b3d.4bf574] local state cache m issing, sending empty payload  
21 Jul 12:30:24 - [warn] [api-current-state:b528fb9c.dc49f8] local state cache m issing, sending empty payload  
21 Jul 12:30:24 - [warn] [api-current-state:875ac872.eb1808] local state cache m issing, sending empty payload  
21 Jul 12:30:24 - [warn] [api-current-state:e40af32b.43652] local state cache mi ssing, sending empty payload  
21 Jul 12:30:25 - [warn] [api-current-state:a8164515.2ca678] local state cache m issing, sending empty payload

---

<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:** [21 July 2018 16:24 UTC](https://discourse.nodered.org/t/node-red-connection-lost/1724/11 "2018-07-21T16:24:18Z")

</div>

OK, not sure whether that is 1 or 2 issues.

The schedex error doesn't look good. I assume that you have node-red-contrib-schedex installed?

What versions of Node.JS and Node-RED are you running?

You might try disabling or temporarily removing the schedex nodes from your flow.

I'm not sure what is causing the `api-current-state` warnings. However, if you use Node-RED's search feature with the hex codes like `514a4b3d.4bf574`, you should be able to find out what nodes are causing that warning.

---

<div class="post-metadata">

**Author:** ![dedynobre](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dedynobre/32/950_2.png) [@dedynobre](https://discourse.nodered.org/u/dedynobre)\
**Post date:** [21 July 2018 16:37 UTC](https://discourse.nodered.org/t/node-red-connection-lost/1724/12 "2018-07-21T16:37:47Z")

</div>

The error in schedex I was able to solve. I was sending reference values before the home assistant component started.  
I put a time after a deploy and resolved.

My Node-red is v0.18.7  
Node js version v8.11.3

---

<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:** [21 July 2018 16:42 UTC](https://discourse.nodered.org/t/node-red-connection-lost/1724/13 "2018-07-21T16:42:58Z")

</div>

OK, they are fine.

So you need to look up those warnings.

If that doesn't help. Next step will be to stop NR, rename your flow file, restart NR and make sure that it runs fine without a flow. Then you will need to reimport your previous flow section by section to try and find the error.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [21 July 2018 19:33 UTC](https://discourse.nodered.org/t/node-red-connection-lost/1724/14 "2018-07-21T19:33:00Z")

</div>

If you just upgraded dashboard. Then you may need to flush your browser cache. Cmd/ Ctrl R several times. The latest [socket.io](http://socket.io) update I included doesn’t seem to place nice with older versions

---

<div class="post-metadata">

**Author:** ![dedynobre](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dedynobre/32/950_2.png) [@dedynobre](https://discourse.nodered.org/u/dedynobre)\
**Post date:** [22 July 2018 13:44 UTC](https://discourse.nodered.org/t/node-red-connection-lost/1724/15 "2018-07-22T13:44:06Z")

</div>

The problem still continues and looking today appeared these logs:

22 Jul 00:14:45 - [info] [mqtt-broker:MQTT Broker] Connected to broker: mqtt://192.168.2.56:1883  
22 Jul 04:36:42 - [red] Uncaught Exception:  
22 Jul 04:36:42 - Error [ERR\_SOCKET\_CANNOT\_SEND]: Unable to send data  
at Socket.onListenError (dgram.js:362:22)  
nodered.service: Main process exited, code=exited, status=1/FAILURE  
nodered.service: Unit entered failed state.  
nodered.service: Failed with result 'exit-code'.  
nodered.service: Service hold-off time over, scheduling restart.  
Stopped Node-RED graphical event wiring tool.  
Started Node-RED graphical event wiring tool.  
22 Jul 04:36:52 - [info]  
Welcome to Node-RED  
22 Jul 04:36:53 - [info] Node-RED version: v0.18.7  
22 Jul 04:36:53 - [info] Node.js version: v8.11.3  
22 Jul 04:36:53 - [info] Linux 4.14.52+ arm LE  
22 Jul 04:36:56 - [info] Loading palette nodes  
Missing ENV var CONFIG\_PATH  
22 Jul 04:37:26 - [info] Dashboard version 2.9.5 started at /ui  
22 Jul 04:37:33 - [warn] ------------------------------------------------------  
22 Jul 04:37:33 - [warn] [node-red-contrib-xiaomi-smart-devices/xiaomi-switch] 'xiaomi-switch' already registered by module node-red-contrib-xiaomi-devices  
22 Jul 04:37:33 - [warn] [node-red-contrib-facebook/facebook] ReferenceError: res is not defined (line:16)  
22 Jul 04:37:33 - [warn] [norelite/nrl-config] 'nrl-config' already registered by module node-red-contrib-norelite  
22 Jul 04:37:33 - [warn] [norelite/nrl-eval in] 'nrl-eval in' already registered by module node-red-contrib-norelite  
22 Jul 04:37:33 - [warn] [norelite/nrl-source out] 'nrl-source out' already registered by module node-red-contrib-nor elite  
22 Jul 04:37:33 - [warn] [norelite/nrl-switch out] 'nrl-switch out' already registered by module node-red-contrib-nor elite  
22 Jul 04:37:33 - [warn] [norelite/nrl-limit] 'nrl-limit' already registered by module node-red-contrib-norelite  
22 Jul 04:37:33 - [warn] [norelite/nrl-dayslimit in] 'nrl-dayslimit in' already registered by module node-red-contrib -norelite  
22 Jul 04:37:33 - [warn] [norelite/nrl-hold in] 'nrl-hold in' already registered by module node-red-contrib-norelite  
22 Jul 04:37:33 - [warn] [norelite/nrl-timelimit in] 'nrl-timelimit in' already registered by module node-red-contrib -norelite  
22 Jul 04:37:33 - [warn] [norelite/nrl-value in] 'nrl-value in' already registered by module node-red-contrib-norelit e  
22 Jul 04:37:33 - [warn] [norelite/nrl-rfxcom-out] 'nrl-rfxcom-out' already registered by module node-red-contrib-nor elite  
22 Jul 04:37:33 - [warn] [norelite/nrl-tellstick-out] 'nrl-tellstick-out' already registered by module node-red-contr ib-norelite  
22 Jul 04:37:33 - [warn] [norelite/nrl-zwave-out] 'nrl-zwave-out' already registered by module node-red-contrib-norel ite  
22 Jul 04:37:33 - [warn] [norelite/nrl-on in] 'nrl-on in' already registered by module node-red-contrib-norelite  
22 Jul 04:37:33 - [warn] [node-red-contrib-node-webcam/node-webcam] Error: Cannot find module 'webcam' (line:25)  
22 Jul 04:37:33 - [warn] ------------------------------------------------------  
22 Jul 04:37:33 - [info] Settings file : /home/pi/.node-red/settings.js  
22 Jul 04:37:34 - [info] User directory : /home/pi/.node-red  
22 Jul 04:37:34 - [warn] Projects disabled : editorTheme.projects.enabled=false  
22 Jul 04:37:34 - [info] Flows file : /home/pi/.node-red/flows\_raspberrypi.json  
22 Jul 04:37:36 - [info] Server now running at [http://127.0.0.1:8080/](http://127.0.0.1:8080/)  
22 Jul 04:37:37 - [warn]  
Your flow credentials file is encrypted using a system-generated key.  
If the system-generated key is lost for any reason, your credentials  
file will not be recoverable, you will have to delete it and re-enter  
your credentials.  
You should set your own key using the 'credentialSecret' option in  
your settings file. Node-RED will then re-encrypt your credentials  
file using your chosen key the next time you deploy a change.  
22 Jul 04:37:39 - [info] Starting flows  
22 Jul 04:37:48 - [info] Started flows

---

<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:** [22 July 2018 13:52 UTC](https://discourse.nodered.org/t/node-red-connection-lost/1724/16 "2018-07-22T13:52:32Z")

</div>

As you may see from you post, do _not_ use lines of ===== to separate your post as that has special meaning in the markdown formatting this forum uses.

Please use ``` at the start and end of your log output.

---

<div class="post-metadata">

**Author:** ![dedynobre](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dedynobre/32/950_2.png) [@dedynobre](https://discourse.nodered.org/u/dedynobre)\
**Post date:** [22 July 2018 13:59 UTC](https://discourse.nodered.org/t/node-red-connection-lost/1724/17 "2018-07-22T13:59:55Z")

</div>

Adjusted.

Thanks @knolleary

---

<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:** [22 July 2018 14:05 UTC](https://discourse.nodered.org/t/node-red-connection-lost/1724/18 "2018-07-22T14:05:11Z")

</div>

Not quite. Use three backticks before _and_ after the log output. The backticks is this ` not a single quote '

---

<div class="post-metadata">

**Author:** ![dedynobre](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dedynobre/32/950_2.png) [@dedynobre](https://discourse.nodered.org/u/dedynobre)\
**Post date:** [23 July 2018 09:45 UTC](https://discourse.nodered.org/t/node-red-connection-lost/1724/19 "2018-07-23T09:45:32Z")

</div>

23 Jul 06:34:24 - [red] Uncaught Exception:  
23 Jul 06:34:24 - Error [ERR\_SOCKET\_CANNOT\_SEND]: Unable to send data  
at Socket.onListenError (dgram.js:362:22)  
at Object.onceWrapper (events.js:315:30)  
at emitOne (events.js:116:13)  
at Socket.emit (events.js:211:7)  
at \_handle.lookup (dgram.js:267:14)  
at \_combinedTickCallback (internal/process/next\_tick.js:141:11)  
at process.\_tickCallback (internal/process/next\_tick.js:180:9)  
nodered.service: Main process exited, code=exited, status=1/FAILURE  
nodered.service: Unit entered failed state.  
nodered.service: Failed with result 'exit-code'.  
nodered.service: Service hold-off time over, scheduling restart.  
Stopped Node-RED graphical event wiring tool.  
Started Node-RED graphical event wiring tool.

---

<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:** [23 July 2018 16:27 UTC](https://discourse.nodered.org/t/node-red-connection-lost/1724/20 "2018-07-23T16:27:40Z")

</div>

Are you using xiaomi-mqtt? If so is it this problem?

> <https://github.com/cflurin/xiaomi-mqtt/issues/3>

[Next page](https://discourse.nodered.org/t/node-red-connection-lost/1724.md?page=2)
