After upgrading Confluence shows 'Error occurred during template rendering. Contact your administrator for assistance' error
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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.
*Except Fisheye and Crucible
Summary
When trying to view content in Confluence Data Center, "Error occurred during template rendering. Contact your administrator for assistance." is displayed in the browser.
Solution
Environment
Confluence 8.1.x and later
Error message
The following ERROR appears in the <confluence-home>/
atlassian-confluence.log
:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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)
[...]
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 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)
[...]
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.
Check for duplicate table entries
Execute the below SQL query to get all the records related to the 'GLOBALDESCRIPTION
':
1
2
3
select *
from content
where contenttype = 'GLOBALDESCRIPTION';
Delete the duplicates
If we are affected by the described issue, we should see more than one record like below:
CONTENTID | CONTENTTYPE | TITLE | VERSION | CREATOR | CREATIONDATE | LASTMODIFIER | LASTMODDATE | VERSIONCOMMENT | PREVVER | CONTENT_STATUS | ... | HIBERNATEVERSION | LOWERTITLE |
131074 | GLOBALDESCRIPTION | Confluence | 1 | 19.08.2022 06:19:02 | 19.08.2022 06:19:02 | current | ... | 0 | confluence | ||||
1 | GLOBALDESCRIPTION | 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.
đź’ˇ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.
Always back up your data before making any database modifications. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.
Stop all Confluence nodes.
Backup Confluence database and filesystem.
Execute the below SQL query to delete the redundant '
GLOBALDESCRIPTION
':1
delete from content where contentid = 1;
Restart Confluence nodes.
Was this helpful?