-
-
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
Initial connection returns other errors than just "failed to connect to server X on first connect" #7768
Labels
underlying library issue
This issue is a bug with an underlying library, like the MongoDB driver or mongodb-core
Comments
I still have no idea if this is a bug or not, but I re-wrote my code to better account for any errors on initial connection. |
We'll take a look and see if this is expected behavior or not. But realistically, we don't use docker, so if it turns out this issue only happens with docker we'll have to close it. |
I opened a PR in the mongodb driver for this ☝️ |
Fonger
added a commit
to Fonger/mongoose
that referenced
this issue
Jun 6, 2019
Fonger
added a commit
to Fonger/mongoose
that referenced
this issue
Jun 6, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
underlying library issue
This issue is a bug with an underlying library, like the MongoDB driver or mongodb-core
Do you want to request a feature or report a bug?
bug (I am not 100% sure it is a bug though)
What is the current behavior?
Consider this example:
This worked fine in mongoose 5.0.7 if mongodb 3.6.3 had not been started. However upgrading to mongoose 5.5.2 I get new failures. I've seen both
Error: getaddrinfo ENOTFOUND mongodb mongodb:27017
andError: connect ECONNREFUSED 10.0.51.11:27017
.All this is launched with docker stack, so sometimes the above code is launched before the mongodb docker container. Hence why I need to do this check at all. But I do not want to add extra checks for all kind of errors that can happen like the ones above.
Is it to be exected that ENOTFOUND and ERCONNREFUSED can happen in these scenarios, or should mongoose always report
failed to connect to server .* on first connect
during the first start-up attempts?If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
I was expecting
failed to connect to server .* on first connect
to always be returned during initial connect to mongodb in case the mongodb service is not completely up, not matter the state the service is in.What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Node.js: 10.13.0
Mongoose: 5.5.2
MongoDB: 3.6.3
The text was updated successfully, but these errors were encountered: