Ban Management

Ban Management

193k Downloads

Duplicate Entry

rawrlehel opened this issue · 6 comments

commented

When trying to apply any action to certain players, this error comes up:

[18:11:58] [Craft Scheduler Thread - 4004/INFO]: [BanManager] Requesting UUIDs for rawrlehel
[18:11:58] [Craft Scheduler Thread - 4004/WARN]: java.sql.SQLException: Unable to run insert stmt on object me.confuser.banmanager.data.PlayerData@5303a4f3: INSERT INTO `bm_players` (`id` ,`name` ,`ip` ,`lastSeen` ) VALUES (?,?,?,?)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    at me.confuser.banmanager.internal.ormlite.misc.SqlExceptionUtil.create(SqlExceptionUtil.java:22)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    at me.confuser.banmanager.internal.ormlite.stmt.mapped.MappedCreate.insert(MappedCreate.java:135)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    at me.confuser.banmanager.internal.ormlite.stmt.StatementExecutor.create(StatementExecutor.java:450)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    at me.confuser.banmanager.internal.ormlite.dao.BaseDaoImpl.create(BaseDaoImpl.java:310)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    at me.confuser.banmanager.storage.PlayerStorage.retrieve(PlayerStorage.java:163)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    at me.confuser.banmanager.commands.WarnCommand$1.run(WarnCommand.java:88)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    at java.lang.Thread.run(Thread.java:745)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]: Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '5*i¿6�2ešðŽb��U¢' for key 'PRIMARY'
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    at com.mysql.jdbc.Util.getInstance(Util.java:382)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1039)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2626)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2111)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2407)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2325)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2310)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    at me.confuser.banmanager.internal.ormlite.jdbc.JdbcDatabaseConnection.insert(JdbcDatabaseConnection.java:170)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    at me.confuser.banmanager.internal.ormlite.stmt.mapped.MappedCreate.insert(MappedCreate.java:91)
[18:11:58] [Craft Scheduler Thread - 4004/WARN]:    ... 9 more

Using latest Spigot and Banmanager.

commented

What is "latest" for you? Latest official? Latest dev build?
Do you bungee or offlinemode? #272

commented

Ensure you try a developer build

http://ci.frostcast.net

commented

If you are running behind bungeecord in online mode, then BanManager should have onlineMode set to true.

commented

Bungeecord is running in online mode, however all servers behind bungee are in offline mode. Should onlineMode in BM be set to true then?

commented

Yes, it should be in online mode, otherwise all the UUIDs will be generated as offline players. You will need to clear your current bans and players table unfortunately, as all the UUIDs will be incorrect.

commented

Thanks for clearing that up. I think it would be possible to convert my old tables (v4) using true onlinemode to uuid (v5) as they are still there and not much has changed since.