Ban Management

Ban Management

193k Downloads

SQLException

c0wg0d opened this issue · 16 comments

commented

I'm not sure what caused this. The ban seems to have worked fine. Any ideas?

[12:56:17 WARN]: java.sql.SQLException: Unable to run insert stmt on object me.confuser.banmanager.data.PlayerBanData@75b9d530: INSERT INTOplayer_bans(player_id,reason,actor_id,created,updated,expires) VALUES (?,?,?,?,?,?) [12:56:17 WARN]: at me.confuser.banmanager.internal.ormlite.misc.SqlExceptionUtil.create(SqlExceptionUtil.java:22) [12:56:17 WARN]: at me.confuser.banmanager.internal.ormlite.stmt.mapped.MappedCreate.insert(MappedCreate.java:135) [12:56:17 WARN]: at me.confuser.banmanager.internal.ormlite.stmt.StatementExecutor.create(StatementExecutor.java:450) [12:56:17 WARN]: at me.confuser.banmanager.internal.ormlite.dao.BaseDaoImpl.create(BaseDaoImpl.java:310) [12:56:17 WARN]: at me.confuser.banmanager.storage.PlayerBanStorage.ban(PlayerBanStorage.java:119) [12:56:17 WARN]: at me.confuser.banmanager.commands.BanCommand$1.run(BanCommand.java:136) [12:56:17 WARN]: at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71) [12:56:17 WARN]: at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53) [12:56:17 WARN]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [12:56:17 WARN]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [12:56:17 WARN]: at java.lang.Thread.run(Thread.java:745) [12:56:17 WARN]: Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '\xB5\xEE\x1F\x01\x89\xE2I)\xA3e\xE4\x03\x1B\x9AnK' for key 'player_bans_player_idx' [12:56:17 WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [12:56:17 WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [12:56:17 WARN]: at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [12:56:17 WARN]: at java.lang.reflect.Constructor.newInstance(Constructor.java:423) [12:56:17 WARN]: at com.mysql.jdbc.Util.handleNewInstance(Util.java:407) [12:56:17 WARN]: at com.mysql.jdbc.Util.getInstance(Util.java:382) [12:56:17 WARN]: at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1039) [12:56:17 WARN]: at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593) [12:56:17 WARN]: at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525) [12:56:17 WARN]: at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986) [12:56:17 WARN]: at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140) [12:56:17 WARN]: at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2626) [12:56:17 WARN]: at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2111) [12:56:17 WARN]: at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2407) [12:56:17 WARN]: at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2325) [12:56:17 WARN]: at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2310) [12:56:17 WARN]: at me.confuser.banmanager.internal.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61) [12:56:17 WARN]: at me.confuser.banmanager.internal.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java) [12:56:17 WARN]: at me.confuser.banmanager.internal.ormlite.jdbc.JdbcDatabaseConnection.insert(JdbcDatabaseConnection.java:170) [12:56:17 WARN]: at me.confuser.banmanager.internal.ormlite.stmt.mapped.MappedCreate.insert(MappedCreate.java:91) [12:56:17 WARN]: ... 9 more

commented

Are you running in offline mode?
On 1 Apr 2016 18:00, "c0wg0d" [email protected] wrote:

I'm not sure what caused this. The ban seems to have worked fine. Any
ideas?

[12:56:17 WARN]: java.sql.SQLException: Unable to run insert stmt on
object me.confuser.banmanager.data.PlayerBanData@75b9d530: INSERT INTO
player_bans(player_id,reason,actor_id,created,updated,expires) VALUES
(?,?,?,?,?,?)
[12:56:17 WARN]: at
me.confuser.banmanager.internal.ormlite.misc.SqlExceptionUtil.create(SqlExceptionUtil.java:22)
[12:56:17 WARN]: at
me.confuser.banmanager.internal.ormlite.stmt.mapped.MappedCreate.insert(MappedCreate.java:135)
[12:56:17 WARN]: at
me.confuser.banmanager.internal.ormlite.stmt.StatementExecutor.create(StatementExecutor.java:450)
[12:56:17 WARN]: at
me.confuser.banmanager.internal.ormlite.dao.BaseDaoImpl.create(BaseDaoImpl.java:310)
[12:56:17 WARN]: at
me.confuser.banmanager.storage.PlayerBanStorage.ban(PlayerBanStorage.java:119)
[12:56:17 WARN]: at
me.confuser.banmanager.commands.BanCommand$1.run(BanCommand.java:136)
[12:56:17 WARN]: at
org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71)
[12:56:17 WARN]: at
org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53)
[12:56:17 WARN]: at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[12:56:17 WARN]: at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[12:56:17 WARN]: at java.lang.Thread.run(Thread.java:745)
[12:56:17 WARN]: Caused by:
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:
Duplicate entry '\xB5\xEE\x1F\x01\x89\xE2I)\xA3e\xE4\x03\x1B\x9AnK' for key
'player_bans_player_idx'
[12:56:17 WARN]: at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[12:56:17 WARN]: at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[12:56:17 WARN]: at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[12:56:17 WARN]: at
java.lang.reflect.Constructor.newInstance(Constructor.java:423)
[12:56:17 WARN]: at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
[12:56:17 WARN]: at com.mysql.jdbc.Util.getInstance(Util.java:382)
[12:56:17 WARN]: at
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1039)
[12:56:17 WARN]: at
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593)
[12:56:17 WARN]: at
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525)
[12:56:17 WARN]: at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986)
[12:56:17 WARN]: at
com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140)
[12:56:17 WARN]: at
com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2626)
[12:56:17 WARN]: at
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2111)
[12:56:17 WARN]: at
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2407)
[12:56:17 WARN]: at
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2325)
[12:56:17 WARN]: at
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2310)
[12:56:17 WARN]: at
me.confuser.banmanager.internal.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
[12:56:17 WARN]: at
me.confuser.banmanager.internal.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
[12:56:17 WARN]: at
me.confuser.banmanager.internal.ormlite.jdbc.JdbcDatabaseConnection.insert(JdbcDatabaseConnection.java:170)
[12:56:17 WARN]: at
me.confuser.banmanager.internal.ormlite.stmt.mapped.MappedCreate.insert(MappedCreate.java:91)
[12:56:17 WARN]: ... 9 more


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#569

commented

Not on the server but it's part of a BungeeCord network which is in online mode.

commented

Strange. Need some more details. Are you using the local or external database option to sync bans across multiple servers?

commented

Using the local database.

Sorry, I think this is my fault. PwnFilter matched on two different rules and tried to ban the player twice I think.

commented

That'd be an interesting concurrency use case to cover. Regardless of attempting to ban the player twice, it shouldn't result in an exception. You're running BanManager v5.9 correct?

commented

No I'm still on 5.8.

commented

@c0wg0d can you provide an example PwnFlter config that causes this? I'd like to try and reproduce this.

commented

You just need two rules that both match and don't abort after a ban. Here's an example that would match "apple" and "banana" and cause the error I reported if someone typed "apple banana" in chat.

match apple
then deny
then console bmban %player% You said '%rawstring%'

match banana
then deny
then console bmban %player% You said '%rawstring%'

commented

@c0wg0d By definition if you are using a bungeecord server, it is on offline mode.

commented

Can confirm the situation @sigmaroot describes.

[18:59:25] [Server thread/INFO]: Olaf issued server command: /ban aPlayer test
[18:59:25] [Craft Scheduler Thread - 248/WARN]: java.sql.SQLException: Unable to run insert stmt on object me.confuser.banmanager.data.PlayerBanData@217e48d0: INSERT INTO `bm_player_bans` (`player_id` ,`reason` ,`actor_id` ,`created` ,`updated` ,`expires` ) VALUES (?,?,?,?,?,?)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at me.confuser.banmanager.internal.ormlite.misc.SqlExceptionUtil.create(SqlExceptionUtil.java:22)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at me.confuser.banmanager.internal.ormlite.stmt.mapped.MappedCreate.insert(MappedCreate.java:135)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at me.confuser.banmanager.internal.ormlite.stmt.StatementExecutor.create(StatementExecutor.java:450)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at me.confuser.banmanager.internal.ormlite.dao.BaseDaoImpl.create(BaseDaoImpl.java:310)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at me.confuser.banmanager.storage.PlayerBanStorage.ban(PlayerBanStorage.java:185)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at me.confuser.banmanager.commands.BanCommand$1.run(BanCommand.java:136)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at java.lang.Thread.run(Thread.java:748)
[18:59:25] [Craft Scheduler Thread - 248/WARN]: Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '\xAA\xD6E\x1C\x0A/KZ\xA25\x88\xB3\x893\xB20' for key 'bm_player_bans_player_idx'
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at com.mysql.jdbc.Util.getInstance(Util.java:382)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1039)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2626)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2111)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2407)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2325)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2310)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at me.confuser.banmanager.internal.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at me.confuser.banmanager.internal.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at me.confuser.banmanager.internal.ormlite.jdbc.JdbcDatabaseConnection.insert(JdbcDatabaseConnection.java:170)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         at me.confuser.banmanager.internal.ormlite.stmt.mapped.MappedCreate.insert(MappedCreate.java:91)
[18:59:25] [Craft Scheduler Thread - 248/WARN]:         ... 9 more

When trying to unban the player BM responses that aPlayer is not banned.
Had to remove the entry from bm_player_bans manually.

BM 5.14.0

commented

I recently got a similar issue:
For privacy reasons I renamed all nicks, reasons and messages.
Basically two team mates issued a ban to a BadPlayer and eight/four seconds later the SQLException occurred. As the command seemed not to work for the team mates the issued the bans again (they did not know from each other that they were trying to perform the same ban command. However should not be important on normal function)

[17:57:21] [Server thread/INFO]: Teamate1 issued server command: /ban BadPlayer being Stupid
[17:57:25] [Server thread/INFO]: Teammate2 issued server command: /ban BadPlayer being Stupid
[...]
[17:57:29] [Craft Scheduler Thread - 325/WARN]: java.sql.SQLException: Unable to run insert stmt on object me.confuser.banmanager.data.PlayerBanData@1d1f10c3: INSERT INTO `bm_player_bans` (`player_id` ,`reason` ,`actor_id` ,`created` ,`updated` ,`expires` ) VALUES (?,?,?,?,?,?)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at me.confuser.banmanager.internal.ormlite.misc.SqlExceptionUtil.create(SqlExceptionUtil.java:22)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at me.confuser.banmanager.internal.ormlite.stmt.mapped.MappedCreate.insert(MappedCreate.java:135)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at me.confuser.banmanager.internal.ormlite.stmt.StatementExecutor.create(StatementExecutor.java:450)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at me.confuser.banmanager.internal.ormlite.dao.BaseDaoImpl.create(BaseDaoImpl.java:310)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at me.confuser.banmanager.storage.PlayerBanStorage.ban(PlayerBanStorage.java:185)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at me.confuser.banmanager.commands.BanCommand$1.run(BanCommand.java:136)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at java.lang.Thread.run(Thread.java:748)
[17:57:29] [Craft Scheduler Thread - 325/WARN]: Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '\xCEg]\xF3x\xA8@\x81\x98\x0D3\x02\x8B\x858\x13' for key 'bm_player_bans_player_idx'
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at com.mysql.jdbc.Util.getInstance(Util.java:382)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1039)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2626)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2111)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2407)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2325)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2310)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at me.confuser.banmanager.internal.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at me.confuser.banmanager.internal.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at me.confuser.banmanager.internal.ormlite.jdbc.JdbcDatabaseConnection.insert(JdbcDatabaseConnection.java:170)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         at me.confuser.banmanager.internal.ormlite.stmt.mapped.MappedCreate.insert(MappedCreate.java:91)
[17:57:29] [Craft Scheduler Thread - 325/WARN]:         ... 9 more
[17:57:29] [Craft Scheduler Thread - 327/INFO]: Badplayer has been banned!
[...]
[17:57:38] [Server thread/INFO]: Teammate1 issued server command: /ban Badplayer being stupid
[17:57:40] [Server thread/INFO]: Teammate2 issued server command: /ban Badplayer being stupid
[17:57:47] [Server thread/INFO]: Badplayer lost connection: §cYou have been banned!
[17:57:47] [Server thread/INFO]: [-]Badplayer 
[17:57:47] [Craft Scheduler Thread - 331/INFO]: Badplayer has been banned!
[17:57:47] [Craft Scheduler Thread - 330/WARN]: java.sql.SQLException: Unable to run insert stmt on object me.confuser.banmanager.data.PlayerBanData@6569c55b: INSERT INTO `bm_player_bans` (`player_id` ,`reason` ,`actor_id` ,`created` ,`updated` ,`expires` ) VALUES (?,?,?,?,?,?)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at me.confuser.banmanager.internal.ormlite.misc.SqlExceptionUtil.create(SqlExceptionUtil.java:22)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at me.confuser.banmanager.internal.ormlite.stmt.mapped.MappedCreate.insert(MappedCreate.java:135)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at me.confuser.banmanager.internal.ormlite.stmt.StatementExecutor.create(StatementExecutor.java:450)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at me.confuser.banmanager.internal.ormlite.dao.BaseDaoImpl.create(BaseDaoImpl.java:310)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at me.confuser.banmanager.storage.PlayerBanStorage.ban(PlayerBanStorage.java:185)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at me.confuser.banmanager.commands.BanCommand$1.run(BanCommand.java:136)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at java.lang.Thread.run(Thread.java:748)
[17:57:47] [Craft Scheduler Thread - 330/WARN]: Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '\xCEg]\xF3x\xA8@\x81\x98\x0D3\x02\x8B\x858\x13' for key 'bm_player_bans_player_idx'
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at com.mysql.jdbc.Util.getInstance(Util.java:382)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1039)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2626)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2111)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2407)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2325)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2310)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at me.confuser.banmanager.internal.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at me.confuser.banmanager.internal.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at me.confuser.banmanager.internal.ormlite.jdbc.JdbcDatabaseConnection.insert(JdbcDatabaseConnection.java:170)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         at me.confuser.banmanager.internal.ormlite.stmt.mapped.MappedCreate.insert(MappedCreate.java:91)
[17:57:47] [Craft Scheduler Thread - 330/WARN]:         ... 9 more
[17:57:47] [Server thread/WARN]: handleDisconnection() called twice
[...]
[17:57:51] [Server thread/INFO]: Teammate2 issued server command: /ban Badplayer being stupid
[17:58:14] [Craft Scheduler Thread - 330/INFO]: Badplayer has been banned!

The whole thing create quite a lag which caused about a dozen players connection loose.

MySQLd 5.7.18 itself did not log anything abnormal.

This was a one time occurrence for now in a long time using BM.

commented

Another one

>^M[23:44:53 INFO]: teammate1 issued server command: /ban badplayer being bad
>^M[23:44:53 INFO]: teammate2 issued server command: /ban badplayer being bad
>^M[23:44:53 INFO]: teammate1 issued server command: /ban badplayer being bad
>^M[23:44:53 WARN]: java.sql.SQLException: Unable to run insert stmt on object me.confuser.banmanager.data.PlayerBanData@185eda1c: INSERT INTO `bm_player_bans` (`player_id` ,`reason` ,`actor_id` ,`created` ,`updated` ,`expires` ) VALUES (?,?,?,?,?,?)
>^M[23:44:53 WARN]:     at me.confuser.banmanager.internal.ormlite.misc.SqlExceptionUtil.create(SqlExceptionUtil.java:22)
>^M[23:44:53 WARN]:     at me.confuser.banmanager.internal.ormlite.stmt.mapped.MappedCreate.insert(MappedCreate.java:135)
>^M[23:44:53 WARN]:     at me.confuser.banmanager.internal.ormlite.stmt.StatementExecutor.create(StatementExecutor.java:450)
>^M[23:44:53 WARN]:     at me.confuser.banmanager.internal.ormlite.dao.BaseDaoImpl.create(BaseDaoImpl.java:310)
>^M[23:44:53 WARN]:     at me.confuser.banmanager.storage.PlayerBanStorage.ban(PlayerBanStorage.java:185)
>^M[23:44:53 WARN]:     at me.confuser.banmanager.commands.BanCommand$1.run(BanCommand.java:136)
>^M[23:44:53 WARN]:     at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71)
>^M[23:44:53 WARN]:     at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53)
>^M[23:44:53 WARN]:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>^M[23:44:53 WARN]:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>^M[23:44:53 WARN]:     at java.lang.Thread.run(Thread.java:748)
>^M[23:44:53 WARN]: Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '\xDC\xD3R}.6LW\x93\xD3,\xF9_\xEA\xF0\xA5' for key 'bm_player_bans_player_idx'
>^M[23:44:53 WARN]:     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>^M[23:44:53 WARN]:     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>^M[23:44:53 WARN]:     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>^M[23:44:53 WARN]:     at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
>^M[23:44:53 WARN]:     at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
>^M[23:44:53 WARN]:     at com.mysql.jdbc.Util.getInstance(Util.java:382)
>^M[23:44:53 WARN]:     at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1039)
>^M[23:44:53 WARN]:     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593)
>^M[23:44:53 WARN]:     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525)
>^M[23:44:53 WARN]:     at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986)
>^M[23:44:53 WARN]:     at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140)
>^M[23:44:53 WARN]:     at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2626)
>^M[23:44:53 WARN]:     at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2111)
>^M[23:44:53 WARN]:     at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2407)
>^M[23:44:53 WARN]:     at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2325)
>^M[23:44:53 WARN]:     at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2310)
>^M[23:44:53 WARN]:     at me.confuser.banmanager.internal.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
>^M[23:44:53 WARN]:     at me.confuser.banmanager.internal.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
>^M[23:44:53 WARN]:     at me.confuser.banmanager.internal.ormlite.jdbc.JdbcDatabaseConnection.insert(JdbcDatabaseConnection.java:170)
>^M[23:44:53 WARN]:     at me.confuser.banmanager.internal.ormlite.stmt.mapped.MappedCreate.insert(MappedCreate.java:91)
>^M[23:44:53 WARN]:     ... 9 more
>^M[23:44:53 INFO]: BadPlayer has been banned!
>^M[23:44:53 WARN]: java.sql.SQLException: Unable to run insert stmt on object me.confuser.banmanager.data.PlayerBanData@2fdf5f4: INSERT INTO `bm_player_bans` (`player_id` ,`reason` ,`actor_id` ,`created` ,`updated` ,`expires` ) VALUES (?,?,?,?,?,?)
>^M[23:44:53 WARN]:     at me.confuser.banmanager.internal.ormlite.misc.SqlExceptionUtil.create(SqlExceptionUtil.java:22)
>^M[23:44:53 WARN]:     at me.confuser.banmanager.internal.ormlite.stmt.mapped.MappedCreate.insert(MappedCreate.java:135)
>^M[23:44:53 WARN]:     at me.confuser.banmanager.internal.ormlite.stmt.StatementExecutor.create(StatementExecutor.java:450)
>^M[23:44:53 WARN]:     at me.confuser.banmanager.internal.ormlite.dao.BaseDaoImpl.create(BaseDaoImpl.java:310)
>^M[23:44:53 WARN]:     at me.confuser.banmanager.storage.PlayerBanStorage.ban(PlayerBanStorage.java:185)
>^M[23:44:53 WARN]:     at me.confuser.banmanager.commands.BanCommand$1.run(BanCommand.java:136)
>^M[23:44:53 WARN]:     at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71)
>^M[23:44:53 WARN]:     at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53)
>^M[23:44:53 WARN]:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>^M[23:44:53 WARN]:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>^M[23:44:53 WARN]:     at java.lang.Thread.run(Thread.java:748)
>^M[23:44:53 WARN]: Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '\xDC\xD3R}.6LW\x93\xD3,\xF9_\xEA\xF0\xA5' for key 'bm_player_bans_player_idx'
>^M[23:44:53 WARN]:     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>^M[23:44:53 WARN]:     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>^M[23:44:53 WARN]:     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>^M[23:44:53 WARN]:     at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
>^M[23:44:53 WARN]:     at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
>^M[23:44:53 WARN]:     at com.mysql.jdbc.Util.getInstance(Util.java:382)
>^M[23:44:53 WARN]:     at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1039)
>^M[23:44:53 WARN]:     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593)
>^M[23:44:53 WARN]:     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525)
>^M[23:44:53 WARN]:     at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986)
>^M[23:44:53 WARN]:     at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140)
>^M[23:44:53 WARN]:     at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2626)
>^M[23:44:53 WARN]:     at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2111)
>^M[23:44:53 WARN]:     at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2407)
>^M[23:44:53 WARN]:     at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2325)
>^M[23:44:53 WARN]:     at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2310)
>^M[23:44:53 WARN]:     at me.confuser.banmanager.internal.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
>^M[23:44:53 WARN]:     at me.confuser.banmanager.internal.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
>^M[23:44:53 WARN]:     at me.confuser.banmanager.internal.ormlite.jdbc.JdbcDatabaseConnection.insert(JdbcDatabaseConnection.java:170)
>^M[23:44:53 WARN]:     at me.confuser.banmanager.internal.ormlite.stmt.mapped.MappedCreate.insert(MappedCreate.java:91)
>^M[23:44:53 WARN]:     ... 9 more

commented

This stuff is kind a reproducible if multiple team mates trying to punish the same player in a very short period of time.

commented

@EvilOlaf Unfortunately this can't be resolved until #712 is resolved, which will then require using transactions.

commented

Awesome.

commented

This can also happen if a banned player changes his nickname and try to connect to the server. The new name is applied within BM but if you try to change the ban time, this error occurs.

To reproduce:

  1. Ban a player
  2. That player has to change his nickname via mojang
  3. Player tries to login - denied!
  4. Try to change the ban time via /tempban newnickname 1d Test (for example)

Using oldnickname instead of newnickname does not work because BM doesn't know the old name anymore. Using the newnickname leads to the duplicate entry error above.

I don't know if it is enough to just print out a warning like your commit 966de82 does.

Oh and BTW: I guess if you restart the server between 3. and 4., this error doesn't occur, but I'm not sure.

A workaround for staff members is first to unban the old name and then ban the new name.