manticore-projects / H2MigrationTool

A software tool for migration of an old H2 database into a new H2 database format automatically.
https://manticore-projects.com/H2MigrationTool/index.html
GNU General Public License v3.0
33 stars 3 forks source link

No H2 driver found for requestion version h2-2.0.201 #21

Open maknon opened 2 months ago

maknon commented 2 months ago

Hi,

Im facing this issue

Exception in thread "main" java.lang.Exception: Failed to migrate the database.
        at com.manticore.h2.H2MigrationTool.main(H2MigrationTool.java:561)
Caused by: java.lang.Exception: No H2 driver found for requestion version 2.0.201
        at com.manticore.h2.H2MigrationTool.getDriverRecord(H2MigrationTool.java:429)
        at com.manticore.h2.H2MigrationTool.getDriverRecord(H2MigrationTool.java:647)
        at com.manticore.h2.H2MigrationTool.migrate(H2MigrationTool.java:807)
        at com.manticore.h2.H2MigrationTool.main(H2MigrationTool.java:551)
.\jdk\bin\java -Xmx16g -jar .\H2MigrationTool-1.8-SNAPSHOT-all.jar -l E:\build\db -f 2.0.201 -t 2.3.239 -d E:\build\ -c ZIP -o VARIABLE_BINARY --force
manticore-projects commented 2 months ago

Greetings,

can you briefly try the UI please?

maknon commented 2 months ago

i tried the UI first but it throws the following error:

WARNING: Failed to migrate E:\build\db\indexerDatabase.mv.db
java.lang.Exception: Failed to write H2-2.0.201 database to script
        at com.manticore.h2.H2MigrationTool.migrate(H2MigrationTool.java:850)
        at com.manticore.h2.H2MigrationUI$2$1.doInBackground(H2MigrationUI.java:364)
        at com.manticore.h2.H2MigrationUI$2$1.doInBackground(H2MigrationUI.java:302)
        at java.desktop/javax.swing.SwingWorker$1.call(SwingWorker.java:305)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
        at java.desktop/javax.swing.SwingWorker.run(SwingWorker.java:342)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: org.h2.jdbc.JdbcSQLNonTransientConnectionException: File corrupted while reading record: null. Possible solution: use the recovery tool [90030-201]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:677)
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:477)
        at org.h2.message.DbException.get(DbException.java:212)
        at org.h2.mvstore.db.Store.convertMVStoreException(Store.java:159)
        at org.h2.mvstore.db.Store.<init>(Store.java:140)
        at org.h2.engine.Database.createStore(Database.java:483)
        at org.h2.engine.Database.<init>(Database.java:344)
        at org.h2.engine.Engine.openSession(Engine.java:98)
        at org.h2.engine.Engine.openSession(Engine.java:228)
        at org.h2.engine.Engine.createSession(Engine.java:207)
        at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:338)
        at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:114)
        at org.h2.Driver.connect(Driver.java:59)
        at com.manticore.h2.H2MigrationTool.writeScript(H2MigrationTool.java:662)
        at com.manticore.h2.H2MigrationTool.migrate(H2MigrationTool.java:838)
        ... 8 more
Caused by: org.h2.mvstore.MVStoreException: File is corrupted - unable to recover a valid set of chunks [2.0.201/6]
        at org.h2.mvstore.DataUtils.newMVStoreException(DataUtils.java:1002)
        at org.h2.mvstore.MVStore.readStoreHeader(MVStore.java:1021)
        at org.h2.mvstore.MVStore.<init>(MVStore.java:453)
        at org.h2.mvstore.MVStore$Builder.open(MVStore.java:4066)
        at org.h2.mvstore.db.Store.<init>(Store.java:129)
        ... 18 more

so i tried to use the command line

the file is big, a round 5.5GB. but i have increased the memory to Xmx16g

manticore-projects commented 2 months ago

Greetings!

It's the other way around:

1) your H2 file is corrupted 2) for that reason the CLI version fails (but with a wrong, misguided error message, I have to fix this)

You can easily try creating a new fresh H2 database and confirm my suspicion.

You can try the Recovery Option also (but it never yielded in anything useful for me.)

maknon commented 2 months ago

the file is for sure not corrupted

I have tried to reduce the data using the old app. it is attached for your reference.

indexerDatabase.mv.zip

manticore-projects commented 2 months ago

Greetings!

I have tested your file, it is NOT opening with H2 2.0.201 ("Corrupted file"). However, when opening with H2 2.0.204 and after removing the standard password, everything worked.

manticore-projects commented 2 months ago

Version 2.0.202 also worked, only 2.0.201 is failing.

maknon commented 2 months ago

thanks for your support and quick responses. i tried your suggestion and things are ok now