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

HTTP 500 after calling getMediaType method for attachment (Attachment Checker Plugin)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • None
    • 9.2.6
    • Content - Attachments
    • None

      Problem

      Confluence returns HTTP 500 while calling the below method in the background. This error is experienced when some third-party plugins use this method to download attachments:

      attachmentType = attachmentObj.getMediaType();
      

      This appears to be a a regression of the issue explained in: https://jira.atlassian.com/browse/CONFSERVER-96521

      Environment

      Confluence 9.2.6
      3rd party Plugin version: 1.38.0

       <key>com.akelesconsulting.confluence.plugins.AttachmentChecker4CONF</key>
            <name>Attachment Checker for Confluence</name>
            <version>1.38.0</version>
            <vendor>Akeles Consulting Pte Ltd</vendor>
      

      Steps to Reproduce

      Use third party plugins such as: Attachment Checker for Confluence to download attachments and users will encounter the following error intermittently:

      2025-09-22 12:48:37,271 WARN [https-jsse-nio2-8443-exec-26 url: /download/attachments/1633151470/test_presentation.pptx; user: T0215164] [engine.loading.internal.LoadContexts] cleanup HHH000100: Fail-safe cleanup (collections) : org.hibernate.engine.loading.internal.CollectionLoadContext@1e63202c<rs=HikariProxyResultSet@1458742556 wrapping SQLServerResultSet:30155424>
           -- url: /download/attachments/1633151470/test_presentation.pptx | userName: T0215164 | referer: https://confluence.gemalto.com/spaces/DAMIANTEST/pages/1633151470/TEST?preview=/1633151470/1765329819/test_presentation.pptx | traceId: 51f1dc47633243c1
      
             2025-09-22 12:48:37,280 ERROR [https-jsse-nio2-8443-exec-26 url: /500page.jsp; user: T0215164] [atlassian.confluence.status.SystemErrorInformationLogger] logException Unhandled exception, request unique ID: 96e85b0c-1310-464d-a65a-895d56de72bc
            -- traceId: 51f1dc47633243c1
           org.hibernate.HibernateException: Unable to resolve owner of loading collection [[com.atlassian.confluence.core.ContentEntityObject.contentProperties#1765329819]] 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 com.atlassian.confluence.pages.Attachment.getMediaType(Attachment.java:100)
          at com.akelesconsulting.confluence.plugins.filter.AttachmentDownloadFilter.doFilter(SourceFile:141)
          at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:64)
      

      The issue occurs more prominently if there are multiple downloads attempted at the same time.

      Expected Results

      We should be able to download attachments without 500 error

      Actual Results

      We experience HTTP 500 errors during download

      Workaround

      Go to Atlassian Universal Plugin Manager (UPM) in Confluence
      1. Click on the entry for Attachment Checker for Confluence
      2. Click on the 33 of 33 modules enabled
      3. Find the AttachmentDownloadFilter and click on the Disable button which will appear on hover
      After disabling this component, the issue does not occur

      Notes

              Unassigned Unassigned
              sganeshan@atlassian.com Sathya Ganeshan
              Votes:
              5 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: