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

View File Macro (PDF/Powerpoint) doesn't work when Confluence DC is running on Windows

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 8.5.4, 8.7.1
    • 8.5.0, 8.4.1, 8.5.1, 8.5.2, 8.5.3, 7.19.25, 7.19.26, 7.19.27
    • Macros - Other Macros
    • None

      Issue Summary

      On Confluence Data Center deployments on Windows, the viewfile macro is broken, and does not display (normal document preview is unaffected).

      Issue is only reproducible on Data Center and does not affect Server

      Steps to Reproduce

      1. Install and configure Confluence Data Center on Windows server
      2. Create a new page, attach one PDF file and publish it
      3. Edit the page, add a PDF macro to display the PDF file and save the page
      4. You will get an error "There was a problem converting this attachment."

      Expected Results

      The PDF macro should display the PDF file

      Actual Results

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

      2023-09-27 13:04:11,675 ERROR [DefaultSlideCacheManager:thread-1] [com.benryan.conversion.AbstractSandboxSlideConversionTask] convertFile Sandbox conversion is failed. Please check sandbox log for more detail -- url: /plugins/servlet/pptslide | userName: admin | referer: https://instenv-175859-j51z.instenv.internal.atlassian.com/display/TEST/PDF+test | traceId: 0adca24eb43f6f672023-09-27 13:04:11,676 WARN [DefaultSlideCacheManager:thread-1] [com.benryan.conversion.AttachmentDataTempFile] close Failed to delete temporary attachment conversion file D:\\confluence-home\\temp\\3221880586036659613.tmp -- url: /plugins/servlet/pptslide | userName: admin | referer: https://instenv-175859-j51z.instenv.internal.atlassian.com/display/TEST/PDF+test | traceId: 0adca24eb43f6f67java.nio.file.FileSystemException: D:\confluence-home\temp\3221880586036659613.tmp: The process cannot access the file because it is being used by another process.
      	at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:92)
      	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
      	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
      	at java.base/sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:274)
      	at java.base/sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:105)
      	at java.base/java.nio.file.Files.delete(Files.java:1142)	at com.benryan.conversion.AttachmentDataTempFile.close(AttachmentDataTempFile.java:32)
      	at com.benryan.conversion.AbstractSandboxSlideConversionTask.convertFile(AbstractSandboxSlideConversionTask.java:98)
      	at com.benryan.conversion.AbstractSandboxSlideConversionTask.convertFile(AbstractSandboxSlideConversionTask.java:25)
      	at com.benryan.conversion.AbstractSlideConversionTask.call(AbstractSlideConversionTask.java:40)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      	at java.base/java.lang.Thread.run(Thread.java:829) 
      

      DEBUG logs

      2023-09-27 13:14:05,449 DEBUG [document-conversion-sandbox-launcher-3] [impl.util.sandbox.SandboxProcess] execute Send a request for APPLICATION_REQUEST : com.atlassian.confluence.plugins.conversion.impl.LocalFileSystemConversionResultSupplier$3@55b313e6[attachment=/download/attachments/1638406/sample.pdf?version=1&modificationDate=1695820444108&api=v2,conversionType=THUMBNAIL]2023-09-27 13:14:05,626 DEBUG [document-conversion-sandbox-launcher-3] [impl.util.sandbox.SandboxProcess] execute Sandbox result received2023-09-27 13:14:08,591 INFO [http-nio-8090-exec-4 url: /rest/api/content/1638406; user: admin] [plugins.synchrony.service.SynchronyExternalChangesManager] performExternalChange Started external change for ContentId{id=1638406}2023-09-27 13:14:08,597 INFO [http-nio-8090-exec-4 url: /rest/api/content/1638406; user: admin] [synchrony.service.http.SynchronyRequestExecutor] execute Initiating request PUT http://127.0.0.1:8091/synchrony/v1/data/Synchrony-caf54ef7-67e7-3fc8-97ea-75e488b72bf8/confluence-1638406?state-at=@head&state-format=html HTTP/1.1 for 16384062023-09-27 13:14:22,202 INFO [http-nio-8090-exec-7 url: /rest/api/content/1638406; user: admin] [plugins.synchrony.service.SynchronyExternalChangesManager] performExternalChange Started external change for ContentId{id=1638406}2023-09-27 13:14:22,213 INFO [http-nio-8090-exec-7 url: /rest/api/content/1638406; user: admin] [synchrony.service.http.SynchronyRequestExecutor] execute Initiating request PUT http://127.0.0.1:8091/synchrony/v1/data/Synchrony-caf54ef7-67e7-3fc8-97ea-75e488b72bf8/confluence-1638406?state-at=@head&state-format=html HTTP/1.1 for 16384062023-09-27 13:14:23,063 DEBUG [DefaultSlideCacheManager:thread-2] [impl.util.sandbox.SandboxProcess] execute Send a request for APPLICATION_REQUEST : com.atlassian.confluence.plugins.conversion.convert.image.SandboxPdfThumbnailRequest@dce182352023-09-27 13:14:23,065 DEBUG [DefaultSlideCacheManager:thread-2] [impl.util.sandbox.SandboxMessageExchanger] handleMessage Got a request for FIND_RESOURCE_REQUEST com/sun/pdfview/font/res/n019003l.pfb2023-09-27 13:14:23,065 DEBUG [DefaultSlideCacheManager:thread-2] [impl.util.sandbox.SandboxClassFinder] findResource Attempt to load resource com/sun/pdfview/font/res/n019003l.pfb2023-09-27 13:14:23,076 INFO [sandbox-logger] [impl.util.sandbox.ConversionSandbox] lambda$buildConfig$0 worker1: Doing thumbnail generation for: D:\\confluence-home\\temp\\3258667619519995234.tmp with page 02023-09-27 13:14:23,076 INFO [sandbox-logger] [impl.util.sandbox.ConversionSandbox] lambda$buildConfig$0 worker1: With input params. Page Number = 0, ,maxWidth = 2147483647, maxHeight = 21474836472023-09-27 13:14:23,104 DEBUG [DefaultSlideCacheManager:thread-2] [impl.util.sandbox.SandboxProcess] execute Sandbox result received2023-09-27 13:14:23,105 ERROR [DefaultSlideCacheManager:thread-2] [com.benryan.conversion.AbstractSandboxSlideConversionTask] convertFile Sandbox conversion is failed. Please check sandbox log for more detail -- url: /plugins/servlet/pptslide | userName: admin | referer: https://instenv-175859-j51z.instenv.internal.atlassian.com/display/TEST/PDF+test | traceId: e20306ed455c3a172023-09-27 13:14:23,105 WARN [DefaultSlideCacheManager:thread-2] [com.benryan.conversion.AttachmentDataTempFile] close Failed to delete temporary attachment conversion file D:\\confluence-home\\temp\\3258667619519995234.tmp -- url: /plugins/servlet/pptslide | userName: admin | referer: https://instenv-175859-j51z.instenv.internal.atlassian.com/display/TEST/PDF+test | traceId: e20306ed455c3a17java.nio.file.FileSystemException: D:\confluence-home\temp\3258667619519995234.tmp: The process cannot access the file because it is being used by another process.
      	at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:92)
      	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
      	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
      	at java.base/sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:274)
      	at java.base/sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:105)
      	at java.base/java.nio.file.Files.delete(Files.java:1142)	at com.benryan.conversion.AttachmentDataTempFile.close(AttachmentDataTempFile.java:32)
      	at com.benryan.conversion.AbstractSandboxSlideConversionTask.convertFile(AbstractSandboxSlideConversionTask.java:98)
      	at com.benryan.conversion.AbstractSandboxSlideConversionTask.convertFile(AbstractSandboxSlideConversionTask.java:25)
      	at com.benryan.conversion.AbstractSlideConversionTask.call(AbstractSlideConversionTask.java:40)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      	at java.base/java.lang.Thread.run(Thread.java:829)2023-09-27 13:14:23,127 INFO [sandbox-logger] [impl.util.sandbox.ConversionSandbox] lambda$buildConfig$0 worker1: Exception when generate thumbnail: \\\\10.9.31.205\\mnt\\home\\viewfile\\temp\\0bfdbd4f-33b2-480f-a81c-087033027c0a -> \\\\10.9.31.205\\mnt\\home\\viewfile\\temp\\f98ad951-b496-45d3-a8be-7b0ab32329bf: The process cannot access the file because it is being used by another process.2023-09-27 13:14:23,127 INFO [sandbox-logger] [impl.util.sandbox.ConversionSandbox] lambda$buildConfig$0 worker1: 
      

      Workaround

      Option 1:

      Tell OfficeConnector not to use sandbox. By apply the below darkfeature

      officeconnector.slide.sandbox.bypass  

      Option 2:

      The view file macros successfully display after disabling the sandbox (External Process Pool):

      1. Shut down Confluence
      2. Include the below system property:
        -Ddocument.conversion.sandbox.disable=true

            [CONFSERVER-91712] View File Macro (PDF/Powerpoint) doesn't work when Confluence DC is running on Windows

            Hima Bindu made changes -
            Affects Version/s New: 7.19.25 [ 108599 ]
            Affects Version/s New: 7.19.26 [ 108817 ]
            Affects Version/s New: 7.19.27 [ 108953 ]
            Adarsh Kumar made changes -
            Remote Link New: This issue links to "Page (Confluence)" [ 930407 ]
            Duy Truong Luong made changes -
            Remote Link New: This issue links to "A1 Server. Master Baseline › Setup and upgrade tests, Postgres 14 › issue-CONFSERVER-91712-bump-document-conversion-lib-2.7.10 (server-syd-bamboo)" [ 913406 ]
            James Whitehead made changes -
            Resolution New: Fixed [ 1 ]
            Status Original: Waiting for Release [ 12075 ] New: Closed [ 6 ]
            James Whitehead made changes -
            Fix Version/s Original: 8.7.0 [ 106203 ]
            James Whitehead made changes -
            Fix Version/s New: 8.7.1 [ 106517 ]
            SET Analytics Bot made changes -
            Support reference count Original: 14 New: 15
            SET Analytics Bot made changes -
            UIS Original: 53 New: 62
            SET Analytics Bot made changes -
            Support reference count Original: 13 New: 14
            Pushpanjali Shivaramu made changes -
            Affects Version/s New: 8.5.3 [ 106307 ]

              dluong Duy Truong Luong
              c9b4597f5a24 Vishnu Prasad P S
              Affected customers:
              20 This affects my team
              Watchers:
              31 Start watching this issue

                Created:
                Updated:
                Resolved: