Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mysql Update #105

Closed
Naghtrion opened this issue Dec 1, 2016 · 2 comments
Closed

Mysql Update #105

Naghtrion opened this issue Dec 1, 2016 · 2 comments

Comments

@Naghtrion
Copy link

01.12 15:41:11 [Server] WARN one.lindegaard.MobHunting.storage.DataStoreException: java.sql.BatchUpdateException: Cannot add or update a child row: a foreign key constraint fails (mc_151.mh_Daily, CONSTRAINT mh_Daily_Player_Id FOREIGN KEY (PLAYER_ID) REFERENCES mh_PlayersV2 (PLAYER_ID) ON DELETE CASCADE)
01.12 15:41:11 [Server] WARN at one.lindegaard.MobHunting.storage.MySQLDataStore.savePlayerStats(MySQLDataStore.java:260)
01.12 15:41:11 [Server] WARN at one.lindegaard.MobHunting.storage.asynch.StoreTask.run(StoreTask.java:47)
01.12 15:41:11 [Server] WARN at one.lindegaard.MobHunting.storage.asynch.StoreTask.run(StoreTask.java:13)
01.12 15:41:11 [Server] WARN at one.lindegaard.MobHunting.storage.DataStoreManager$TaskThread.run(DataStoreManager.java:432)
01.12 15:41:11 [Server] WARN Caused by: java.sql.BatchUpdateException: Cannot add or update a child row: a foreign key constraint fails (mc_151.mh_Daily, CONSTRAINT mh_Daily_Player_Id FOREIGN KEY (PLAYER_ID) REFERENCES mh_PlayersV2 (PLAYER_ID) ON DELETE CASCADE)
01.12 15:41:11 [Server] WARN at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
01.12 15:41:11 [Server] WARN at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
01.12 15:41:11 [Server] WARN at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
01.12 15:41:11 [Server] WARN at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
01.12 15:41:11 [Server] WARN at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)
01.12 15:41:11 [Server] WARN at com.mysql.jdbc.Util.getInstance(Util.java:387)
01.12 15:41:11 [Server] WARN at com.mysql.jdbc.SQLError.createBatchUpdateException(SQLError.java:1161)
01.12 15:41:11 [Server] WARN at com.mysql.jdbc.StatementImpl.executeBatchInternal(StatementImpl.java:1048)
01.12 15:41:11 [Server] WARN at com.mysql.jdbc.StatementImpl.executeBatch(StatementImpl.java:958)
01.12 15:41:11 [Server] WARN at one.lindegaard.MobHunting.storage.MySQLDataStore.savePlayerStats(MySQLDataStore.java:253)
01.12 15:41:11 [Server] WARN ... 3 more
01.12 15:41:11 [Server] WARN Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (mc_151.mh_Daily, CONSTRAINT mh_Daily_Player_Id FOREIGN KEY (PLAYER_ID) REFERENCES mh_PlayersV2 (PLAYER_ID) ON DELETE CASCADE)
01.12 15:41:11 [Server] WARN at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
01.12 15:41:11 [Server] WARN at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
01.12 15:41:11 [Server] WARN at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
01.12 15:41:11 [Server] WARN at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
01.12 15:41:11 [Server] WARN at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)
01.12 15:41:11 [Server] WARN at com.mysql.jdbc.Util.getInstance(Util.java:387)
01.12 15:41:11 [Server] WARN at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:934)
01.12 15:41:11 [Server] WARN at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3966)
01.12 15:41:11 [Server] WARN at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3902)
01.12 15:41:11 [Server] WARN at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2526)
01.12 15:41:11 [Server] WARN at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2673)
01.12 15:41:11 [Server] WARN at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545)
01.12 15:46:03 [Multicraft] Auto-saving world...
01.12 15:46:03 [Multicraft] Skipped 3 lines due to rate limit (30/s)
01.12 15:46:03 [Server] INFO Saving is already turned on
01.12 15:46:03 [Server] INFO Saving...
01.12 15:46:03 [Server] INFO Saved the world
01.12 15:46:11 [Server] WARN one.lindegaard.MobHunting.storage.DataStoreException: java.sql.BatchUpdateException: Cannot add or update a child row: a foreign key constraint fails (mc_151.mh_Daily, CONSTRAINT mh_Daily_Player_Id FOREIGN KEY (PLAYER_ID) REFERENCES mh_PlayersV2 (PLAYER_ID) ON DELETE CASCADE)
01.12 15:46:11 [Server] WARN at one.lindegaard.MobHunting.storage.MySQLDataStore.savePlayerStats(MySQLDataStore.java:260)
01.12 15:46:11 [Server] WARN at one.lindegaard.MobHunting.storage.asynch.StoreTask.run(StoreTask.java:47)
01.12 15:46:11 [Server] WARN at one.lindegaard.MobHunting.storage.asynch.StoreTask.run(StoreTask.java:13)
01.12 15:46:11 [Server] WARN at one.lindegaard.MobHunting.storage.DataStoreManager$TaskThread.run(DataStoreManager.java:432)
01.12 15:46:11 [Server] WARN Caused by: java.sql.BatchUpdateException: Cannot add or update a child row: a foreign key constraint fails (mc_151.mh_Daily, CONSTRAINT mh_Daily_Player_Id FOREIGN KEY (PLAYER_ID) REFERENCES mh_PlayersV2 (PLAYER_ID) ON DELETE CASCADE)
01.12 15:46:11 [Server] WARN at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
01.12 15:46:11 [Server] WARN at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
01.12 15:46:11 [Server] WARN at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
01.12 15:46:11 [Server] WARN at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
01.12 15:46:11 [Server] WARN at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)
01.12 15:46:11 [Server] WARN at com.mysql.jdbc.Util.getInstance(Util.java:387)
01.12 15:46:11 [Server] WARN at com.mysql.jdbc.SQLError.createBatchUpdateException(SQLError.java:1161)
01.12 15:46:11 [Server] WARN at com.mysql.jdbc.StatementImpl.executeBatchInternal(StatementImpl.java:1048)
01.12 15:46:11 [Server] WARN at com.mysql.jdbc.StatementImpl.executeBatch(StatementImpl.java:958)
01.12 15:46:11 [Server] WARN at one.lindegaard.MobHunting.storage.MySQLDataStore.savePlayerStats(MySQLDataStore.java:253)
01.12 15:46:11 [Server] WARN ... 3 more
01.12 15:46:11 [Server] WARN Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (mc_151.mh_Daily, CONSTRAINT mh_Daily_Player_Id FOREIGN KEY (PLAYER_ID) REFERENCES mh_PlayersV2 (PLAYER_ID) ON DELETE CASCADE)
01.12 15:46:11 [Server] WARN at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
01.12 15:46:11 [Server] WARN at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
01.12 15:46:11 [Server] WARN at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
01.12 15:46:11 [Server] WARN at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
01.12 15:46:11 [Server] WARN at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)
01.12 15:46:11 [Server] WARN at com.mysql.jdbc.Util.getInstance(Util.java:387)
01.12 15:46:11 [Server] WARN at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:934)
01.12 15:46:11 [Server] WARN at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3966)
01.12 15:46:11 [Server] WARN at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3902)
01.12 15:46:11 [Server] WARN at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2526)
01.12 15:46:11 [Server] WARN at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2673)
01.12 15:46:11 [Server] WARN at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545

@Rocologo
Copy link
Owner

Rocologo commented Dec 1, 2016

Something in the datamigration has failed. I can see that there is references to mh_PlayersV2 which is an error. The CONSTRAINS need to be dropped.

  1. If you know SQL you can do it yourself.
  2. If you dont have many data in the MobHunting database you can drop all the mh_ * tables and restart the server. This way the constrains will be fixed.
  3. I can make a /mh command for you where you can execute the drop CONSTRAINS command and hopefully fix this error. It might take me a few days to make the command for you.

@Naghtrion
Copy link
Author

Olá, estava testando quando deu esse erro.. ja apaguei as tabelas.. mas achei importante reportar este erro pelo fato de poder ocorrer com outras pessoas

Hello, I was testing when I gave this error .. I deleted the tables .. but I found it important to report this error because it could happen with other people
By Google translate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants