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

The write format 2 is smaller than the supported format 3 [2.2.224/5] #3903

Closed
sergmain opened this issue Sep 28, 2023 · 2 comments
Closed

Comments

@sergmain
Copy link

After switching from SpringBoot 3.0 to 3.2 I've got the following error

Caused by: org.h2.mvstore.MVStoreException: The write format 2 is smaller than the supported format 3 [2.2.224/5]
	at org.h2.mvstore.DataUtils.newMVStoreException(DataUtils.java:996) ~[h2-2.2.224.jar:2.2.224]
	at org.h2.mvstore.FileStore.getUnsupportedWriteFormatException(FileStore.java:943) ~[h2-2.2.224.jar:2.2.224]
	at org.h2.mvstore.FileStore.processCommonHeaderAttributes(FileStore.java:547) ~[h2-2.2.224.jar:2.2.224]
	at org.h2.mvstore.RandomAccessStore.readStoreHeader(RandomAccessStore.java:227) ~[h2-2.2.224.jar:2.2.224]
	at org.h2.mvstore.FileStore.start(FileStore.java:916) ~[h2-2.2.224.jar:2.2.224]
	at org.h2.mvstore.MVStore.<init>(MVStore.java:289) ~[h2-2.2.224.jar:2.2.224]
	at org.h2.mvstore.MVStore$Builder.open(MVStore.java:2035) ~[h2-2.2.224.jar:2.2.224]
	at org.h2.mvstore.db.Store.<init>(Store.java:133) ~[h2-2.2.224.jar:2.2.224]
	... 35 common frames omitted

SpringBoot 3.0 is using h2 v2.1.214
SpringBoot 3.2 is using h2 v2.2.224

Do I understand it correctly - newest version of H2 can't read its own db files from previous minor version?

@andreitokar
Copy link
Contributor

Yes, you understand it correctly. The only supported upgrade path requires exporting you database as SQL script, using an old H2 version, then creating a new empty database using new H2 version and executing SQL script there. In many cases it might work without this (like upgrade from 2.2.222 -> 2.2.224), but this is not guaranteed, especially when format was explicitly changed. And that format check is there to prevent data corruption. You should go back and follow that recommended procedure.

@sergmain
Copy link
Author

  • PR Increase database format version #3834: Increase database format version
  • PR Disallow plain webAdminPassword values to force usage of hashes #3833: Disallow plain webAdminPassword values to force usage of hashes

    I see what you did here. Got it.

  • 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