LuckPerms

LuckPerms

41.4k Downloads

Luckperms isn't using the configured ip address for storage (postgresql)

mathiskir opened this issue ยท 2 comments

commented

Description

Luckperms isn't using the ip to connect to my postgresql database I configured in the config.yml.
Thats why i'm getting this error:

[20:26:02 ERROR]: [LuckPerms] Exception occurred whilst loading data for ef49fa6a-f175-46f2-a529-db3637e655ae - Sneeex_
java.util.concurrent.CompletionException: java.sql.SQLTransientConnectionException: luckperms-hikari - Connection is not available, request timed out after 5000ms.
        at me.lucko.luckperms.common.storage.Storage.lambda$future$0(Storage.java:93) ~[?:?]
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
        at java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760) ~[?:?]
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?]
        at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?]
        at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?]
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?]
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?]
Caused by: java.sql.SQLTransientConnectionException: luckperms-hikari - Connection is not available, request timed out after 5000ms.
        at me.lucko.luckperms.lib.hikari.pool.HikariPool.createTimeoutException(HikariPool.java:696) ~[?:?]
        at me.lucko.luckperms.lib.hikari.pool.HikariPool.getConnection(HikariPool.java:197) ~[?:?]
        at me.lucko.luckperms.lib.hikari.pool.HikariPool.getConnection(HikariPool.java:162) ~[?:?]
        at me.lucko.luckperms.lib.hikari.HikariDataSource.getConnection(HikariDataSource.java:100) ~[?:?]
        at me.lucko.luckperms.common.storage.implementation.sql.connection.hikari.HikariConnectionFactory.getConnection(HikariConnectionFactory.java:174) ~[?:?]
        at me.lucko.luckperms.common.storage.implementation.sql.SqlStorage.savePlayerData(SqlStorage.java:612) ~[?:?]
        at me.lucko.luckperms.common.storage.Storage.lambda$savePlayerData$20(Storage.java:259) ~[?:?]
        at me.lucko.luckperms.common.storage.Storage.lambda$future$0(Storage.java:88) ~[?:?]
        ... 7 more
Caused by: me.lucko.luckperms.lib.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "77.xxx.xxx.xxx", user "luckperms", database "minecraft", SSL on
        at me.lucko.luckperms.lib.postgresql.Driver$ConnectThread.getResult(Driver.java:416) ~[?:?]
        at me.lucko.luckperms.lib.postgresql.Driver.connect(Driver.java:271) ~[?:?]
        at java.sql.DriverManager.getConnection(DriverManager.java:681) ~[java.sql:?]
        at java.sql.DriverManager.getConnection(DriverManager.java:229) ~[java.sql:?]
        at me.lucko.luckperms.lib.postgresql.ds.common.BaseDataSource.getConnection(BaseDataSource.java:103) ~[?:?]
        at me.lucko.luckperms.lib.postgresql.ds.common.BaseDataSource.getConnection(BaseDataSource.java:87) ~[?:?]
        at me.lucko.luckperms.lib.hikari.pool.PoolBase.newConnection(PoolBase.java:364) ~[?:?]
        at me.lucko.luckperms.lib.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) ~[?:?]
        at me.lucko.luckperms.lib.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476) ~[?:?]
        at me.lucko.luckperms.lib.hikari.pool.HikariPool.access$100(HikariPool.java:71) ~[?:?]
        at me.lucko.luckperms.lib.hikari.pool.HikariPool$PoolEntryCreator.call(HikariPool.java:726) ~[?:?]
        at me.lucko.luckperms.lib.hikari.pool.HikariPool$PoolEntryCreator.call(HikariPool.java:712) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
        Suppressed: me.lucko.luckperms.lib.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "77.21.175.193", user "luckperms", database "minecraft", SSL off
                at me.lucko.luckperms.lib.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:613) ~[?:?]
                at me.lucko.luckperms.lib.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:161) ~[?:?]
                at me.lucko.luckperms.lib.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:222) ~[?:?]
                at me.lucko.luckperms.lib.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:51) ~[?:?]
                at me.lucko.luckperms.lib.postgresql.jdbc.PgConnection.<init>(PgConnection.java:223) ~[?:?]
                at me.lucko.luckperms.lib.postgresql.Driver.makeConnection(Driver.java:465) ~[?:?]
                at me.lucko.luckperms.lib.postgresql.Driver.access$100(Driver.java:62) ~[?:?]
                at me.lucko.luckperms.lib.postgresql.Driver$ConnectThread.run(Driver.java:375) ~[?:?]
                at java.lang.Thread.run(Thread.java:833) ~[?:?]
[20:26:02 INFO]: Disconnecting com.mojang.authlib.GameProfile@675c76a4[id=ef49fa6a-f175-46f2-a529-db3637e655ae,name=Sneeex_,properties={textures=[com.mojang.authlib.properties.Property@4d975a7e]},legacy=false] (/91.96.56.192:41631): [LP] A database error occurred whilst loading permissions data. Please try again later. If you are a server admin, please check the console for any errors.
[20:26:02 INFO]: com.mojang.authlib.GameProfile@675c76a4[id=ef49fa6a-f175-46f2-a529-db3637e655ae,name=Sneeex_,properties={textures=[com.mojang.authlib.properties.Property@4d975a7e]},legacy=false] (/91.96.56.192:41631) lost connection: [LP] A database error occurred whilst loading permissions data. Please try again later. If you are a server admin, please check the console for any errors.

It tries to connect to a db which is on the same computer but not to the db that exists on a remote server.
Thats why i get no pg_hba.conf.
There's no db on the server which runs minecraft.

Reproduction Steps

  1. Use this (git-Paper-397) paper build
  2. Get luckperms version 5.3.86
  3. create a postgresql db on an external server
  4. configure the postgresql db in the luckperms config.

Expected Behaviour

Luckperms should connect to the 16x.xxx.xxx.xxx ip and not to this adress 77.xxx.xxx.xxx which is just the global ip from the machine on which the server is running.

Server Details

git-Paper-397

LuckPerms Version

5.3.86

Logs and Configs

https://gist.github.com/mathiskir/d0868274b190e1d0e46ef9b2d336aa40

Extra Details

(I asked on Discord server, staff said i should open this issue)

commented

My database is set to listen to "*"
postgresqlconf.txt
pg_hbaconf.txt

commented

I fixed the issue.
I had not allowed connections for user luckperms in pg_hba.conf.
i changed this

# "local" is for Unix domain socket connections only

host	all		postgres        0.0.0.0/0		password
local   all             all                                     peer

to this

# "local" is for Unix domain socket connections only

host	all		all    0.0.0.0/0		        password
local   all             all                                     peer