-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dumps *gigantic* object into console on error #14529
Comments
Do you have a sample of what the output looks like? |
@ChristopherJTrent I deleted your comment because the message you pasted includes your database connection string with username and password. I'd recommend you update your username and password just in case. |
Also worth noting, your output includes 12 server restarts, most of which have the same error. So the error output isn't quite that large as that. But we'll look into it and see what we can do on our end, or what changes we can recommend to your morgan config to make the logs more readable. |
Thank you, I didn't realize. My DBA is issuing me new creds. (but not without a stern talking to <_< >_>) |
I wouldn't say it's entirely your fault, it is surprising that an error originating from casting an update would contain your database connection string. This has to do with how Node.js serializes errors to the console, doesn't affect how errors end up in JSON or anywhere else. |
…l model properties to console Fix #14529
fix(error): remove model property from CastError to avoid printing all model properties to console
Prerequisites
Mongoose version
8.3.1
Node.js version
21.6.2
MongoDB server version
Irrelevant
Typescript version (if applicable)
No response
Description
Every time I have a problem with mongoose, it decides to dump a gigantic (larger than my terminal scrollback, which is set to 1 billion lines) object into the console.
This makes it completely impossible to diagnose anything.
I have mongoose.set('debug', false),
I don't have any other loggers enabled.
Steps to Reproduce
Happens in random places in this repo: https://github.com/acheung-94/pet-portal/tree/buildNewPetForm
notably when you send a put request to /api/pets/:id
Expected Behavior
I expect there to be some way to get mongoose to not dump the entire mongoose object to console
The text was updated successfully, but these errors were encountered: