After upgrading Confluence shows "Error occurred during template rendering. Contact your administrator for assistance" error

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問


プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

要約

When trying to reach out to Confluence, the "Error occurred during template rendering. Contact your administrator for assistance." is displayed in the browser:

環境

Confluence 8.1.x and later

診断

<confluence-home>/atlassian-confluence.log ログに次のエラーが表示される。

2023-08-21 14:56:46,139 ERROR [http-nio-27196-exec-7] [confluence.util.profiling.ConfluenceSitemeshDecorator] renderToResponse Error occurred rendering template: /decorators/login.vmd
 -- url: /c7196/login.action | userName: anonymous | traceId: 41cf7fa8202f282a
org.apache.velocity.exception.MethodInvocationException: Invocation of method 'isUsesCustomLogo' in  class com.atlassian.confluence.plugins.lookandfeel.SiteLogoVelocityHelper threw exception com.atlassian.cache.CacheException: org.hibernate.NonUniqueResultException: query did not return a unique result: 2 at /decorators/includes/common-header.vm[line 23, column 22]
	at org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java:228)
    [...]
	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: com.atlassian.cache.CacheException: org.hibernate.NonUniqueResultException: query did not return a unique result: 2
	at com.atlassian.cache.ehcache.DelegatingCachedReference.get(DelegatingCachedReference.java:75)
	at com.atlassian.cache.impl.metrics.InstrumentedCachedReference.get(InstrumentedCachedReference.java:58)
	at com.atlassian.confluence.plugins.lookandfeel.AttachmentSiteLogoManager.useCustomLogo(AttachmentSiteLogoManager.java:122)
	at com.atlassian.confluence.plugins.lookandfeel.SiteLogoVelocityHelper.isUsesCustomLogo(SiteLogoVelocityHelper.java:18)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.apache.velocity.runtime.parser.node.PropertyExecutor.execute(PropertyExecutor.java:142)
	at org.apache.velocity.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectImpl.java:529)
	at org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java:198)
	... 280 more
Caused by: org.hibernate.NonUniqueResultException: query did not return a unique result: 2
	at com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDao.uniqueResult(HibernateObjectDao.java:587)
	at com.atlassian.confluence.setup.settings.DefaultGlobalDescriptionDao.getGlobalDescription(DefaultGlobalDescriptionDao.java:20)
	at com.atlassian.confluence.impl.settings.DefaultGlobalDescriptionManager.getGlobalDescription(DefaultGlobalDescriptionManager.java:92)
	at com.atlassian.confluence.impl.settings.DelegatingLegacySettingsManager.getGlobalDescription(DelegatingLegacySettingsManager.java:67)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	[...]
	at com.sun.proxy.$Proxy1369.getGlobalDescription(Unknown Source)
	at com.atlassian.confluence.plugins.lookandfeel.AttachmentSiteLogoManager.attachmentTargetEntity(AttachmentSiteLogoManager.java:169)
	at com.atlassian.confluence.plugins.lookandfeel.AttachmentSiteLogoManager.customLogoAttachment(AttachmentSiteLogoManager.java:126)
	at com.atlassian.confluence.plugins.lookandfeel.AttachmentSiteLogoManager.lambda$new$0(AttachmentSiteLogoManager.java:80)
	[...]


原因

Based on the Java methods that can be seen in the stacktrace (com.atlassian.confluence.setup.settings.DefaultGlobalDescriptionDao.getGlobalDescription), there are multiple records for 'GLOBALDESCRIPTION' in the CONTENT the table where Confluence expected a unique result.


ソリューション

  • Execute the below SQL query to get all the records related to the 'GLOBALDESCRIPTION':

    select *
    from content
    where contenttype = 'GLOBALDESCRIPTION';
  • If we are affected by the described issue, we should see more than one record like below:

    CONTENTIDCONTENTTYPEタイトルVERSIONCREATORCreation DateLASTMODIFIERLASTMODDATEVERSIONCOMMENTPREVVERCONTENT_STATUS...HIBERNATEVERSIONLOWERTITLE
    131074GLOBALDESCRIPTIONConfluence1
    19.08.2022 06:19:02
    19.08.2022 06:19:02

    current...0confluence
    1GLOBALDESCRIPTION
    1
    10.12.2022 11:40:13
    10.12.2022 11:40:13

    current...0
  • We need to delete one of the records. Based on the values in CONTENTID column, in the above example, the latter one(CONTENTID=1), looks more 'suspicious' as we know that ID is generated randomly, and it does not look like an ID that we generally see. 
    (lightbulb)Note: The records can appear indistinct(literally the same contents). In this case attempting to delete one of the records will either result in a deleted row, or will return a foreign key constraint error; if a record is not deleted, a foreign key constraint violation returned, purge the other. Our ultimate goal is to remove the extraneous GLOBALDESCRIPTION. This has not resulted in reports of loss of data.

    データベースの変更を行う場合は必ず事前にバックアップを取得してください。可能な場合は、まずステージング サーバーで SQL コマンドの変更、挿入、更新、または削除を行うようにします。


    • Confluence を停止します。
    • Backup Confluence database and filesystem.
    • Execute the below SQL query to delete the redundant 'GLOBALDESCRIPTION':

      delete from content where contentid = 1;
    • Confluence を再起動します。 


最終更新日: 2024 年 2 月 21 日

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

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