-
Notifications
You must be signed in to change notification settings - Fork 124
Open
Description
Ocasionally, I get this error from the logger, which crashes my app:
TypeError: value.getLowBits is not a function
at serializeLong (/usr/src/app/node_modules/bson/lib/bson/parser/serializer.js:388:23)
at serializeInto (/usr/src/app/node_modules/bson/lib/bson/parser/serializer.js:956:17)
at serializeObject (/usr/src/app/node_modules/bson/lib/bson/parser/serializer.js:347:18)
at serializeInto (/usr/src/app/node_modules/bson/lib/bson/parser/serializer.js:941:17)
at serializeObject (/usr/src/app/node_modules/bson/lib/bson/parser/serializer.js:347:18)
at serializeInto (/usr/src/app/node_modules/bson/lib/bson/parser/serializer.js:941:17)
at serializeObject (/usr/src/app/node_modules/bson/lib/bson/parser/serializer.js:347:18)
at serializeInto (/usr/src/app/node_modules/bson/lib/bson/parser/serializer.js:941:17)
at serializeObject (/usr/src/app/node_modules/bson/lib/bson/parser/serializer.js:347:18)
at serializeInto (/usr/src/app/node_modules/bson/lib/bson/parser/serializer.js:941:17)
at serializeObject (/usr/src/app/node_modules/bson/lib/bson/parser/serializer.js:347:18)
at serializeInto (/usr/src/app/node_modules/bson/lib/bson/parser/serializer.js:727:17)
at serializeObject (/usr/src/app/node_modules/bson/lib/bson/parser/serializer.js:347:18)
at serializeInto (/usr/src/app/node_modules/bson/lib/bson/parser/serializer.js:941:17)
at BSON.serialize (/usr/src/app/node_modules/bson/lib/bson/bson.js:64:28)
at Msg.serializeBson (/usr/src/app/node_modules/mongodb/lib/core/connection/msg.js:126:22)
Emitted 'error' event on DerivedLogger instance at:
at DerivedLogger.transportEvent (/usr/src/app/node_modules/winston/lib/winston/logger.js:630:12)
at exports.MongoDB.emit (node:events:539:35)
at /usr/src/app/node_modules/winston-mongodb/lib/winston-mongodb.js:230:12
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
We log thousand of records every minute... and I can't still find the message that triggers this error.
It would be nice to, at least, catch this error, and not crash the entire application... or maybe to have an option to control what to do whenever this type of errors occurs (maybe an "onUnhandledError" option?).
I think that, as this is simply a logging library/transport-driver, It cannot interfere, in any way, with the app's main flow, so, any error with the underlying MongoDB connection, should be handled properly... or at least: catched.
Metadata
Metadata
Assignees
Labels
No labels