4

Every day randomly I get these errors, This makes node non-responsive. I am not able to reproduce it. How can I do it?

Jul 21 12:38:38 localhost Pchat.log RangeNotSatisfiableError: Range Not Satisfiable Jul 21 12:38:38 localhost Pchat.log at SendStream.error (/home/ubuntu/node_modules/send/index.js:275:31) Jul 21 12:38:38 localhost Pchat.log at SendStream.send (/home/ubuntu/node_modules/send/index.js:618:19) Jul 21 12:38:38 localhost Pchat.log at onstat (/home/ubuntu/node_modules/send/index.js:677:10) Jul 21 12:38:38 localhost Pchat.log at FSReqWrap.oncomplete (fs.js:83:15) Jul 21 12:38:38 localhost Pchat.log RangeNotSatisfiableError: Range Not Satisfiable Jul 21 12:38:38 localhost Pchat.log at SendStream.error (/home/ubuntu/node_modules/send/index.js:275:31) Jul 21 12:38:38 localhost Pchat.log at SendStream.send (/home/ubuntu/node_modules/send/index.js:618:19) Jul 21 12:38:38 localhost Pchat.log at onstat (/home/ubuntu/node_modules/send/index.js:677:10) Jul 21 12:38:38 localhost Pchat.log at FSReqWrap.oncomplete (fs.js:83:15) Jul 21 12:38:38 localhost Pchat.log RangeNotSatisfiableError: Range Not Satisfiable Jul 21 12:38:38 localhost Pchat.log at SendStream.error (/home/ubuntu/node_modules/send/index.js:275:31) Jul 21 12:38:38 localhost Pchat.log at SendStream.send (/home/ubuntu/node_modules/send/index.js:618:19) Jul 21 12:38:38 localhost Pchat.log at onstat (/home/ubuntu/node_modules/send/index.js:677:10) Jul 21 12:38:38 localhost Pchat.log at FSReqWrap.oncomplete (fs.js:83:15)

Hardeep Mehta
  • 469
  • 1
  • 6
  • 17
  • have you found a way to fix this issue? – Faizan Aug 02 '16 at 09:45
  • Added a middleware to my express app which does not throw it into the app, Also increased the memory stack of node. – Hardeep Mehta Aug 02 '16 at 12:23
  • Which middleware have u added? How can I add. So it does not throw the exception in the node app ? And you increased the stack of node by node --stack_size=8192 --max-old-space-size=8192 ? – Faizan Aug 02 '16 at 12:54
  • 1
    Yes, I am using standard express error handling middleware. You can see it here. https://expressjs.com/en/guide/error-handling.html – Hardeep Mehta Aug 02 '16 at 12:59
  • Thanks, if I use express error handling, then will it not crash my node app ? right now i am using node error handling. process.on('uncaughtException', function (err) { console.log("Uncaught Exception:", err); process.exit(1); // This is VITAL. Don't swallow the err and try to continue. }); – Faizan Aug 02 '16 at 13:01
  • Keep this if you like, Express won't bypass this error to node. – Hardeep Mehta Aug 02 '16 at 13:04
  • okay, do you think using this simple error handle of express would be enough to get where and why errors are coming without crashing my node server? app.use(function(err, req, res, next) { console.error(err.stack); res.status(500).send('Something broke!'); }); – Faizan Aug 02 '16 at 13:06
  • 1
    If and only iff error is coming via express, I express is not involved and you are still getting an error, Then ur process might crash. – Hardeep Mehta Aug 02 '16 at 13:08

1 Answers1

4

It looks like send package error. It occurs when request contains header Content-Range with unreachable range of stream (paragraph #3). It's better to add an issue into send package.

To reproduce it try to send Content-Range. But before look how it works.

Community
  • 1
  • 1
Paul Rumkin
  • 6,737
  • 2
  • 25
  • 35