Coreprotect database corrupted(?)

Discussion in 'Server & Community Management' started by ceruleanReverie, Aug 1, 2018.

  1. Hi, I was busy minding my own business on my server the other day when one of my mods told me coreprotect was broken, so I tried using /co i and sure enough nothing would come up... A quick look in the console revealed the following warnings:

    Code (Text):
    [07:54:11] [Thread-24/WARN]: java.sql.SQLException: Index co_block is corrupted
    [07:54:11] [Thread-24/WARN]:     at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965)
    [07:54:11] [Thread-24/WARN]:     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973)
    [07:54:11] [Thread-24/WARN]:     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)
    [07:54:11] [Thread-24/WARN]:     at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527)
    [07:54:11] [Thread-24/WARN]:     at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680)
    [07:54:11] [Thread-24/WARN]:     at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2480)
    [07:54:11] [Thread-24/WARN]:     at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2438)
    [07:54:11] [Thread-24/WARN]:     at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1381)
    [07:54:11] [Thread-24/WARN]:     at net.coreprotect.database.Lookup.who_placed(Lookup.java:2093)
    [07:54:11] [Thread-24/WARN]:     at net.coreprotect.consumer.Process.processStructureGrowth(Process.java:488)
    [07:54:11] [Thread-24/WARN]:     at net.coreprotect.consumer.Process.processConsumer(Process.java:127)
    [07:54:11] [Thread-24/WARN]:     at net.coreprotect.consumer.Consumer.run(Consumer.java:107)
    [07:54:11] [Thread-24/WARN]:     at java.lang.Thread.run(Thread.java:745)
    "Index co_block is corrupted". wtf? how did this happen?

    I thought maybe a restart would fix it, but nope. now my console is just getting spammed with this (presumably when anyone places/breaks blocks or interacts with the world at all):

    Code (Text):
    [15:03:59] [Thread-24/WARN]: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'db_7366.co_block' doesn't exist
    [15:03:59] [Thread-24/WARN]:     at sun.reflect.GeneratedConstructorAccessor357.newInstance(Unknown Source)
    [15:03:59] [Thread-24/WARN]:     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    [15:03:59] [Thread-24/WARN]:     at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    [15:03:59] [Thread-24/WARN]:     at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
    [15:03:59] [Thread-24/WARN]:     at com.mysql.jdbc.Util.getInstance(Util.java:408)
    [15:03:59] [Thread-24/WARN]:     at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:944)
    [15:03:59] [Thread-24/WARN]:     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973)
    [15:03:59] [Thread-24/WARN]:     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)
    [15:03:59] [Thread-24/WARN]:     at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527)
    [15:03:59] [Thread-24/WARN]:     at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680)
    [15:03:59] [Thread-24/WARN]:     at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2484)
    [15:03:59] [Thread-24/WARN]:     at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858)
    [15:03:59] [Thread-24/WARN]:     at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2079)
    [15:03:59] [Thread-24/WARN]:     at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2013)
    [15:03:59] [Thread-24/WARN]:     at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5104)
    [15:03:59] [Thread-24/WARN]:     at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1998)
    [15:03:59] [Thread-24/WARN]:     at net.coreprotect.database.Database.insertBlock(Database.java:206)
    [15:03:59] [Thread-24/WARN]:     at net.coreprotect.database.Logger.log_place(Logger.java:432)
    [15:03:59] [Thread-24/WARN]:     at net.coreprotect.consumer.Process.processBlockPlace(Process.java:252)
    [15:03:59] [Thread-24/WARN]:     at net.coreprotect.consumer.Process.processConsumer(Process.java:112)
    [15:03:59] [Thread-24/WARN]:     at net.coreprotect.consumer.Consumer.run(Consumer.java:107)
    [15:03:59] [Thread-24/WARN]:     at java.lang.Thread.run(Thread.java:745)
    "MySQLSyntaxErrorException: Table 'db_7366.co_block' doesn't exist". Apparently the database doesn't even exist anymore?

    Perplexed, I went into the myphp panel, and sure enough I get this whenever I try to click on co_block to see what's in it:
    [​IMG]

    So... what can I do about this? Is there anything I can do? I don't know anything about SQL. am I just screwed? do I just have to trash the old database and start over?
     
  2. md_5

    Administrator Developer

  3. Load up a backup of the table, or the whole database to make it easier.
    If youre not making any backups (or if the last one is too old for comfort), this is a nice lesson to learn to automate the process and do it frequently :)
     
  4. idk, it's possible. I'm using a shared host, and their "free mysql servers" they provide suck. they go down all the time for no reason. this particular issue hasn't been a problem before, though... I guess I'll try that out once my brain can figure out how to go about doing those commands properly, lol (i'm a total noob at anything with SQL...)

    I don't really have a good method of taking personal backups of the database, nor can I really do anything automated (see previous comment about using shared host). I'll send in a ticket to the provider to see if they can try loading a backup, though.
     
    • Agree Agree x 1
  5. So, my server provider is useless and won't respond to even "High priority" tickets.. even in 48 hours... :/

    Meanwhile, I'm getting another, different error now:
    Code (Text):

    [11:07:02] [Thread-24/WARN]: java.sql.SQLException: Got error -1 from storage engine
    [11:07:02] [Thread-24/WARN]:    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965)
    [11:07:02] [Thread-24/WARN]:    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973)
    [11:07:02] [Thread-24/WARN]:    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)
    [11:07:02] [Thread-24/WARN]:    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527)
    [11:07:02] [Thread-24/WARN]:    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680)
    [11:07:02] [Thread-24/WARN]:    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2484)
    [11:07:02] [Thread-24/WARN]:    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858)
    [11:07:02] [Thread-24/WARN]:    at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2079)
    [11:07:02] [Thread-24/WARN]:    at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2013)
    [11:07:02] [Thread-24/WARN]:    at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5104)
    [11:07:02] [Thread-24/WARN]:    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1998)
    [11:07:02] [Thread-24/WARN]:    at net.coreprotect.database.Database.insertEntity(Database.java:274)
    [11:07:02] [Thread-24/WARN]:    at net.coreprotect.database.Logger.log_entity_kill(Logger.java:327)
    [11:07:02] [Thread-24/WARN]:    at net.coreprotect.consumer.Process.processEntityKill(Process.java:310)
    [11:07:02] [Thread-24/WARN]:    at net.coreprotect.consumer.Process.processConsumer(Process.java:157)
    [11:07:02] [Thread-24/WARN]:    at net.coreprotect.consumer.Consumer.run(Consumer.java:107)
    [11:07:02] [Thread-24/WARN]:    at java.lang.Thread.run(Thread.java:745)
    [11:07:02] [Thread-24/WARN]: java.sql.SQLException: Illegal operation on empty result set.
    [11:07:02] [Thread-24/WARN]:    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965)
    [11:07:02] [Thread-24/WARN]:    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:898)
    [11:07:02] [Thread-24/WARN]:    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:887)
    [11:07:02] [Thread-24/WARN]:    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:861)
    [11:07:02] [Thread-24/WARN]:    at com.mysql.jdbc.ResultSetImpl.checkRowPos(ResultSetImpl.java:790)
    [11:07:02] [Thread-24/WARN]:    at com.mysql.jdbc.ResultSetImpl.getInt(ResultSetImpl.java:2475)
    [11:07:02] [Thread-24/WARN]:    at net.coreprotect.database.Logger.log_entity_kill(Logger.java:330)
    [11:07:02] [Thread-24/WARN]:    at net.coreprotect.consumer.Process.processEntityKill(Process.java:310)
    [11:07:02] [Thread-24/WARN]:    at net.coreprotect.consumer.Process.processConsumer(Process.java:157)
    [11:07:02] [Thread-24/WARN]:    at net.coreprotect.consumer.Consumer.run(Consumer.java:107)
    [11:07:02] [Thread-24/WARN]:    at java.lang.Thread.run(Thread.java:745)
     
    This keeps happening multiple times a second. It's really odd, because for whatever reason the database seems to have fixed itself(?). I can view the table fine from the phpmyadmin page, and coreprotect can log and lookup block changes from the database just fine. However, I still get these errors for seemingly no reason.

    Not sure what to do about it :/ at this point it's mostly just an annoyance because it floods the console, despite everything seemingly working just fine.
     
  6. electronicboy

    IRC Staff

    A quick google doesn't give a definitive answer, but apparently, a common cause for -1 from the storage engine is a case of the disk being full or some other disk related issue with the host
     
    • Informative Informative x 1
  7. How much are you paying on hosting and what do you need? Maybe it's time to make the smart move to a VPS or small dedi :p
    5 gigs is quite a lot of data IMO, sounds like a decent sized server?
     
  8. we just don't purge the database much, it's rather small. 5 gb isn't really too excessive, is it? :/ it used to be even more before we dropped some old data...
     
  9. Ive not ran anything in a long time, so I cant say for sure, but 5GB is quite a lot of data in general.
     
  10. I cleared my coreprotect data this morning and it was 17gb :LOL::LOL::ROFLMAO::ROFLMAO:
     
    • Agree Agree x 1
    • Winner Winner x 1
  11. Hot damn.
    Does coreprotect just save the entire world every 3 minutes nowadays or something? :p
     
  12. Nah just an alright playerbase where players build a lot
     
  13. Well I guess its time to switch hosting providers then. On the bright side at least I know nothing is wrong with my code XD
     
  14. Apparently the problem here is that Shockbyte decided to move the node the mysql server was on... without informing the paying customers at all? had to submit a ticket about this issue before I was finally told that the server was switched to another node. on top of that, all of the data that was there is now missing.

    So, I have a new problem now. All the old coreprotect data is gone now. I made a backup of it a week back, but I don't know how to restore it exactly. phpmyadmin has a tab for importing backups, however when I try to upload the backup it just tells me the file is too large. it seems uploads are limited to a measley 2 MB. I can't really restore a ~5 gb backup this way, if that's the case. What can I do? (already looking into switching hosts, but in the meantime I do need this fixed)
     
  15. Only 2 megs? That's not happening :p
    You could do some complicated shit with loading up the database somewhere and letting something copy it all over... but since youre looking at switching hosts, you could just host the database somewhere separately for a little bit?
     
    • Agree Agree x 1
  16. Shockbyte never responded to my tickets regarding the topic even after I had them escalated by the live chat. I switched to bisect hosting now and am having a much better time.
     
    • Like Like x 1
    • Winner Winner x 1
  17. hosting the db somewhere else is probably a good idea tbh. thanks for the help all
     
  18. If your server is in europe I can host it for you if you want? Got enough spare space and power on a vps, hmu on discord if you want.
     

Share This Page