knox: frequent socket hangups

❤️ 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

About this issue

  • Original URL
  • State: closed
  • Created 12 years ago
  • Comments: 51 (32 by maintainers)

Commits related to this issue

Most upvoted comments

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…

client.get('s3-key')
.on('response', handleResponse)
.on('error', handleError);

and this will not

client.get('s3-key')
.on('response', handleResponse)
.on('error', handleError)
.end();

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