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:

ここをクリックして展開...
Cause
java.lang.RuntimeException: Error rendering template for decorator root
    at com.atlassian.confluence.setup.velocity.ApplyDecoratorDirective.render(ApplyDecoratorDirective.java:191)
caused by: java.lang.RuntimeException: Error rendering template for decorator page
    at com.atlassian.confluence.setup.velocity.ApplyDecoratorDirective.render(ApplyDecoratorDirective.java:191)
caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getDisplayableLabel' in class com.atlassian.confluence.plugin.descriptor.web.model.ConfluenceWebLabel threw exception com.atlassian.core.exception.InfrastructureException: Error occurred rendering template content at template/includes/menu-macros.vm[line 281, column 36]
    at org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:337)
caused by: com.atlassian.core.exception.InfrastructureException: Error occurred rendering template content
    at com.atlassian.confluence.util.velocity.VelocityUtils.writeRenderedContent(VelocityUtils.java:187)
caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getLatestVersionsOfAttachments' in class com.atlassian.confluence.pages.Page$$EnhancerByCGLIB$$b6314f3d threw exception net.sf.hibernate.LazyInitializationException: cannot access loading collection at getRenderedContent[line 1, column 15]
    at org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:337)
caused by: net.sf.hibernate.LazyInitializationException: cannot access loading collection
    at net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:191)
Stack Trace:[hide]
java.lang.RuntimeException: Error rendering template for decorator root
	at com.atlassian.confluence.setup.velocity.ApplyDecoratorDirective.render(ApplyDecoratorDirective.java:191)
	at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
....
Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getLatestVersionsOfAttachments' in  class com.atlassian.confluence.pages.Page$$EnhancerByCGLIB$$b6314f3d threw exception net.sf.hibernate.LazyInitializationException: cannot access loading collection at getRenderedContent[line 1, column 15]
	at org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:337)
	at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:284)
	at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:262)
	at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:342)
	at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
	at org.apache.velocity.runtime.RuntimeInstance.render(RuntimeInstance.java:1277)
	at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1216)
	at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1165)
	at org.apache.velocity.app.VelocityEngine.evaluate(VelocityEngine.java:219)
	at com.atlassian.confluence.util.velocity.VelocityUtils.writeRenderedContent(VelocityUtils.java:179)
	... 483 more
Caused by: net.sf.hibernate.LazyInitializationException: cannot access loading collection
	at net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:191)
	at net.sf.hibernate.collection.PersistentCollection.read(PersistentCollection.java:71)
	at net.sf.hibernate.collection.Bag.iterator(Bag.java:256)
	at com.atlassian.confluence.core.ContentEntityObject.getLatestVersionsOfAttachments(ContentEntityObject.java:614)
	at com.atlassian.confluence.core.ContentEntityObject$$FastClassByCGLIB$$96df24d5.invoke(<generated>)
	at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
	at net.sf.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:108)
	at com.atlassian.confluence.pages.Page$$EnhancerByCGLIB$$b6314f3d.getLatestVersionsOfAttachments(<generated>)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:389)
	at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:378)
	at com.atlassian.confluence.velocity.introspection.UnboxingMethod.invoke(UnboxingMethod.java:34)
	at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:270)
	... 491 more

環境

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;

(info) 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. 

(warning) 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. 

ソリューション

  1. データベースのバックアップを取得します。
  2. Modify the records in the attachments table that returns a NULL:

    UPDATE ATTACHMENTS
    SET MINOR_EDIT = ''
    WHERE MINOR_EDIT IS NULL;
  3. Flush the Confluence caches at Cache Management > Click on Show advanced view > Scroll all the way down and click on Flush all
  4. Rebuild the index through the UI, at the Content Indexing page
  5. Navigate to the problematic page(s) 


最終更新日 2020 年 11 月 12 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.