Node-Red Connection Lost

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.

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

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.

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

Between your browser and the Node-RED server.

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.

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

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

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.

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

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.

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

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.

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

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/
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

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.

Adjusted.

Thanks @knolleary

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

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.

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