Error during database recover

77 views
Skip to first unread message

Olaf van der Meer

unread,
May 13, 2024, 5:51:07 AMMay 13
to H2 Database
Hi,

I am trying to repair a corrupt database, but the recover runs in an error:
Caused by: java.lang.NullPointerException
org.h2.mvstore.DataUtils.parseMap(DataUtils.java:804)
org.h2.mvstore.Chunk.<init>(Chunk.java:171)
org.h2.mvstore.SFChunk.<init>(SFChunk.java:26)
org.h2.mvstore.MVStoreTool.dump(MVStoreTool.java:151)
org.h2.tools.Recover.process(Recover.java:242)
org.h2.tools.Recover.execute(Recover.java:226)

I noticed someone else has report this too https://github.com/h2database/h2database/issues/4020

I have looked into the MvStoreTool.java and changed the try .. catch arround the line 151 to catch all exceptions:
                try {
                  c = new SFChunk(Chunk.readChunkHeader(buffer));
                //} catch (MVStoreException e) {
                } catch (Exception e) {
                    pos += blockSize;
                    continue;
                }

Now it can run further and the recover produces an h2.sql dump.
Is this a good fix for this issue?

I was also wondering where wondering where the mv.txt dump file is used for.
I only need the h2.sql dump to recover the database.


Olaf van der Meer

unread,
May 14, 2024, 6:18:53 AMMay 14
to H2 Database

Hi,

by throwing a MVStoreException in Chunk.readChunkHeader()


Still have this question: I was also wondering where the mv.txt dump file is used for. I only need the h2.sql dump to recover the database.

Does anyone has got know when a new release will be released, so we can use this patch? The last release is from Sept 2023?

Thanks for you reply in advance!

Olaf

Op maandag 13 mei 2024 om 11:51:07 UTC+2 schreef Olaf van der Meer:
Reply all
Reply to author
Forward
0 new messages