Ban Management

Ban Management

193k Downloads

Not disabling itself on startup due to timeouts

TSGTyson opened this issue ยท 18 comments

commented

Hello, from what I've heard this is a great plugin. Except it is a little tricky to use. The MySQL thing is confusing but I think I got it but yet, it still isn't working. Whenever I type a command.....

Example: /ban TSGTyson Test
It will just say in chat
"/ban < player > < reason >
/ban < player > [reason]"

The plugin is enabled.

Here is a link to my config: https://gyazo.com/ea933738ef51f5cc0b1b00957dc5debd
MySQL is: http://clientsql.nitrous-networks.co.uk/phpmyadmin/

You have a great plugin, I hope I can use it soon!
-TSGTyson

commented

The plugin only exhibits the behaviour described when it's disabled. Please check your console logs for more information.

commented

When I restart my server it says "Enabling ban manager v5.8.0. But then it leads to a bunch of stuff with "hikari" whatever that means. https://gyazo.com/fcd9f48c1801e38fd7461616a634e8b5

When I type /plugins the plugin is green so if I'm not the world's dumbest person I think that means enabled. https://gyazo.com/9000c2a38e912b31de68c3334af41696

Here is what happens when I try to ban: https://gyazo.com/ef464541a30742747a8e41d52ea8fa90

commented

Can you paste the output here please, or on pastebin, as the gif is far too fast for me to read.

The exception is most likely caused by BM failing to connect to the database, in which case it should really be red in /plugins, meaning that's a potential bug.

commented
[08:52:52] [Server thread/INFO]: [BanManager] Enabling BanManager v5.8.0
[08:52:52] [Server thread/WARN]: 59 [Server thread] INFO me.confuser.banmanager.internal.hikari.HikariDataSource - HikariPool-0 - is starting.

[08:53:22] [Server thread/WARN]: 30087 [Server thread] INFO me.confuser.banmanager.internal.hikari.pool.HikariPool - HikariPool-0 - is closing down.

[08:53:27] [Server thread/ERROR]: Error occurred while enabling BanManager v5.8.0 (Is it up to date?)
me.confuser.banmanager.internal.hikari.pool.HikariPool$PoolInitializationException: Exception during pool initialization: HikariPool-0 - Connection is not available, request timed out after 30000ms.
    at me.confuser.banmanager.internal.hikari.pool.HikariPool.initializeConnections(HikariPool.java:526) ~[?:?]
    at me.confuser.banmanager.internal.hikari.pool.HikariPool.(HikariPool.java:136) ~[?:?]
    at me.confuser.banmanager.internal.hikari.HikariDataSource.getConnection(HikariDataSource.java:94) ~[?:?]
    at me.confuser.banmanager.internal.ormlite.jdbc.DataSourceConnectionSource.getReadWriteConnection(DataSourceConnectionSource.java:120) ~[?:?]
    at me.confuser.banmanager.internal.ormlite.jdbc.DataSourceConnectionSource.getReadOnlyConnection(DataSourceConnectionSource.java:102) ~[?:?]
    at me.confuser.banmanager.internal.ormlite.dao.BaseDaoImpl.isTableExists(BaseDaoImpl.java:689) ~[?:?]
    at me.confuser.banmanager.storage.PlayerStorage.(PlayerStorage.java:40) ~[?:?]
    at me.confuser.banmanager.BanManager.setupStorages(BanManager.java:395) ~[?:?]
    at me.confuser.banmanager.BanManager.onEnable(BanManager.java:118) ~[?:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:340) [minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:357) [minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:317) [minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:414) [minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:378) [minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:333) [minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:263) [minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) [minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_45]
Caused by: java.sql.SQLTransientConnectionException: HikariPool-0 - Connection is not available, request timed out after 30000ms.
    at me.confuser.banmanager.internal.hikari.pool.HikariPool.getConnection(HikariPool.java:195) ~[?:?]
    at me.confuser.banmanager.internal.hikari.pool.HikariPool.getConnection(HikariPool.java:147) ~[?:?]
    at me.confuser.banmanager.internal.hikari.pool.HikariPool.initializeConnections(HikariPool.java:510) ~[?:?]
    ... 19 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 10 times. Giving up.
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_45]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_45]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_45]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422) ~[?:1.8.0_45]
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:407) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at com.mysql.jdbc.Util.getInstance(Util.java:382) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1013) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2239) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2168) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:794) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_45]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_45]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_45]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422) ~[?:1.8.0_45]
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:407) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:378) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at me.confuser.banmanager.internal.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:95) ~[?:?]
    at me.confuser.banmanager.internal.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:101) ~[?:?]
    at me.confuser.banmanager.internal.hikari.pool.PoolBase.newConnection(PoolBase.java:314) ~[?:?]
    at me.confuser.banmanager.internal.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:171) ~[?:?]
    at me.confuser.banmanager.internal.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:436) ~[?:?]
    at me.confuser.banmanager.internal.hikari.pool.HikariPool.access$500(HikariPool.java:65) ~[?:?]
    at me.confuser.banmanager.internal.hikari.pool.HikariPool$PoolEntryCreator.call(HikariPool.java:567) ~[?:?]
    at me.confuser.banmanager.internal.hikari.pool.HikariPool$PoolEntryCreator.call(HikariPool.java:560) ~[?:?]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_45]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[?:1.8.0_45]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[?:1.8.0_45]
    ... 1 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_45]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_45]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_45]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422) ~[?:1.8.0_45]
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:407) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1116) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at com.mysql.jdbc.MysqlIO.(MysqlIO.java:343) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2334) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2186) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2168) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:794) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_45]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_45]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_45]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422) ~[?:1.8.0_45]
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:407) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:378) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at me.confuser.banmanager.internal.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:95) ~[?:?]
    at me.confuser.banmanager.internal.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:101) ~[?:?]
    at me.confuser.banmanager.internal.hikari.pool.PoolBase.newConnection(PoolBase.java:314) ~[?:?]
    at me.confuser.banmanager.internal.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:171) ~[?:?]
    at me.confuser.banmanager.internal.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:436) ~[?:?]
    at me.confuser.banmanager.internal.hikari.pool.HikariPool.access$500(HikariPool.java:65) ~[?:?]
    at me.confuser.banmanager.internal.hikari.pool.HikariPool$PoolEntryCreator.call(HikariPool.java:567) ~[?:?]
    at me.confuser.banmanager.internal.hikari.pool.HikariPool$PoolEntryCreator.call(HikariPool.java:560) ~[?:?]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_45]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[?:1.8.0_45]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[?:1.8.0_45]
    ... 1 more
Caused by: java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method) ~[?:1.8.0_45]
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345) ~[?:1.8.0_45]
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[?:1.8.0_45]
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[?:1.8.0_45]
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[?:1.8.0_45]
    at java.net.Socket.connect(Socket.java:589) ~[?:1.8.0_45]
    at java.net.Socket.connect(Socket.java:538) ~[?:1.8.0_45]
    at java.net.Socket.(Socket.java:434) ~[?:1.8.0_45]
    at java.net.Socket.(Socket.java:244) ~[?:1.8.0_45]
    at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:254) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at com.mysql.jdbc.MysqlIO.(MysqlIO.java:292) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2334) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2186) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2168) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:794) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_45]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_45]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_45]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422) ~[?:1.8.0_45]
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:407) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:378) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305) ~[minecraft_server.jar:git-Spigot-5f38d38-18fbb24]
    at me.confuser.banmanager.internal.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:95) ~[?:?]
    at me.confuser.banmanager.internal.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:101) ~[?:?]
    at me.confuser.banmanager.internal.hikari.pool.PoolBase.newConnection(PoolBase.java:314) ~[?:?]
    at me.confuser.banmanager.internal.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:171) ~[?:?]
    at me.confuser.banmanager.internal.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:436) ~[?:?]
    at me.confuser.banmanager.internal.hikari.pool.HikariPool.access$500(HikariPool.java:65) ~[?:?]
    at me.confuser.banmanager.internal.hikari.pool.HikariPool$PoolEntryCreator.call(HikariPool.java:567) ~[?:?]
    at me.confuser.banmanager.internal.hikari.pool.HikariPool$PoolEntryCreator.call(HikariPool.java:560) ~[?:?]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_45]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[?:1.8.0_45]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[?:1.8.0_45]

Hopefully that's easy enough to read.

commented

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 10 times. Giving up.

As suspected, it can't connect to the database.

I'm only going to label this as a bug as it should disable the plugin in this instance on start up.

However, for your specific case to solve this solution, it's not a bug on the plugin end, so double check your connection details, they're either incorrect, or the database is simply refusing the connection.

commented

Alrighty, thanks for your help.
While I have you, I'm a little bit confused on the database part.
My server is hosted from nitrous networks and they gave me a MySQL database.
The username they gave me is Tyson5
I put that in the "User" part in the config.
I put the password they gave me for the MySQL Database in the "Password" part.
At the very top of the MySQL page it says, "Server: localhost"
So I put that in my "Host:" part of the config.
I kept the port as 3306 since I didn't know any different.
And I was quite unsure of what to put for the "Name:" part of the config, but I saw some tutorials and the best one I saw the Username was the "Name:" aswell, so I just switched it to the name.
The Database Local is enabled.
I didn't create anything on the MySQL page. Am I supposed to create something to help banmanager run?

commented

The name is probably the name of the database. Sometimes the name of the database is the same as the login name.
Ask your host for details.

commented

No worries. For the host part, localhost will only be the case if the database is hosted on the same same machine as your minecraft server. I'm not familiar with their setup, so can't comment on whether that part is correct or not.

As for name, this is the name of the database. If you haven't created one, you'll need to create one. If they don't have a wiki or some sort of knowledge base that lists these, open a support ticket with them.

Aha @EvilOlaf beat me to it

commented

I have this issue aswell.

My details are correct.

I use spigot 1.8.8 and Java 8

commented

@bingoberra What plugin offers the same functionality, that actually works?

@confuser My information is correct. Ensure the database allows connection? What do you mean, sorry.

commented

I'm having this same issue. Exactly the same.
Was there a result for this? The issue seemed to have an abrupt close.

commented

@Elliot-Potts The resolution for this is to ensure the database connection details are correct. If they are, and connections are still failing, ensure the database allows connections from the server your minecraft server is running on.

commented

The answer is to change plugin :)

commented

In default configuration MySQLd does not allow connections from outside. It will accept those from localhost only for security reasons.
If your Minecraft server is physically on another machine than your MySQL database server you have to ensure that the MySQLd accepts connection from other IP addresses as well. This information can be acquired by asking your provider.

commented

I'm having the exact same issue and the same error in console/logs as well. The MySQL Details are correct and ive tried connecting from various ip's using phpmyadmin, the connections are accepted and i can view the database, but banmanager isnt able to connect for some reason...
Please help.

commented

Check this comment: #502 (comment)

commented

Just for verification can you please paste your console output and maybe a full startup log here (please use markdown for formatting) or pastebin?
Also useful would be your config.yml. You should censor your MySQL credentials beforehand.

commented

@EvilOlaf I have checked if the MySQL Database accepts foreign connections, it does, but this error still occurs... please help.