MobHunting

MobHunting

114k Downloads

SQL DataStoreException

SharkROAR opened this issue ยท 7 comments

commented

Hey there,

I've been getting this Exception for a while now. Was hoping it would get fixed with some update, but it might be something on my end, after all.
Hope you can help me figure it out! ๐Ÿ™‚

Running 7.5.4

[23:28:07 WARN]: one.lindegaard.Core.storage.DataStoreException: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (mc-v_mobhunting.mh_Daily, CONSTRAINT mh_Daily_Player_Id FOREIGN KEY (PLAYER_ID) REFERENCES mh_Players (PLAYER_ID) ON DELETE CASCADE)
[23:28:07 WARN]: at one.lindegaard.MobHunting.storage.MySQLDataStore.savePlayerStats(MySQLDataStore.java:279)
[23:28:07 WARN]: at one.lindegaard.MobHunting.storage.asynch.StoreTask.run(StoreTask.java:39)
[23:28:07 WARN]: at one.lindegaard.MobHunting.storage.asynch.StoreTask.run(StoreTask.java:12)
[23:28:07 WARN]: at one.lindegaard.MobHunting.storage.DataStoreManager$TaskThread.run(DataStoreManager.java:334)
[23:28:07 WARN]: Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (mc-v_mobhunting.mh_Daily, CONSTRAINT mh_Daily_Player_Id FOREIGN KEY (PLAYER_ID) REFERENCES mh_Players (PLAYER_ID) ON DELETE CASCADE)
[23:28:07 WARN]: at jdk.internal.reflect.GeneratedConstructorAccessor169.newInstance(Unknown Source)
[23:28:07 WARN]: at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[23:28:07 WARN]: at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
[23:28:07 WARN]: at com.mysql.jdbc.Util.handleNewInstance(Util.java:403)
[23:28:07 WARN]: at com.mysql.jdbc.Util.getInstance(Util.java:386)
[23:28:07 WARN]: at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
[23:28:07 WARN]: at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3933)
[23:28:07 WARN]: at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3869)
[23:28:07 WARN]: at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
[23:28:07 WARN]: at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2675)
[23:28:07 WARN]: at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2465)
[23:28:07 WARN]: at com.mysql.jdbc.StatementImpl.executeUpdateInternal(StatementImpl.java:1536)
[23:28:07 WARN]: at com.mysql.jdbc.StatementImpl.executeLargeUpdate(StatementImpl.java:2585)
[23:28:07 WARN]: at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1464)
[23:28:07 WARN]: at one.lindegaard.MobHunting.storage.MySQLDataStore.savePlayerStats(MySQLDataStore.java:267)
[23:28:07 WARN]: ... 3 more

commented

Please test 7.5.7

commented

The contrains has given me some troubles over time, I might have dropped them on my own database, so I dont have to fight this.

I will make a snapshot which you can test. I should DROP the CONTRAINTS when the plugin is loaded.

commented

The contrains has given me some troubles over time, I might have dropped them on my own database, so I dont have to fight this.

I will make a snapshot which you can test. I should DROP the CONTRAINTS when the plugin is loaded.

Awesome, thanks!

commented

Hate to say, but the issue still exists in 7.5.7

https://pastebin.com/iDkSgMpT

commented

I'm not sure whether this is linked to the issue, but my players MobHunting Achievements keep getting reset and / or fail to be awarded even though conditions are met.

commented

Same here, the total kills count goes to 0 everytime that rejoin the game. Why we dont hire a developer to fix this? we pay all together and thats it.
Any solution share with me please https://www.spigotmc.org/members/espinete87.556847/

commented

i just posted on #702 - this is the same bug. On sqlite u wont even see an error in the logs, only with mysql.