System error while loading pages with attachments in Confluence 5.4.x or earlier versions
プラットフォームについて: Data Center - この記事は、Data Center プラットフォームのアトラシアン製品に適用されます。
このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
要約
Navigating to a page that has attachments triggers a "System Error" in the UI:
The following error appears on the page:
環境
Confluence server and Datacenter 5.4.x or earlier versions
診断
Search the <confluence-home>/logs/atlassian-confluence.log file for the error message in the UI. In the stack trace, we may find the following Caused By:
Caused by: net.sf.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of com.atlassian.confluence.pages.Attachment.minorEdit
at net.sf.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:57)
at net.sf.hibernate.persister.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:229)
at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:2239)
at net.sf.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:319)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:309)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:138)
at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:1020)
at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:995)
at net.sf.hibernate.loader.OneToManyLoader.initialize(OneToManyLoader.java:93)
at net.sf.hibernate.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:288)
at net.sf.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:3330)
at net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:195)
If we find the aforementioned error, run the following query, if it returns any records, you're affected by the issue reported in this KB:
SELECT * FROM ATTACHMENTS WHERE MINOR_EDIT IS NULL;
This KB doesn't apply to Confluence 5.5.x or later versions – Confluence 5.4.x or earlier versions had the option to store attachments in the database, this was configurable during Confluence installation. The Attachments table was created for this and was deprecated in Confluence 5.5.x. We no longer offer the option to store the attachments in the database in this version and newer.
Exception: If the attachments table still exists in Confluence 5.5.x or later versions, the recommended attachment migration from the database to the file system wasn't executed so we need to perform the migration.
原因
The root cause is unknown, however, there's a problem with attachment metadata and what Confluence expects. Specifically, there are records in the attachments
table that has a NULL
value in the MINOR_EDIT
column. Even though NULL
values are allowed, Confluence doesn't expect to find them and throws an error.
ソリューション
- データベースのバックアップを取得します。
Modify the records in the
attachments
table that returns aNULL
:UPDATE ATTACHMENTS SET MINOR_EDIT = '' WHERE MINOR_EDIT IS NULL;
- Flush the Confluence caches at Cache Management > Click on Show advanced view > Scroll all the way down and click on Flush all
- Rebuild the index through the UI, at the Content Indexing page
- Navigate to the problematic page(s)