Download H2 1.4.196 and try to do a record of the database with that by running
java -cp h2-1.4.196.jar org.h2.tools.Recover from the same directory as a copy of the database file. For me this works in 90% of all cases. If it does not and an exception is thrown then you are out of luck. Otherwise do mv database.mv.db database.mv.db.backup java -cp h2-1.4.196.jar org.h2.tools.RunScript -url jdbc:h2:./database -script database.h2.sql This should give you a readable version of the database. Assuming you are on Linux or similar. Otherwise do some Windows-equivalent of this. The reason this usually works is a bit unclear to me. It seems like 197 and later do some extra validation or throw an exception on an error state that was ignored before. Therefore the same process will usually not work with newer H2 versions. I have never had issues using the resulting 196-created database with 199 or 200. Silvio On Monday, 3 January 2022 at 11:07:22 UTC+1 [email protected] wrote: > Hi, > > > > We are using Atlassian bamboo tool for build management and using embedded > database. > > We are getting below error while running the bamboo, looks like the > database is corrupted. > > > > *Logs:* > > IllegalStateException: Reading from nio:/srv/bamboo-home/database/h2.mv.db > failed; file length 255352832 read length 2048 at 266538251 [1.4.199/1] > > > > > > Can you please help here to recover it. > -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/h2-database/3dd75a0d-7cea-467d-b523-fb08ba83be82n%40googlegroups.com.
