Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

frequent socket hangups

See original GitHub issue

❤️ node

Error: socket hang up
    at createHangUpError (http.js:1264:15)
    at CleartextStream.socketCloseListener (http.js:1315:23)
    at CleartextStream.EventEmitter.emit [as emit] (events.js:126:20)
    at SecurePair.destroy (tls.js:938:22)
    at process.startup.processNextTick.process._tickCallback [as _tickCallback] (node.js:244:9)
    at registerReqListeners (/home/vagrant/projects/thumbs/node_modules/knox/lib/client.js:38:7)
    at Client.Client.putStream [as putStream] (/home/vagrant/projects/thumbs/node_modules/knox/lib/client.js:264:3)
    at Client.putFile (/home/vagrant/projects/thumbs/node_modules/knox/lib/client.js:232:20)
    at Object.oncomplete (fs.js:297:15)

looking into it, seems ridiculous to accuse s3 here, but it wouldn’t surprise me either way

Issue Analytics

  • State:closed
  • Created 11 years ago
  • Comments:51 (32 by maintainers)

github_iconTop GitHub Comments

Albert-IVcommented, Aug 3, 2016

I know this isn’t StackOverflow, but for anyone coming into this issue in the future, make sure you call .end() on the knoxClient.get() call.

IE this will return a socket hangup…

.on('response', handleResponse)
.on('error', handleError);

and this will not

.on('response', handleResponse)
.on('error', handleError)

A pretty obvious coding error, but one that I usually end up running into when I add Knox to a new project. 😆

DaGaMscommented, Nov 20, 2016

FWIW, I’ve had this problem when I was passing the request object into a callback function in Loopback. Long story short, the only thing that “fixed” the problem was to do getFile(url, (err, res) => {callback(null, res)}) - in that way the data is streamed correctly.

Read more comments on GitHub >

github_iconTop 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 >
Receiving Socket Hang Up error often - Help - Fauna Forums
I'm calling Fauna from an EC2 using the Fauna NPM package and have been creating a new Fauna client each time before making...
Read more >
Hang in There! (A solution to socket hang up) - Medium
The most common solution suggested, seemed to think setting a setTimeOut() on the request function would solve the problem. I didn't think that ......
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 >
502 Bad Gateway - Socket hang up | Apigee Edge
The error code [socket hang up][ECONNRESET] indicates that the target server has closed the connection with Edge Microgateway. This can be ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found