-
Bug
-
Resolution: Fixed
-
Low
-
9.1.1, 9.2.3, 9.2.5, 9.2.6, 9.5.2
-
4
-
Severity 3 - Minor
-
41
-
Issue Summary
When a user accesses a page with a Label List macro (or accesses <base-url>/labels/listlabels-alphaview.action?key=SPACEKEY for a space), clicking on a label that has been added to an attachment results in an "Oops - an error has occurred" page. We can trigger this reliably by restarting Confluence or by clearing the cache via Cache Management.
This affects labels on all file types except PDF. If a label is added to both PDF and non-PDF attachments, the issue happens.
Steps to Reproduce
- Create a page and insert the Labels List macro to it.
- Attach at least 1 attachment of the following file types to the page:
- .jpeg/jpg
- .docx
- .pptx
- .png
- .txt
- .csv
PDF files aren't affected.
- Head to '...' > Attachments and add multiple labels to the attachment.
- Navigate to General Configuration > Cache Management and click on Flush All at the end of the page.
- Open the page that contains the Labels List macro.
- Click on any of the labels which were added to the attachment
Expected Results
It renders the Labeled content page.
Actual Results
System Error in the UI

The below exception is thrown in the atlassian-confluence.log file:
2025-07-15 15:49:20,440 ERROR [http-nio-8090-exec-9 url: /confluence/500page.jsp; user: admin] [atlassian.confluence.status.SystemErrorInformationLogger] logException Un handled exception, request unique ID: a6376418-9858-4fbf-996f-5e1794f9422a -- traceId: dd6f8c0f273ca5db org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getMediaType' in class com.atlassian.confluence.pages.Attachment threw exception org.hibe rnate.HibernateException: Unable to resolve owner of loading collection [[com.atlassian.confluence.core.ContentEntityObject.contentProperties#2850819]] for second level caching at /pages/includes/attachment_icon.vm[line 18, column 48] at org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java:228) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:262) at org.apache.velocity.runtime.parser.node.ASTReference.evaluate(ASTReference.java:470) at org.apache.velocity.runtime.parser.node.ASTOrNode.evaluate(ASTOrNode.java:105) at org.apache.velocity.runtime.parser.node.ASTExpression.evaluate(ASTExpression.java:62) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:85) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336) at org.apache.velocity.runtime.directive.Parse.render(Parse.java:263) Caused by: org.hibernate.HibernateException: Unable to resolve owner of loading collection [[com.atlassian.confluence.core.ContentEntityObject.contentProperties#2850819]] for second level caching at org.hibernate.engine.loading.internal.CollectionLoadContext.addCollectionToCache(CollectionLoadContext.java:360) at org.hibernate.engine.loading.internal.CollectionLoadContext.endLoadingCollection(CollectionLoadContext.java:299) at org.hibernate.engine.loading.internal.CollectionLoadContext.endLoadingCollections(CollectionLoadContext.java:224) at org.hibernate.engine.loading.internal.CollectionLoadContext.endLoadingCollections(CollectionLoadContext.java:198) at org.hibernate.loader.Loader.endCollectionLoad(Loader.java:1257) at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:1214) at org.hibernate.loader.Loader.processResultSet(Loader.java:1009) at org.hibernate.loader.Loader.doQuery(Loader.java:967) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:357) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:327) at org.hibernate.loader.Loader.loadCollection(Loader.java:2581) at org.hibernate.loader.collection.plan.LegacyBatchingCollectionInitializerBuilder$LegacyBatchingCollectionInitializer.initialize(LegacyBatchingCollectionInitializerBuilder.java:92)
Workaround
- Navigate to Space Tools > Content Tools > Attachments
- Filter by the label in question.
- This will display all the attachments associated with this label.
- If there are more than 20 attachments, click "Next" to check on the second page onwards until you reach the last page.
- Now, click on the label on the Label List Macro page, and it will work. However, it may reoccur.