Can't connect to the MongoDB database and all parameters are correct
Adri121221 opened this issue ยท 5 comments
Description
Hi. I have MongoDB in my LuckPerms config and it was working well, but now it has been throwing this error recently, and I don't know why.
Reproduction steps
- I connect luckperms to MongoDB database
- I turn on the server
- The error
Paper: 1.8.8
LuckPerms version: 5.3.42
Your DNS is having issues by the looks of it, that's outside of LP's control. Ensure your network connection is working properly.
@lucko I noticed that you closed a lot of these issues without adressing them properly. You can easily reproduce this by creating a free cluster on MongoDB Atlas and using the srv connection string in the config.
IMO it is not an issue with the driver but rather the way your plugin handles MongoDB connection strings.
You should be able to just paste mongodb+srv://dbUser:<password>@mycluster.awfcu.mongodb.net/myFirstDatabase?retryWrites=true&w=majority
for example and be fine. The issie is not an unknown host as many people (with half knowledge) claim. This is definitly a bug.
As fast fix you could add a connection string property that gets used instead of your split declarations.
https://docs.mongodb.com/drivers/java/#connect-to-mongodb-atlas