Confluence DB connection failed with H2 DB
プラットフォームについて: Data Center - この記事は、Data Center プラットフォームのアトラシアン製品に適用されます。
このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
要約
Confluence connection to the H2 database is failing.
環境
Confluence version 6.13.6
診断
Confluence application would not start and the below error can be seen under the application logs on the startup
2021-04-19 10:42:06,453 INFO [Catalina-utility-1] [com.atlassian.confluence.lifecycle] init Confluence is ready to serve
2021-04-19 10:42:06,485 WARN [C3P0PooledConnectionPoolManager[identityToken->z8kfsxag1siol3y1nsg187|7ecaf9a2]-HelperThread-#0] [mchange.v2.resourcepool.BasicResourcePool] log com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@10c7e87 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception:
org.h2.jdbc.JdbcSQLException: General error: "java.lang.IllegalStateException: File corrupted in chunk 4547007, expected page length 4..32, got 67 [1.4.196/6]" [50000-196]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:168)
at org.h2.message.DbException.convert(DbException.java:295)
at org.h2.engine.Database.openDatabase(Database.java:307)
at org.h2.engine.Database.<init>(Database.java:270)
at org.h2.engine.Engine.openSession(Engine.java:64)
at org.h2.engine.Engine.openSession(Engine.java:176)
at org.h2.engine.Engine.createSessionAndValidate(Engine.java:154)
at org.h2.engine.Engine.createSession(Engine.java:137)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:148)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: File corrupted in chunk 4547007, expected page length 4..32, got 67 [1.4.196/6]
at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:765)
at org.h2.mvstore.Page.read(Page.java:649)
at org.h2.mvstore.Page.read(Page.java:195)
at org.h2.mvstore.MVStore.readPage(MVStore.java:1952)
at org.h2.mvstore.MVMap.readPage(MVMap.java:741)
at org.h2.mvstore.MVMap.setRootPos(MVMap.java:751)
at org.h2.mvstore.MVStore.openMap(MVStore.java:476)
at org.h2.mvstore.db.TransactionStore.openMap(TransactionStore.java:393)
at org.h2.mvstore.db.TransactionStore$Transaction.openMap(TransactionStore.java:747)
at org.h2.mvstore.db.MVPrimaryIndex.<init>(MVPrimaryIndex.java:75)
at org.h2.mvstore.db.MVTable.init(MVTable.java:122)
at org.h2.mvstore.db.MVTableEngine.createTable(MVTableEngine.java:110)
at org.h2.mvstore.db.MVTableEngine.createTable(MVTableEngine.java:42)
at org.h2.schema.Schema.createTable(Schema.java:612)
at org.h2.command.ddl.CreateTable.update(CreateTable.java:139)
at org.h2.engine.MetaRecord.execute(MetaRecord.java:58)
at org.h2.engine.Database.open(Database.java:763)
at org.h2.engine.Database.openDatabase(Database.java:276)
原因
The above error indicates that the H2 DB file( present under <Confluence home dir>/database) got corrupted possibly due to abrupt shutdown or other reasons. The H2 Database is being shipped for testing purposes only as documented under Confluence-supported platforms and it's prone to corruption.
ソリューション
- If Confluence backup is available, create a new Confluence instance using the backup.
- If Confluence backup is not available, then you can try to recover from this corruption using the H2 Recover Tool.
- If the H2 recovery tool does not help, then you can try and download the latest H2 jar. Replace the H2 jar under <CONFLUENCE_INSTALL_DIR>/confluence/WEB-INF/lib and then check if the latest version of the H2 jar is able to recover from this corruption.