LuckPerms

LuckPerms

41.4k Downloads

Can't connect to the MongoDB database and all parameters are correct

Adri121221 opened this issue ยท 5 comments

commented

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

  1. I connect luckperms to MongoDB database
  2. I turn on the server
  3. The error

Paper: 1.8.8
LuckPerms version: 5.3.42

Error:
https://pastebin.com/d7qivYhL

commented

Your DNS is having issues by the looks of it, that's outside of LP's control. Ensure your network connection is working properly.

commented

I have my server in a hosting company, so i can't check my network connection

commented

Talk to their support then, nothing LP can do about it.

commented

@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