Problem

      Excel macro fails to render Excel files.

      Environment

      Reproducible in:

       7.19
       8.5.14

      Not reproducible in:

      8.7.1

      Steps to Reproduce

      • On a Linux operating system set the system variable "DISPLAY".
      • On a page add an Excel file and try to preview it with Excel macro.

      Expected Results

      You should be able to see the Excel file.

      Actual Results

      You should be able to see the Excel file.

      Diagnosis

      Reviewing the logs, the following error is found when trying to add the excel macro:

      atlassian-confluence.log
      2024-08-24 09:32:18,494 WARN [ForkJoinPool.commonPool-worker-9] [plugins.conversion.impl.LocalFileSystemConversionResultSupplier] lambda$performConversionInSandbox$2 Error when performing conversion com.atlassian.confluence.plugins.conversion.impl.LocalFileSystemConversionResultSupplier$3@46f0ffee[attachment=/download/attachments/314424259/testing.xlsx?version=1&modificationDate=1724509933437&api=v2,conversionType=THUMBNAIL] in the sandbox
       -- url: / | traceId: b3ebad88c538b44a | userName: xxxxx
      java.util.concurrent.CompletionException: com.atlassian.confluence.util.sandbox.SandboxCrashedException: Sandbox has crashed while serving the request
      	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source)
      	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source)
      	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      	at java.base/java.lang.Thread.run(Unknown Source)
      Caused by: com.atlassian.confluence.util.sandbox.SandboxCrashedException: Sandbox has crashed while serving the request
      	at com.atlassian.confluence.impl.util.sandbox.SandboxProcess.tryToThrowSpecificException(SandboxProcess.java:174)
      	at com.atlassian.confluence.impl.util.sandbox.SandboxProcess.execute(SandboxProcess.java:139)
      	at com.atlassian.confluence.impl.util.sandbox.SandboxLocalProcessPool.execute(SandboxLocalProcessPool.java:107)
      	at com.atlassian.confluence.impl.util.sandbox.ConfluenceSandboxPoolFactory$LazySandbox.execute(ConfluenceSandboxPoolFactory.java:70)
      	at com.atlassian.confluence.impl.util.sandbox.DefaultSandbox.execute(DefaultSandbox.java:41)
      	at com.atlassian.confluence.plugins.conversion.impl.sandbox.LocalDocumentConversionSandbox.execute(LocalDocumentConversionSandbox.java:66)
      	at com.atlassian.confluence.plugins.conversion.impl.sandbox.LocalDocumentConversionSandbox.execute(LocalDocumentConversionSandbox.java:59)
      	at com.atlassian.confluence.plugins.conversion.impl.sandbox.DelegatingDocumentConversionSandbox.execute(DelegatingDocumentConversionSandbox.java:47)
      	at com.atlassian.confluence.plugins.conversion.impl.LocalFileSystemConversionResultSupplier.lambda$performConversionInSandbox$1(LocalFileSystemConversionResultSupplier.java:224)
      	... 4 more
      Caused by: java.io.EOFException
      	at java.base/java.io.DataInputStream.readInt(Unknown Source)
      	at com.atlassian.confluence.impl.util.sandbox.SandboxMessage.receiveMessage(SandboxMessage.java:43)
      	at com.atlassian.confluence.impl.util.sandbox.SandboxProcess.receiveMessage(SandboxProcess.java:227)
      	at com.atlassian.confluence.impl.util.sandbox.SandboxProcess.execute(SandboxProcess.java:136)
      	... 11 more 

      To get more details, please add the Sandbox class to debug:

      com.atlassian.confluence.impl.util.sandbox 

      During testing, it was noticed two outputs in atlassian-confluence.log .

      • If the Linux OS doesn't have the following libs libxrender1, libxtst6, libxi6, the sandbox errors out like this: 
      2024-09-02 14:29:32,522 INFO [sandbox-logger] [impl.util.sandbox.ConversionSandbox] lambda$buildConfig$0 worker0: Exception in thread \"main\" java.lang.UnsatisfiedLinkError: /opt/java/openjdk/lib/libawt_xawt.so: libXext.so.6: cannot open shared object file: No such file or directory  
      • After installing the libs, it will error out like this: 
      2024-09-02 14:04:44,446 DEBUG [http-nio-8090-exec-11 url: /confluence/rest/office/1.0/view; user: admin] [impl.util.sandbox.SandboxClassFinder] findClass Attempt to load class com.aspose.cells.a.c.zh
      2024-09-02 14:04:44,501 INFO [sandbox-logger] [impl.util.sandbox.ConversionSandbox] lambda$buildConfig$0 worker1: Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using 'localhost:10.0' as the value of the DISPLAY variable.  

      Cause

      The Sandbox can inadvertently pick up the DISPLAY environment variable and try to use it. For more information on what this variable is, please refer to the link below:

      Reviewing the support zip, the variable can be found in the application.xml file:

      application.xml
      <environment-variables>
      ...
          <DISPLAY>localhost:10.0</DISPLAY>
      ...
      </environment-variables>
      

      Workaround

      Try unsetting the DISPLAY variable on the Confluence side:

      1. Locate the and edit the <confluence_installation>/bin/setenv.sh file
      2. Add at the end of the file
        unset DISPLAY
        
      3. Restart Confluence on this node
      4. Wait for this node to fully start up, then apply the same changes to any additional Confluence DC nodes
      5. Once all nodes have the DISPLAY environment cleared out in setenv.sh, try the excel macro again

      Notes

            [CONFSERVER-97830] Previewing excel files fails due to java.awt.AWTError

            Quan Pham added a comment -

            A fix for this issue is available in Confluence Server and Data Center 8.5.17. Upgrade now or check out the Release Notes to see what other issues are resolved.

            Quan Pham added a comment - A fix for this issue is available in Confluence Server and Data Center 8.5.17. Upgrade now or check out the Release Notes to see what other issues are resolved.
            Quan Pham made changes -
            Resolution New: Fixed [ 1 ]
            Status Original: Waiting for Release [ 12075 ] New: Closed [ 6 ]
            Sunny Wu made changes -
            Labels Original: qe-sync New: ewt-rtb-service-operations-and-tech-entropy qe-sync
            SET Analytics Bot made changes -
            UIS Original: 59 New: 63
            SET Analytics Bot made changes -
            Support reference count Original: 7 New: 8
            Filipe Rodrigues made changes -
            Affects Version/s New: 8.5.12 [ 108614 ]
            Basar Beykoz made changes -
            Description Original: h3. Problem

            Excel macro fails to render Excel files.
            h3. Environment

            Reproducible in:

            (x) 7.19
            (x) 8.5.14

            Not reproducible in:

            (/) 8.7.1
            h3. Steps to Reproduce
             * On a Linux operating system set the system variable "DISPLAY".
             * On a page add an Excel file and try to preview it with Excel macro.

            h3. Expected Results

            You should be able to see the Excel file.
            h3. Actual Results

            You should be able to see the Excel file.
            h3. Diagnosis

            Reviewing the logs, the following error is found when trying to add the excel macro:
            {code:yaml|title=atlassian-confluence.log}
            2024-08-24 09:32:18,494 WARN [ForkJoinPool.commonPool-worker-9] [plugins.conversion.impl.LocalFileSystemConversionResultSupplier] lambda$performConversionInSandbox$2 Error when performing conversion com.atlassian.confluence.plugins.conversion.impl.LocalFileSystemConversionResultSupplier$3@46f0ffee[attachment=/download/attachments/314424259/testing.xlsx?version=1&modificationDate=1724509933437&api=v2,conversionType=THUMBNAIL] in the sandbox
             -- url: / | traceId: b3ebad88c538b44a | userName: xxxxx
            java.util.concurrent.CompletionException: com.atlassian.confluence.util.sandbox.SandboxCrashedException: Sandbox has crashed while serving the request
            at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source)
            at java.base/java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source)
            at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source)
            at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
            at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
            at java.base/java.lang.Thread.run(Unknown Source)
            Caused by: com.atlassian.confluence.util.sandbox.SandboxCrashedException: Sandbox has crashed while serving the request
            at com.atlassian.confluence.impl.util.sandbox.SandboxProcess.tryToThrowSpecificException(SandboxProcess.java:174)
            at com.atlassian.confluence.impl.util.sandbox.SandboxProcess.execute(SandboxProcess.java:139)
            at com.atlassian.confluence.impl.util.sandbox.SandboxLocalProcessPool.execute(SandboxLocalProcessPool.java:107)
            at com.atlassian.confluence.impl.util.sandbox.ConfluenceSandboxPoolFactory$LazySandbox.execute(ConfluenceSandboxPoolFactory.java:70)
            at com.atlassian.confluence.impl.util.sandbox.DefaultSandbox.execute(DefaultSandbox.java:41)
            at com.atlassian.confluence.plugins.conversion.impl.sandbox.LocalDocumentConversionSandbox.execute(LocalDocumentConversionSandbox.java:66)
            at com.atlassian.confluence.plugins.conversion.impl.sandbox.LocalDocumentConversionSandbox.execute(LocalDocumentConversionSandbox.java:59)
            at com.atlassian.confluence.plugins.conversion.impl.sandbox.DelegatingDocumentConversionSandbox.execute(DelegatingDocumentConversionSandbox.java:47)
            at com.atlassian.confluence.plugins.conversion.impl.LocalFileSystemConversionResultSupplier.lambda$performConversionInSandbox$1(LocalFileSystemConversionResultSupplier.java:224)
            ... 4 more
            Caused by: java.io.EOFException
            at java.base/java.io.DataInputStream.readInt(Unknown Source)
            at com.atlassian.confluence.impl.util.sandbox.SandboxMessage.receiveMessage(SandboxMessage.java:43)
            at com.atlassian.confluence.impl.util.sandbox.SandboxProcess.receiveMessage(SandboxProcess.java:227)
            at com.atlassian.confluence.impl.util.sandbox.SandboxProcess.execute(SandboxProcess.java:136)
            ... 11 more {code}
            To get more details, please add the Sandbox class to [debug|https://confluence.atlassian.com/doc/configuring-logging-181535215.html]:
            {code:java}
            com.atlassian.confluence.impl.util.sandbox {code}
            During testing, it was noticed two outputs in *atlassian-confluence.log* .
             * If the Linux OS doesn't have the following libs {*}libxrender1, libxtst6, libxi6{*}, the sandbox errors out like this: 

            {code:java}
            2024-09-02 14:29:32,522 INFO [sandbox-logger] [impl.util.sandbox.ConversionSandbox] lambda$buildConfig$0 worker0: Exception in thread \"main\" java.lang.UnsatisfiedLinkError: /opt/java/openjdk/lib/libawt_xawt.so: libXext.so.6: cannot open shared object file: No such file or directory {code}
             * After installing the libs, it will error out like this: 

            {code:java}
            2024-09-02 14:04:44,446 DEBUG [http-nio-8090-exec-11 url: /confluence/rest/office/1.0/view; user: admin] [impl.util.sandbox.SandboxClassFinder] findClass Attempt to load class com.aspose.cells.a.c.zh
            2024-09-02 14:04:44,501 INFO [sandbox-logger] [impl.util.sandbox.ConversionSandbox] lambda$buildConfig$0 worker1: Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using 'localhost:10.0' as the value of the DISPLAY variable. {code}
            h3. Cause

            The Sandbox can inadvertently pick up the DISPLAY environment variable and try to use it. For more information on what this variable is, please refer to the link below:
             * [https://askubuntu.com/questions/432255/what-is-the-display-environment-variable]

            Reviewing the support zip, the variable can be found in the *application.xml* file:
            {code:xml|title=application.xml}
            <environment-variables>
            ...
                <DISPLAY>localhost:10.0</DISPLAY>
            ...
            </environment-variables>
            {code}
            h3. Workaround

            Try unsetting the *DISPLAY* variable on the Confluence side:
             # Locate the and edit the *<confluence_installation>/bin/setenv.sh* file
             # Add at the end of the file
            {code:java}
            unset DISPLAY
            {code}

             # Restart Confluence on this node
             # Wait for this node to fully start up, then apply the same changes to any additional Confluence DC nodes
             # Once all nodes have the DISPLAY environment cleared out in {*}setenv.sh{*}, try the excel macro again

            h3. Notes
            New: h3. Problem

            Excel macro fails to render Excel files.
            h3. Environment

            Reproducible in:

            (x) 7.19
            (x) 8.5.14

            Not reproducible in:

            (/) 8.7.1
            h3. Steps to Reproduce
             * On a Linux operating system set the system variable "DISPLAY".
             * On a page add an Excel file and try to preview it with Excel macro.

            h3. Expected Results

            You should be able to see the Excel file.
            h3. Actual Results

            You should be able to see the Excel file.
            h3. Diagnosis

            Reviewing the logs, the following error is found when trying to add the excel macro:
            {code:yaml|title=atlassian-confluence.log}
            2024-08-24 09:32:18,494 WARN [ForkJoinPool.commonPool-worker-9] [plugins.conversion.impl.LocalFileSystemConversionResultSupplier] lambda$performConversionInSandbox$2 Error when performing conversion com.atlassian.confluence.plugins.conversion.impl.LocalFileSystemConversionResultSupplier$3@46f0ffee[attachment=/download/attachments/314424259/testing.xlsx?version=1&modificationDate=1724509933437&api=v2,conversionType=THUMBNAIL] in the sandbox
             -- url: / | traceId: b3ebad88c538b44a | userName: xxxxx
            java.util.concurrent.CompletionException: com.atlassian.confluence.util.sandbox.SandboxCrashedException: Sandbox has crashed while serving the request
            at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source)
            at java.base/java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source)
            at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source)
            at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
            at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
            at java.base/java.lang.Thread.run(Unknown Source)
            Caused by: com.atlassian.confluence.util.sandbox.SandboxCrashedException: Sandbox has crashed while serving the request
            at com.atlassian.confluence.impl.util.sandbox.SandboxProcess.tryToThrowSpecificException(SandboxProcess.java:174)
            at com.atlassian.confluence.impl.util.sandbox.SandboxProcess.execute(SandboxProcess.java:139)
            at com.atlassian.confluence.impl.util.sandbox.SandboxLocalProcessPool.execute(SandboxLocalProcessPool.java:107)
            at com.atlassian.confluence.impl.util.sandbox.ConfluenceSandboxPoolFactory$LazySandbox.execute(ConfluenceSandboxPoolFactory.java:70)
            at com.atlassian.confluence.impl.util.sandbox.DefaultSandbox.execute(DefaultSandbox.java:41)
            at com.atlassian.confluence.plugins.conversion.impl.sandbox.LocalDocumentConversionSandbox.execute(LocalDocumentConversionSandbox.java:66)
            at com.atlassian.confluence.plugins.conversion.impl.sandbox.LocalDocumentConversionSandbox.execute(LocalDocumentConversionSandbox.java:59)
            at com.atlassian.confluence.plugins.conversion.impl.sandbox.DelegatingDocumentConversionSandbox.execute(DelegatingDocumentConversionSandbox.java:47)
            at com.atlassian.confluence.plugins.conversion.impl.LocalFileSystemConversionResultSupplier.lambda$performConversionInSandbox$1(LocalFileSystemConversionResultSupplier.java:224)
            ... 4 more
            Caused by: java.io.EOFException
            at java.base/java.io.DataInputStream.readInt(Unknown Source)
            at com.atlassian.confluence.impl.util.sandbox.SandboxMessage.receiveMessage(SandboxMessage.java:43)
            at com.atlassian.confluence.impl.util.sandbox.SandboxProcess.receiveMessage(SandboxProcess.java:227)
            at com.atlassian.confluence.impl.util.sandbox.SandboxProcess.execute(SandboxProcess.java:136)
            ... 11 more {code}
            To get more details, please add the Sandbox class to [debug|https://confluence.atlassian.com/doc/configuring-logging-181535215.html]:
            {code:java}
            com.atlassian.confluence.impl.util.sandbox {code}
            During testing, it was noticed two outputs in *atlassian-confluence.log* .
             * If the Linux OS doesn't have the following libs {*}libxrender1, libxtst6, libxi6{*}, the sandbox errors out like this: 

            {code:java}
            2024-09-02 14:29:32,522 INFO [sandbox-logger] [impl.util.sandbox.ConversionSandbox] lambda$buildConfig$0 worker0: Exception in thread \"main\" java.lang.UnsatisfiedLinkError: /opt/java/openjdk/lib/libawt_xawt.so: libXext.so.6: cannot open shared object file: No such file or directory {code}
             * After installing the libs, it will error out like this: 

            {code:java}
            2024-09-02 14:04:44,446 DEBUG [http-nio-8090-exec-11 url: /confluence/rest/office/1.0/view; user: admin] [impl.util.sandbox.SandboxClassFinder] findClass Attempt to load class com.aspose.cells.a.c.zh
            2024-09-02 14:04:44,501 INFO [sandbox-logger] [impl.util.sandbox.ConversionSandbox] lambda$buildConfig$0 worker1: Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using 'localhost:10.0' as the value of the DISPLAY variable. {code}
            h3. Cause

            The Sandbox can inadvertently pick up the DISPLAY environment variable and try to use it. For more information on what this variable is, please refer to the link below:
             * [https://askubuntu.com/questions/432255/what-is-the-display-environment-variable]

            Reviewing the support zip, the variable can be found in the *application.xml* file:
            {code:xml|title=application.xml}
            <environment-variables>
            ...
                <DISPLAY>localhost:10.0</DISPLAY>
            ...
            </environment-variables>
            {code}
            h3. Workaround

            Try unsetting the *DISPLAY* variable on the Confluence side:
             # Locate the and edit the *<confluence_installation>/bin/setenv.sh* file
             # Add at the end of the file
            {code:java}
            unset DISPLAY
            {code}
             # Restart Confluence on this node
             # Wait for this node to fully start up, then apply the same changes to any additional Confluence DC nodes
             # Once all nodes have the DISPLAY environment cleared out in {*}setenv.sh{*}, try the excel macro again

            h3. Notes
            Franco Skrzypczak (Inactive) made changes -
            QA Demo Status Original: Not Done [ 14330 ] New: Done [ 14331 ]
            QA Kickoff Status Original: Not Done [ 14234 ] New: Not Needed [ 14236 ]
            Status Original: In Progress [ 3 ] New: Waiting for Release [ 12075 ]
            Franco Skrzypczak (Inactive) made changes -
            Fix Version/s New: 8.5.17 [ 109896 ]
            Sunny Wu made changes -
            Labels Original: ewt-rtb-service-operations-and-tech-entropy New: qe-sync

              20f00d30f8b9 Franco Skrzypczak (Inactive)
              f7fe77b3bc24 Filipe Rodrigues
              Affected customers:
              0 This affects my team
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: