# Read ECONNRESET at TCP.onStreamRead

**URL:** <https://discourse.nodered.org/t/read-econnreset-at-tcp-onstreamread/43746>\
**Category:** General\
**Created:** [6 April 2021 08:04 UTC](https://discourse.nodered.org/t/read-econnreset-at-tcp-onstreamread/43746 "2021-04-06T08:04:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![angrj](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/angrj/32/39835_2.png) [@angrj](https://discourse.nodered.org/u/angrj)\
**Post date:** [6 April 2021 08:04 UTC](https://discourse.nodered.org/t/read-econnreset-at-tcp-onstreamread/43746/1 "2021-04-06T08:04:40Z")

</div>

Hello to all,  
I have a problem with Node-RED:  
continuously communicates with PLCs using node-red-contrib-s7, it worked well for a long time, once migrated Node.JS and Node-RED (without changes to the flows) from a machine with Windows 7 to a machine with Windows Server 2012 r2, I started getting the following error after a day or two:

16 Mar 10:33:01 - Error: read ECONNRESET  
at TCP.onStreamRead (node: internal / stream\_base\_commons: 211: 20)

this error stops Node-RED

Node.js version: 15.11.0  
npm version: 7.6.1  
Node-RED version: 1.2.9

as new user, i can't attach flows.json

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [6 April 2021 08:06 UTC](https://discourse.nodered.org/t/read-econnreset-at-tcp-onstreamread/43746/2 "2021-04-06T08:06:28Z")

</div>

> [@angrj](#):
>
> Node.js version: 15.11.0

This is potentially the problem.

I would recommend returning to node v14.

---

<div class="post-metadata">

**Author:** ![angrj](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/angrj/32/39835_2.png) [@angrj](https://discourse.nodered.org/u/angrj)\
**Post date:** [6 April 2021 08:07 UTC](https://discourse.nodered.org/t/read-econnreset-at-tcp-onstreamread/43746/3 "2021-04-06T08:07:59Z")

</div>

Thanks for your quick response!  
I try now and will update in a few days!

---

<div class="post-metadata">

**Author:** ![angrj](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/angrj/32/39835_2.png) [@angrj](https://discourse.nodered.org/u/angrj)\
**Post date:** [7 April 2021 09:32 UTC](https://discourse.nodered.org/t/read-econnreset-at-tcp-onstreamread/43746/4 "2021-04-07T09:32:49Z")

</div>

Despite changing the version to 14, the error reoccurred.  
I noticed that the problem occurs when the connection with a PLC is missing for more than a few minutes.

Last part of the logs:

> Blockquote  
> 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)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [7 April 2021 11:49 UTC](https://discourse.nodered.org/t/read-econnreset-at-tcp-onstreamread/43746/5 "2021-04-07T11:49:52Z")

</div>

As this node is crashing node-red, I would read through [existing issues that mention ECONNRESET](https://github.com/st-one-io/node-red-contrib-s7/issues?q=ECONNRESET) and if necessary raise a new issue.

Bottom line: To the best of its abilities, a node should not crash node-red, it should handle errors. (there are cases where it cannot be avoided)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [6 June 2021 11:50 UTC](https://discourse.nodered.org/t/read-econnreset-at-tcp-onstreamread/43746/6 "2021-06-06T11:50:34Z")

</div>

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