PDF and Office Documents fails during preview

XMLWordPrintable

    • 3
    • Severity 3 - Minor
    • 0

      Issue Summary

      Since then file attachment (except image files like png, jpg) upload causes an issue where the attachment is always embedded within the View File Macro which results in an error while saving a page. This is seen after upgrading Confluence from 6.6.8 to 6.13.6

      Steps to Reproduce

      1. Create a new Page
      2. Initiate attachment upload of a PDF or an Office document from the UI option at the top or Drag n Drop
      3. We cans see that the attachment is already embedded within the view file macro
      4. Upon saving the page, we see an error as below:

        Expected Results

      Attachment to be uploaded without view file macros interference or render the attachment upon page load without any errors

      Actual Results

      The below exception is thrown in the atlassian-confluence.log file:

      java.lang.IllegalArgumentException: Can't convert an attachment data stream that is not FileWrapper
      	at com.atlassian.confluence.plugins.conversion.impl.LocalFileSystemConversionResultSupplier.performConversionInSandbox(LocalFileSystemConversionResultSupplier.java:312)
      	at com.atlassian.confluence.plugins.conversion.impl.LocalFileSystemConversionResultSupplier.getConversionResult(LocalFileSystemConversionResultSupplier.java:185)
      	at com.atlassian.confluence.plugins.conversion.impl.DefaultConversionManager.getConversionResult(DefaultConversionManager.java:213)
      	at sun.reflect.GeneratedMethodAccessor1922.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
      

      Cause

      You are running Data Center and storing attachments in DB, then PDF and MS Office documents conversion will fail (hence the broken previews). It is because all conversions for DC are performed in a sandbox.

      Workaround

      • Migrate the attachment storage from DB to disk: Attachment Storage Configuration. The DB storage is deprecated for a long time and strongly discouraged.
      • In addition, File View macros are deprecated for 6.13. They will be reintroduced in 7.0, but most likely with a different implementation.
      • Disable sandbox feature. This will avoid sandbox document conversions while generating previews. However, This solution is not recommended because it will reduce the stability and security of the data center.

            Assignee:
            Unassigned
            Reporter:
            Chandu
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: