Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node Red freezes because of failed attempts to connect to miniserver #42

Closed
budulinek opened this issue Jan 30, 2020 · 3 comments
Closed

Comments

@budulinek
Copy link

Problem:
Nodes attempt to connect to Loxone even if login credentials are missing. This (obviously) leads to errors in syslog:

Jan 30 07:55:49 L403-sn50 Node-RED[5769]: 30 Jan 07:55:49 - [info] [loxone-miniserver:51a8d49f.d98894] connection closed: Socket Error: undefined ERR_STREAM$
Jan 30 07:55:49 L403-sn50 Node-RED[5769]: 30 Jan 07:55:49 - [info] [loxone-miniserver:51a8d49f.d98894] connection closed: reconnecting
Jan 30 07:55:49 L403-sn50 Node-RED[5769]: 30 Jan 07:55:49 - [info] [loxone-miniserver:f9ff3407.c04ec8] Miniserver connected (10.10.10.10:10010) using Token-$
Jan 30 07:55:49 L403-sn50 Node-RED[5769]: WebSocket error:  Socket Error: undefined ERR_STREAM_WRITE_AFTER_END 1006
Jan 30 07:55:49 L403-sn50 Node-RED[5769]: 30 Jan 07:55:49 - [error] [loxone-miniserver:f9ff3407.c04ec8] Miniserver connection error: Socket Error: undefined$
Jan 30 07:55:49 L403-sn50 Node-RED[5769]: Websocket Connection closed:  1006 Socket Error: undefined ERR_STREAM_WRITE_AFTER_END
Jan 30 07:55:49 L403-sn50 Node-RED[5769]: 30 Jan 07:55:49 - [info] [loxone-miniserver:f9ff3407.c04ec8] connection closed: Socket Error: undefined ERR_STREAM$
Jan 30 07:55:49 L403-sn50 Node-RED[5769]: 30 Jan 07:55:49 - [info] [loxone-miniserver:f9ff3407.c04ec8] connection closed: reconnecting
Jan 30 07:55:50 L403-sn50 Node-RED[5769]: 30 Jan 07:55:50 - [info] [loxone-miniserver:715b1c25.99c1dc] Miniserver connected (10.10.10.10:10010) using Token-$
Jan 30 07:55:50 L403-sn50 Node-RED[5769]: WebSocket error:  Socket Error: undefined ERR_STREAM_WRITE_AFTER_END 1006
Jan 30 07:55:50 L403-sn50 Node-RED[5769]: 30 Jan 07:55:50 - [error] [loxone-miniserver:715b1c25.99c1dc] Miniserver connection error: Socket Error: undefined$
Jan 30 07:55:50 L403-sn50 Node-RED[5769]: Websocket Connection closed:  1006 Socket Error: undefined ERR_STREAM_WRITE_AFTER_END
Jan 30 07:55:50 L403-sn50 Node-RED[5769]: 30 Jan 07:55:50 - [info] [loxone-miniserver:715b1c25.99c1dc] connection closed: Socket Error: undefined ERR_STREAM$
Jan 30 07:55:50 L403-sn50 Node-RED[5769]: 30 Jan 07:55:50 - [info] [loxone-miniserver:715b1c25.99c1dc] connection closed: reconnecting

etc etc. The attempts to reconnect are so frequent that Node Red (in my case running on Raspberry Pi 3) becomes unresponsive. And of course, loggs fill memory (SD card).

Why are login credentials missing? Credentials are never stored during export of flow. After (re)importing the flow, you always have to enter them manually. If you forgot to do so and deploy the flow without credentials, the flow starts, but Node Red becomes unresponsive, because of errors and attempts to reconnect.

Suggested solution:

  • Delays between attempts to reconnect (for example 10 seconds?) in order to prevent Node Red becoming unresponsive.

  • Disable connection if login credentials (in loxone-miniserver node) are missing.

@codmpm
Copy link
Owner

codmpm commented Jan 30, 2020

Thank you for this issue!

Delays between attempts to reconnect (for example 10 seconds?) in order to prevent Node Red becoming unresponsive.

I think this is handled by the underlying node-lox-ws-api and is not exposed, so I can't change that.

Disable connection if login credentials (in loxone-miniserver node) are missing.

I think this is the way to go... as far as I know it is not possible to connect to the miniserver without credentials anyway, or is it?

Exporting the credentials with a flow export ist not valid, as these are sensitive informations and could then be - without knowing - made public by exporting a flow. Node-red itself advises to store them separately: https://nodered.org/docs/creating-nodes/credentials

I will disable the connection when no credentials are given in a future release.

@budulinek
Copy link
Author

Thanks a lot!

Yes, as far as I know, it is not possible to connect to miniserver without credentials. So it is safe to make credentials obligatory and disable connection and throw an error ("red triangle" in Node Red) if credentials are missing.

@codmpm codmpm closed this as completed in 4a0d29c Feb 7, 2020
@codmpm
Copy link
Owner

codmpm commented Feb 7, 2020

Btw, the red triangle is provided by the node-red editor. It appears after an editor reload if the node-config is not complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants