-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Uncaught mongodb errors in try-catch when using deno #14237
Comments
I'm unable to repro, the following script demonstrates that the connection error is successfully caught:
Output:
Can you please modify the provided script to demonstrate the issue you're seeing? |
Those are my new findings regarding this: Interestingly, adding the Also, the catchable error (< 3000ms) is a mongoose error ( Finally, this issue might be caused by or at least related to denoland/deno#19078 |
I'm still not able to repro even without
Switching Do you still get this uncaught error when running the exact script below?
|
Yes, this exact script also results in the uncaught exception:
I also just freshly installed deno in a Gentoo VM, in which I didn't do any prior stuff with deno/node and the exact same thing happens. |
What's the IP misconfiguration that caused this issue? Maybe I can try to replicate that. |
Two options:
It might be totally unrelated but for 1., according to wireshark, it retries the TCP request multiple time with an exponential backoff until it finally fails after not receiving ANY answere. For 2., after a couple of seconds, an ICMP Host unreachable is sent back by the gateway and it fails. Here are the 2 stacktraces:
2.:
|
I was able to repro using The stack trace from (2) looks like it might be an internal Deno issue: if the stack trace doesn't include anything Mongoose or MongoDB related, just Deno internals, that means there's no way for us to handle this error. Hopefully I can find a way. |
Looks like I found the root cause, I opened an issue with Deno here with the details: denoland/deno#21951. It looks like a Deno issue, we'll see what the Deno team says. |
Prerequisites
Mongoose version
8.x.x
Node.js version
1.39.0 (deno)
MongoDB version
7.x
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
22.04
Issue
code:
Connecting and everything else works perfectly fine, but to see what happens on connection issues, I deliberately changed the IP to something else, expecting the program just to exit. Instead, I now get an:
The error is expected due to the IP misconfiguration, but the program should not just die with an Uncaught Error but only exit silently instead. I am not very proficient in Typescript, but this seems not to be the expected behavior for this try-catch block. I would appreciate any help, thank you!
The text was updated successfully, but these errors were encountered: