Socket hang up with ExpressJS
See original GitHub issueI’ve setup my server with elastic-apm-node
, and it run ok. But after every period of time (30-60 min), it causes an error like below:
Error: socket hang up
at createHangUpError (_http_client.js:331:15)
at Socket.socketOnEnd (_http_client.js:423:23)
at emitNone (events.js:111:20)
at Socket.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1055:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickDomainCallback (internal/process/next_tick.js:218:9)
This error made my server down too, so I need to restart it. After removed the code, everthing okay now. This is my config code:
require('elastic-apm-node').start({
serviceName: '...',
secretToken: '...',
instrument: true,
captureBody: 'all',
errorOnAbortedRequests: true,
serverUrl: 'http://...:8200',
active: process.env.NODE_ENV === 'production'
})
Version
Elasticsearch, Kibana, APM v6.2.1
NodeJS v8.9.4
ExpressJS v4.15.2
I searched for this error, but there’s no results with apm-server. Is this a known issue, or my configuration miss something? Please help me to fix this. Thanks!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:31 (13 by maintainers)
Top Results From Across the Web
NodeJS - What does "socket hang up" actually mean?
It means that socket does not send connection end event within the timeout period. If you are getting the request for cheerio via...
Read more >NodeJS - What does socket hang up actually mean - Edureka
When a socket hang up is thrown, one of two things happens: When you're a customer, When you send a request to a...
Read more >Hang in There! (A solution to socket hang up) - Medium
(A solution to socket hang up) Recently, while watching a YouTube video about how to create a Node. js backend (Building a RESTful...
Read more >How to handle a socket hang up error in Node.js usually - Quora
Socket hang up error are usually errors when requests coming to your server are more than it can handle. This might be b...
Read more >Socket hang up on long requests #2936 - axios/axios - GitHub
When you create an HTTP(S) server in node, it sets the socket timeout to 0 (no timeout). Nonetheless, the socket still closed and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
To chime in here: We were seeing the same
Socket hang up
error on version 1.1.1, running ahapi
server. After updating to version 1.2.1, we have not seen the error again. Mind you, we have cut down our sample rate to 0.5.For reference purposes, here is our config:
We will eventually try to up the
transactionSampleRate
back up to the default 100%, but are not setup to make the change safely at this point. Will follow up once we properly test.I had the same problem. I configured APM Server with these values and I solved it.
apm-server.yml: