Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-100297

The Labelled Content page for a label tied to attachments are not rendered after a cache flush/system restart

XMLWordPrintable

      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

      1. Create a page and insert the Labels List macro to it.
      2. 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.
      3. Head to '...' > Attachments and add multiple labels to the attachment.
      4. Navigate to General Configuration > Cache Management and click on Flush All at the end of the page.
      5. Open the page that contains the Labels List macro.
      6. 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

      1. Navigate to Space Tools > Content Tools > Attachments
      2. Filter by the label in question.
      3. This will display all the attachments associated with this label. 
      4. If there are more than 20 attachments, click "Next" to check on the second page onwards until you reach the last page.
      5. Now, click on the label on the Label List Macro page, and it will work. However, it may reoccur.

              5339cdd01cf4 Jeffery Xie
              aad60ff3f193 Bibek Roy
              Votes:
              4 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated:
                Resolved: