H2 data hikaripool ereror

amaghu102 years ago

Please Help!

My database is not connecting. The logs is as shown below:


2022-02-11 16:27:27 ERROR: Main method error - Failed to initialize pool: File corrupted while reading record: null. Possible solution: use the recovery tool [90030-197] - PoolInitializationException (... < DataManager:139 < *:89 < Context:389 < Main:110 < ...)
2022-02-11 16:27:53  INFO: HikariPool-1 - Starting...
2022-02-11 16:27:54 ERROR: HikariPool-1 - Exception during pool initialization. - File corrupted while reading record: null. Possible solution: use the recovery tool [90030-197] - JdbcSQLException (... < DataManager:139 < *:89 < Context:389 < Main:110 < ...)
2022-02-11 16:27:54 ERROR: Main method error - Failed to initialize pool: File corrupted while reading record: null. Possible solution: use the recovery tool [90030-197] - PoolInitializationException (... < DataManager:139 < *:89 < Context:389 < Main:110 < ...)
2022-02-11 16:28:20  INFO: HikariPool-1 - Starting...
2022-02-11 16:28:20 ERROR: HikariPool-1 - Exception during pool initialization. - File corrupted while reading record: null. Possible solution: use the recovery tool [90030-197] - JdbcSQLException (... < DataManager:139 < *:89 < Context:389 < Main:110 < ...)
2022-02-11 16:28:20 ERROR: Main method error - Failed to initialize pool: File corrupted while reading record: null. Possible solution: use the recovery tool [90030-197] - PoolInitializationException (... < DataManager:139 < *:89 < Context:389 < Main:110 < ...)
2022-02-11 16:28:47  INFO: HikariPool-1 - Starting...
2022-02-11 16:28:47 ERROR: HikariPool-1 - Exception during pool initialization. - File corrupted while reading record: null. Possible solution: use the recovery tool [90030-197] - JdbcSQLException (... < DataManager:139 < *:89 < Context:389 < Main:110 < ...)
2022-02-11 16:28:47 ERROR: Main method error - Failed to initialize pool: File corrupted while reading record: null. Possible solution: use the recovery tool [90030-197] - PoolInitializationException (... < DataManager:139 < *:89 < Context:389 < Main:110 < ...)
2022-02-11 16:29:13  INFO: HikariPool-1 - Starting...
amaghu102 years ago
Caused by: java.lang.IllegalStateException: File corrupted in chunk 66740172, expected page length 4..768, got 775120481 [1.4.197/6]
        at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:870)
        at org.h2.mvstore.Page.read(Page.java:652)
        at org.h2.mvstore.Page.read(Page.java:186)
        at org.h2.mvstore.MVStore.readPage(MVStore.java:1936)
        at org.h2.mvstore.MVMap.readPage(MVMap.java:698)
        at org.h2.mvstore.Page.getChildPage(Page.java:208)
        at org.h2.mvstore.MVMap.binarySearch(MVMap.java:454)
        at org.h2.mvstore.MVMap.binarySearch(MVMap.java:455)
        at org.h2.mvstore.MVMap.binarySearch(MVMap.java:455)
        at org.h2.mvstore.MVMap.get(MVMap.java:436)
        at org.h2.mvstore.MVStore.getChunkIfFound(MVStore.java:924)
        at org.h2.mvstore.MVStore.getChunk(MVStore.java:901)
        at org.h2.mvstore.MVStore.readPage(MVStore.java:1927)
        at org.h2.mvstore.MVMap.readPage(MVMap.java:698)
        at org.h2.mvstore.Page.getChildPage(Page.java:208)
        at org.h2.mvstore.MVMap.binarySearch(MVMap.java:454)
        at org.h2.mvstore.MVMap.binarySearch(MVMap.java:455)
        at org.h2.mvstore.MVMap.get(MVMap.java:436)
        at org.h2.mvstore.MVStore.getChunkIfFound(MVStore.java:924)
        at org.h2.mvstore.MVStore.getChunk(MVStore.java:901)
        at org.h2.mvstore.MVStore.readPage(MVStore.java:1927)
        at org.h2.mvstore.MVMap.readPage(MVMap.java:698)
        at org.h2.mvstore.Page.getChildPage(Page.java:208)
        at org.h2.mvstore.Cursor.min(Cursor.java:129)
        at org.h2.mvstore.Cursor.hasNext(Cursor.java:36)
        at org.h2.mvstore.MVStore.loadChunkMeta(MVStore.java:683)
        at org.h2.mvstore.MVStore.readStoreHeader(MVStore.java:664)
        at org.h2.mvstore.MVStore.<init>(MVStore.java:361)
        at org.h2.mvstore.MVStore$Builder.open(MVStore.java:2934)
        at org.h2.mvstore.db.MVTableEngine$Store.open(MVTableEngine.java:155)
        ... 26 more

2022-02-11 16:46:06 ERROR: Main method error -
com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: File corrupted while reading record: null. Possible solution: use the recovery tool [90030-197]
        at com.zaxxer.hikari.pool.HikariPool.throwPoolInitializationException(HikariPool.java:597)
        at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:576)
        at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115)
        at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:81)
        at org.traccar.database.DataManager.initDatabase(DataManager.java:139)
        at org.traccar.database.DataManager.<init>(DataManager.java:89)
        at org.traccar.Context.init(Context.java:389)
        at org.traccar.Main.run(Main.java:110)
        at org.traccar.Main.main(Main.java:104)
Caused by: org.h2.jdbc.JdbcSQLException: File corrupted while reading record: null. Possible solution: use the recovery tool [90030-197]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:357)
        at org.h2.message.DbException.get(DbException.java:168)
        at org.h2.mvstore.db.MVTableEngine$Store.convertIllegalStateException(MVTableEngine.java:196)
        at org.h2.mvstore.db.MVTableEngine$Store.open(MVTableEngine.java:168)
        at org.h2.mvstore.db.MVTableEngine.init(MVTableEngine.java:100)
        at org.h2.engine.Database.getPageStore(Database.java:2538)
        at org.h2.engine.Database.open(Database.java:709)
        at org.h2.engine.Database.openDatabase(Database.java:286)
        at org.h2.engine.Database.<init>(Database.java:280)
        at org.h2.engine.Engine.openSession(Engine.java:66)
        at org.h2.engine.Engine.openSession(Engine.java:179)
        at org.h2.engine.Engine.createSessionAndValidate(Engine.java:157)
        at org.h2.engine.Engine.createSession(Engine.java:140)
        at org.h2.engine.Engine.createSession(Engine.java:28)
        at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:351)
        at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:124)
        at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:103)
        at org.h2.Driver.connect(Driver.java:69)
        at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138)
        at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:353)
        at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201)
        at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:473)
        at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:562)
        ... 7 more
Caused by: java.lang.IllegalStateException: File corrupted in chunk 66740172, expected page length 4..768, got 775120481 [1.4.197/6]
        at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:870)
        at org.h2.mvstore.Page.read(Page.java:652)
        at org.h2.mvstore.Page.read(Page.java:186)
        at org.h2.mvstore.MVStore.readPage(MVStore.java:1936)
        at org.h2.mvstore.MVMap.readPage(MVMap.java:698)
        at org.h2.mvstore.Page.getChildPage(Page.java:208)
        at org.h2.mvstore.MVMap.binarySearch(MVMap.java:454)
        at org.h2.mvstore.MVMap.binarySearch(MVMap.java:455)
        at org.h2.mvstore.MVMap.binarySearch(MVMap.java:455)
        at org.h2.mvstore.MVMap.get(MVMap.java:436)
        at org.h2.mvstore.MVStore.getChunkIfFound(MVStore.java:924)
        at org.h2.mvstore.MVStore.getChunk(MVStore.java:901)
        at org.h2.mvstore.MVStore.readPage(MVStore.java:1927)
        at org.h2.mvstore.MVMap.readPage(MVMap.java:698)
        at org.h2.mvstore.Page.getChildPage(Page.java:208)
        at org.h2.mvstore.MVMap.binarySearch(MVMap.java:454)
        at org.h2.mvstore.MVMap.binarySearch(MVMap.java:455)
        at org.h2.mvstore.MVMap.get(MVMap.java:436)
        at org.h2.mvstore.MVStore.getChunkIfFound(MVStore.java:924)
        at org.h2.mvstore.MVStore.getChunk(MVStore.java:901)
        at org.h2.mvstore.MVStore.readPage(MVStore.java:1927)
        at org.h2.mvstore.MVMap.readPage(MVMap.java:698)
        at org.h2.mvstore.Page.getChildPage(Page.java:208)
        at org.h2.mvstore.Cursor.min(Cursor.java:129)
        at org.h2.mvstore.Cursor.hasNext(Cursor.java:36)
        at org.h2.mvstore.MVStore.loadChunkMeta(MVStore.java:683)
        at org.h2.mvstore.MVStore.readStoreHeader(MVStore.java:664)
        at org.h2.mvstore.MVStore.<init>(MVStore.java:361)
        at org.h2.mvstore.MVStore$Builder.open(MVStore.java:2934)
        at org.h2.mvstore.db.MVTableEngine$Store.open(MVTableEngine.java:155)
Anton Tananaev2 years ago

Your database file is corrupted. That's exactly why I keep telling that you shouldn't use H2 for production.

You can try recovery tools from H2 website, but it's not guaranteed that you will be able to restore the data.

amaghu102 years ago

Wow...

I'm trying to use squirrelsql to gain access to the database but i'm unable to connect remotely to the server. Please help... most tutorials i see connect to localhost but I have traccar running on digital ocean vps

Anton Tananaev2 years ago

You won't be able to connect with squirrelsql because the database is corrupted.

You can try this:

http://www.h2database.com/html/advanced.html#using_recover_tool

amaghu102 years ago

Hi, It generated a text file after throwing some exception.

Exception in thread "main" java.nio.BufferUnderflowException
        at java.base/java.nio.Buffer.nextGetIndex(Buffer.java:643)
        at java.base/java.nio.HeapByteBuffer.get(HeapByteBuffer.java:165)
        at org.h2.mvstore.DataUtils.readString(DataUtils.java:311)
        at org.h2.mvstore.type.StringDataType.read(StringDataType.java:46)
        at org.h2.mvstore.MVStoreTool.dump(MVStoreTool.java:239)
        at org.h2.tools.Recover.process(Recover.java:346)
        at org.h2.tools.Recover.runTool(Recover.java:197)
        at org.h2.tools.Recover.main(Recover.java:160)
amaghu102 years ago

please, What do i do with the generated txt file?

Anton Tananaev2 years ago

I don't know the answer. We don't use H2 for anything other than local testing.