[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3487
  • Last Modified:

NodeJS - { [Error: socket hang up] code: 'ECONNRESET' }

Hi,

i'm getting data via http get method Node JS but i get this error often "{ [Error: socket hang up] code: 'ECONNRESET' }" error on console.

What do you think the problem?
0
ahmettiryaki
Asked:
ahmettiryaki
  • 2
1 Solution
 
COBOLdinosaurCommented:
0
 
ahmettiryakiAuthor Commented:
@COBOLdinosaur in the link you posted, i couldn't find my problem. They only explain what is the mean of error.
0
 
COBOLdinosaurCommented:
The problem is on the other end.  It is closing the connection.  So you probably need to look at logs on the other side to see why it is closing.

ECONNRESET means the connection has received a ReSeT (RST) segment
(ostesibly) from the remote TCP. There are a multitude of reasons
such a segment could be received, including, but not limited to:

the remote abused SO_LINGER and did an abortive close of the
connection

your application sent data which arrived after the remote called
shutdown(SHUT_RD) or close()

the remote TCP hit a retransmission limit and aborted (yes, if the
data segments weren't getting through the chances of the RST making
it are slim, but still non-zero)
*) there was some actual TCP protocol error between the two systems

9 times out of ten if the server _application_ terminates
(prematurely) the normal close() which happens on almost all platforms
will cause TCP to emit a FINished (FIN) segment. That would then be a
recv/read return of zero at your end. Of course if your application
ignored that and then tried to send something, that brings us to the
second bullet item above.

BTW it is not a rare occurrence for these kind of connects to go down frequently.

Cd&
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now