-
-
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
Issue while connecting to database (Bug) #14960
Comments
I'm unable to repro, we have several production projects running Mongoose 8.7 connected to Atlas with no issues. Please provide:
|
Had the same issue doing tutorials with mongoose. Issue resolved after I rolled back to 8.6.3. Mongoose version Node.js version MongoDB server version error.reason :
|
I'm unable to repro. Running the following script against an Atlas cluster running MongoDB 7.0.14 with Mongoose 8.7.1:
Outputs:
@calvintny what OS are you using, maybe you're on Windows? I've tested on OSX and linux, both work fine. |
yes im using windows |
I can't reproduce on windows either. |
I tried running this code const mongoose = require("mongoose"):
const connectDB = async () => {
try {
await mongoose.connect();
console.log("MongoDB connected successfully!");
} catch (error) {
console.error("MongoDB connection error:", error);
}
};
connectDB(); But it keeps giving me "please whitelist ip" error, even though I've added 0.0.0.0/0 AND allowed my current ip. I talked to MongoDB support and they told me to downgrade to 8.1.1 because the current version seems to be having a problem. It worked! |
Prerequisites
Mongoose version
8.7.1
Node.js version
18.13.0
MongoDB server version
i was just using Atlas
Typescript version (if applicable)
No response
Description
mongoose new version having issues while connecting the MongoDB cluster, and having the error as
Error connecting in MongoDB Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's IP whitelist:
despite using the 0.0.0.0 ID address its still has the issues
Steps to Reproduce
The issue was resolved after using the older stable version 8.1.1
Expected Behavior
No response
The text was updated successfully, but these errors were encountered: