[SQLITE_ERROR] SQL error or missing database (table co_skull has no column named skin)
MaoDoBan opened this issue ยท 3 comments
I have compiled the version from commit 888df06 on branch master.
I'm using paper build 2 for 1.21.1
I'm using a sqlite database from CoreProtect 22.3 used in paper 1.20.4 where on the co_skull table not have the skin column
[11:49:49 WARN]: org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (table co_skull has no column named skin)
[11:49:49 WARN]: at org.sqlite.core.DB.newSQLException(DB.java:1190)
[11:49:49 WARN]: at org.sqlite.core.DB.throwex(DB.java:1150)
[11:49:49 WARN]: at org.sqlite.jdbc3.JDBC3Connection.prepareStatement(JDBC3Connection.java:205)
[11:49:49 WARN]: at CoreProtect-23.jar//net.coreprotect.database.Database.prepareStatement(Database.java:294)
[11:49:49 WARN]: at org.sqlite.core.NativeDB.prepare_utf8(Native Method)
[11:49:49 WARN]: at org.sqlite.core.NativeDB.prepare(NativeDB.java:132)
[11:49:49 WARN]: at org.sqlite.core.DB.prepare(DB.java:264)
[11:49:49 WARN]: at org.sqlite.core.CorePreparedStatement.<init>(CorePreparedStatement.java:46)
[11:49:49 WARN]: at org.sqlite.jdbc3.JDBC3PreparedStatement.<init>(JDBC3PreparedStatement.java:32)
[11:49:49 WARN]: at org.sqlite.jdbc4.JDBC4PreparedStatement.<init>(JDBC4PreparedStatement.java:25)
[11:49:49 WARN]: at org.sqlite.jdbc4.JDBC4Connection.prepareStatement(JDBC4Connection.java:34)
[11:49:49 WARN]: at org.sqlite.jdbc3.JDBC3Connection.prepareStatement(JDBC3Connection.java:225)
[11:49:49 WARN]: at CoreProtect-23.jar//net.coreprotect.database.Database.prepareStatement(Database.java:245)
[11:49:49 WARN]: at CoreProtect-23.jar//net.coreprotect.consumer.process.Process.processConsumer(Process.java:112)
[11:49:49 WARN]: at CoreProtect-23.jar//net.coreprotect.consumer.Consumer.run(Consumer.java:133)
[11:49:49 WARN]: at java.base/java.lang.Thread.run(Thread.java:1583)
[11:49:49 WARN]: java.lang.NullPointerException: Cannot invoke "java.sql.PreparedStatement.executeBatch()" because "preparedStmtSkulls" is null
[11:49:49 WARN]: at CoreProtect-23.jar//net.coreprotect.consumer.process.Process.commit(Process.java:293)
[11:49:49 WARN]: at CoreProtect-23.jar//net.coreprotect.consumer.process.Process.processConsumer(Process.java:257)
[11:49:49 WARN]: at CoreProtect-23.jar//net.coreprotect.consumer.Consumer.run(Consumer.java:133)
[11:49:49 WARN]: at java.base/java.lang.Thread.run(Thread.java:1583)
[11:49:49 WARN]: java.lang.NullPointerException: Cannot invoke "java.sql.PreparedStatement.close()" because "preparedStmtSkulls" is null
[11:49:49 WARN]: at CoreProtect-23.jar//net.coreprotect.consumer.process.Process.processConsumer(Process.java:262)
[11:49:49 WARN]: at CoreProtect-23.jar//net.coreprotect.consumer.Consumer.run(Consumer.java:133)
[11:49:49 WARN]: at java.base/java.lang.Thread.run(Thread.java:1583)
When you build CoreProtect from the source it's missing some code to upgrade the database. You have to either have go find out how the patch system works. Or subscribe to the patreon to get early access build. Or just wait until CoreProtect update to get released
Can be resolved by running the appropriate query from here: https://github.com/PlayPro/CoreProtect/blob/master/src/main/java/net/coreprotect/patch/script/__2_23_1.java
NOTE: Backup first
DB Browser for SQLite v3.13.0
ALTER TABLE co_skull ADD COLUMN skin TEXT;
If there are still plenty of database error, I'm not sure, but I'm going to grab a spigot 1.20.6 server with CoreProtect-22.4, put my unmodified old database in and boot once, later shutdown server, manually run the above SQL command to see if I can migrate.
Update: It worked.