Closed csnktms closed 6 years ago
Hi I am having the same issue. Currently using mongoose 5.2.0.
Until mongoose 5.2.1 comes out, you need to make sure your authSource and replicaSet vars are set in the options object instead of the uri. You must also specify the port explicitly. Check out issues 6647-6651 for more details. Let us know if you have any further trouble getting connected.
@csnktms You can find your replicaSet value in the atlas console, it’s in the older driver connection string for sure and probably a few other places. Let me know if you still need help, I’ll be back at my computer early in the morning EDT.
The error is caused by this commit.
You only need to set useNewUrlParser
equal to true
in options.
I tried it didn't change anything.
Sure? Try to downgrade you Mongoose version to ~5.0.14. Remember update your package-lock.json or equivalent.
I downgraded to 5.1.8 and it's working without anything.
@csnktms in package.json use -> "mongoose": "5.1.8"
@AndyOchoaS That commit was never published to npm. It’s already been replaced with a better solution. 5.2.0 forced the value to true and didn’t let you set it in the connection options, 5.2.1 will.
Setting usenewurlparser to true is what breaks mongoose 5.2.0 because the 3.1.0 driver shipped with a bug in the new url parser. All of this is documented in bugs created in the last 24 hours.
Upgrade to 5.2.1, just released and should fix this issue. See #6656
Nice! Thanks @vkarpov15!!!
Unable to connect to MongoAtlas free tier w/ Mongoose.
Error No 1.:
seed list contains no mongos proxies, replicaset connections requires the parameter replicaSet to be supplied in the URI or options object, mongodb://server:port/db?replicaSet=name
Connect function:
mongoose.connect(`mongodb+srv://admin:${pass}@nodeapp-alni3.mongodb.net/nodeapp?retryWrites=true`);
Where should I get this repl-set name? It suggested to use repl-set-shard-0 or something like that. With these configurations the second error popup is that
auth failed
. I have tried my pass hardcoding, extracting it to variables, and generating new passwords. Nothing works 🥇