-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 3.5.7
-
Component/s: MongoDB 3.4
-
Empty show more show less
The issue as follow: you open a download stream using buckets. You inform an end that's greater than the available chunks (which can be caused by data corruption and missing chunks) and the driver throws an uncaught exception. But this exception doesn't seem to be handed to the .on('error') callback nor is thrown in a place where a try-catch seems to be usable.
This is the stack trace:
/home/node/LynxChan/src/be/node_modules/mongodb/lib/utils.js:133
lynxchan[23793]: throw err;
lynxchan[23793]: ^
lynxchan[23793]: Error: Stream end (47869) must not be more than the length of the file (47752)
lynxchan[23793]: at handleEndOption (/home/node/LynxChan/src/be/node_modules/mongodb/lib/gridfs-stream/download.js:392:13)
lynxchan[23793]: at /home/node/LynxChan/src/be/node_modules/mongodb/lib/gridfs-stream/download.js:324:26
lynxchan[23793]: at /home/node/LynxChan/src/be/node_modules/mongodb/lib/operations/execute_operation.js:75:17
lynxchan[23793]: at /home/node/LynxChan/src/be/node_modules/mongodb/lib/operations/execute_operation.js:64:11
lynxchan[23793]: at ClientSession.endSession (/home/node/LynxChan/src/be/node_modules/mongodb/lib/core/sessions.js:135:41)
lynxchan[23793]: at executeCallback (/home/node/LynxChan/src/be/node_modules/mongodb/lib/operations/execute_operation.js:59:17)
lynxchan[23793]: at handleCallback (/home/node/LynxChan/src/be/node_modules/mongodb/lib/utils.js:129:55)
lynxchan[23793]: at /home/node/LynxChan/src/be/node_modules/mongodb/lib/operations/find_one.js:28:7
lynxchan[23793]: at /home/node/LynxChan/src/be/node_modules/mongodb/lib/operations/execute_operation.js:75:17
lynxchan[23793]: at executeCallback (/home/node/LynxChan/src/be/node_modules/mongodb/lib/operations/execute_operation.js:68:9)
Mongo 4.2, driver version 3.5