LuckPerms

LuckPerms

41.4k Downloads

MongoDB Replica Set connections cannot resolve

mcgrizzz opened this issue ยท 0 comments

commented

There is no current way to connect MongoDB replica sets to Luck Perms. Currently, the method used in MongoDao uses a ServerAddress to initiate connections which cannot resolve URI connections (syntax: "mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]")

Here's an example:

  1. User has replica set located here: database-tyjas.mongodb.net
  2. Upon connection via ServerAddress, ServerAddress cannot resolve the address because there is a specific connection URI that must be used in order to connect. Example error.

Here's a Fix:

  1. Implement MongoClientURI in MongoDao class and allow that to be used instead of traditional database options.

I've created a pull request with the solution I have proposed.

Thank you for your work on this plugin.