Office Excel macro not generating thumbnails while using other languages
Summary
Office Excel Macro fails to generate thumbnails while using languages other than English.
Environment
Confluence Data Center
Diagnosis
When using the Office Excel Macro, thumbnails won't be generated; instead, an error message will display: "We can't preview this file. You'll have to download the file to view it."
In the Confluence Data Center, a separate pool of processes called Sandbox handles Document conversion and thumbnail generation. To diagnose, you need to enable Sandbox Debug logs by following this knowledge base article. Reproduce the issue again by enabling Sandbox debug logs, and you will be able to see the logs below in atlassian-confluence.log.
2024-03-13 13:16:01,306 INFO [sandbox-logger] [impl.util.sandbox.ConversionSandbox] lambda$buildConfig$0 worker0: Caused by: class com.aspose.slides.exceptions.ArgumentException: Culture Name: en-DK is not a supported culture
2024-03-13 13:16:01,358 DEBUG [document-conversion-sandbox-launcher-2] [impl.util.sandbox.SandboxClassFinder] findClass Attempt to load class com.aspose.words.internal.zzZDH
2024-03-13 13:16:01,362 WARN [Thread-1159] [plugins.conversion.impl.LocalFileSystemConversionResultSupplier] lambda$performConversionInSandbox$2 Error when performing conversion com.atlassian.confluence.plugins.conversion.impl.LocalFileSystemConversionResultSupplier$3@799cde53[attachment=/download/attachments/1021546767/hej.xlsx?version=1&modificationDate=1710332154685&api=v2,conversionType=THUMBNAIL] in the sandbox -- referer: https://xyz/confluence | url: /rest/documentConversion/0.1/conversion/convert/2711534961/1 | traceId: a63sdfasdfaf6081 | userName: conf-sysadmin java.util.concurrent.CompletionException: com.atlassian.confluence.util.sandbox.SandboxCrashedException: Sandbox has crashed while serving the request
Specifically, you can observe the language "en-DK" which Confluence does not support, as indicated by the error message "Culture Name: en-DK is not a supported culture." This alerts us that en-DK needs additional configuration to be supported.
Solution
As the locale isn't supported, we must include a system property for it in Sandbox processes. To resolve the issue, follow the below steps.
- Shutdown Confluence
- Take backup of <confluence_installer>/bin/setenv.sh for Linux System, refer Configuring System Properties to set property in other systems.
Add the below JVM property to <confluence_installer>/bin/setenv.sh and add relevant language support. Below is an example of language 'da' and country 'DK'. To get information regarding the country and its respective language you can refer to this document
CATALINA_OPTS="-Dconversion.sandbox.java.options=-Duser.language=da -Duser.country=DK ${CATALINA_OPTS}"
- Start Confluence