Node-RED crash when connection to PLC drops

Hello to all,
I have a problem with Node-RED:
continuously communicates with PLCs using node-red-contrib-s7, it works well but sometimes i get the following error:

Error: read ECONNRESET at TCP.onStreamRead (node: internal / stream_base_commons: 211: 20)

I noticed that the problem occurs when the connection with a PLC is missing for more than a few minutes.

This error stops Node-RED.

Here is last part of the logs:

7 Apr 11:30:39 - [error] [s7 endpoint:PLC - Pozzi Vasca Vecchia] Error: Timeout connecting to the transport
7 Apr 11:30:40 - [error] [s7 endpoint:PLC - Pozzi Vasca Nuova] Error: Timeout connecting to the transport
7 Apr 11:30:54 - [error] [s7 endpoint:PLC - Pozzi Vasca Vecchia] Error: Timeout connecting to the transport
7 Apr 11:30:55 - [error] [s7 endpoint:PLC - Pozzi Vasca Nuova] Error: Timeout connecting to the transport
7 Apr 11:31:10 - [error] [s7 endpoint:PLC - Pozzi Vasca Nuova] Error: Timeout connecting to the transport
7 Apr 11:31:13 - [red] Uncaught Exception:
7 Apr 11:31:13 - Error: read ECONNRESET
at TCP.onStreamRead (internal/stream_base_commons.js:209:20)

I already asked on the github's node package but i can't get an answer.

Unfortunately, this is something the node (or dependency) author needs to fix. As the author hasn't responded in 8 months your options are limited. You could fork the nodes in question and apply the fix yourself.

I had a similar issue with mqtt connection through a custom azure iot hub node, had to switched to http instead of mqtt. Error sounded very low level so i thought it was a node error instead of a custom package one. But what i noticed was, node red was not able to catch and handle them, not sure if this is even possible though

The node should catch and handle exceptions. Node red should not have to. Only exceptions that prevent node-red from continuing should get back up to node-red itself (such as out of memory).

Node-RED had no way of knowing what state a node will be in after an uncaught exception, it may not be possible to carry on safely, so the best option is to exit

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