スペースを PDF にエクスポートする際に Confluence Data Center で「java.lang.UnsatisfiedLinkError」が表示される
プラットフォームについて: Data Center - この記事は、Data Center プラットフォームのアトラシアン製品に適用されます。
このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
要約
When attempting to export a space into PDF, it fails with a System Error page and a generic SandboxCrashedException message in the logs due to a dependency on the Linux X11 library.
診断
Initially, the following is observed in the atlassian-confluence.log when the export to PDF operation failed:
2023-09-19 10:47:55,075 ERROR [https-jsse-nio2-8443-exec-1] [apache.struts2.dispatcher.DefaultDispatcherErrorHandler] sendErrorResponse Exception occurred during processing request: com.atlassian.confluence.importexport.ImportExportException: We couldn't complete your export. There was an error converting the page \"Page Name\". <a href=\"https://docs.atlassian.com/confluence/docs-85/PDF+export+in+Confluence+Data+Center\">Learn more</a>
-- url: /spaces/flyingpdf/pdfpageexport.action | userName: admin | referer: /display/SPACE/Page+Name | traceId: e56bab7ffde1d479
java.lang.RuntimeException: com.atlassian.confluence.importexport.ImportExportException: We couldn't complete your export. There was an error converting the page "Page Name". <a href="https://docs.atlassian.com/confluence/docs-85/PDF+export+in+Confluence+Data+Center">Learn more</a>
at com.atlassian.confluence.extra.flyingpdf.impl.ExportPageAsPdfAction.doExecute(ExportPageAsPdfAction.java:57)
at com.atlassian.confluence.extra.flyingpdf.impl.PdfExportSemaphore.run(PdfExportSemaphore.java:28)
at com.atlassian.confluence.extra.flyingpdf.impl.ExportPageAsPdfAction.execute(ExportPageAsPdfAction.java:30)
...
...
Caused by: com.atlassian.confluence.importexport.ImportExportException: We couldn't complete your export. There was an error converting the page "Page Name". <a href="https://docs.atlassian.com/confluence/docs-85/PDF+export+in+Confluence+Data+Center">Learn more</a>
at com.atlassian.confluence.extra.flyingpdf.sandbox.SandboxXmlToPdfConverter.convertXhtmlToPdf(SandboxXmlToPdfConverter.java:95)
at com.atlassian.confluence.extra.flyingpdf.sandbox.SandboxPdfExporterService.renderPdf(SandboxPdfExporterService.java:354)
...
...
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)
...
...
This error message is quite generic, so extra DEBUG needs to be enabled in the Sandbox process as stated in our KB How to enable debug logging to investigate document conversion problems in Confluence's External Process Pool (sandbox)
Once additional debugs are enabled, the following error is observed few milliseconds before the SandboxCrashedException:
2023-09-20 07:08:02,215 DEBUG [https-jsse-nio2-8443-exec-19] [extra.flyingpdf.sandbox.SandboxPdfExporterService] createPdf Exporting page 11111111
2023-09-20 07:08:02,217 DEBUG [https-jsse-nio2-8443-exec-19] [extra.flyingpdf.html.RenderedXhtmlBuilder] renderToHtml Rendering to exported XHTML page id=11111111
...
...
2023-09-20 07:08:02,589 INFO [https-jsse-nio2-8443-exec-19] [extra.flyingpdf.auding.PdfExportAuditListener] onPDFExport Auditing PDF export of page
2023-09-20 07:08:02,589 INFO [sandbox-logger] [impl.util.sandbox.ConversionSandbox] lambda$buildConfig$0 worker1: Exception in thread \"main\" java.lang.UnsatisfiedLinkError: /opt/atlassian/confluence/jre/lib/libawt_xawt.so: libXrender.so.1: Cannot open shared object file: File or directory not found
at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(Unknown Source)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source)
at java.base/java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.base/java.lang.Runtime.load0(Unknown Source)
at java.base/java.lang.System.load(Unknown Source)
at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(Unknown Source)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source)
at java.base/jdk.internal.loader.NativeLibraries.findFromPaths(Unknown Source)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source)
at java.base/java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.base/java.lang.Runtime.loadLibrary0(Unknown Source)
at java.base/java.lang.System.loadLibrary(Unknown Source)
at java.desktop/java.awt.Toolkit$2.run(Unknown Source)
at java.desktop/java.awt.Toolkit$2.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Unknown Source)
at java.desktop/java.awt.Toolkit.loadLibraries(Unknown Source)
at java.desktop/java.awt.Toolkit.initStatic(Unknown Source)
at java.desktop/java.awt.Toolkit.<clinit>(Unknown Source)
at java.desktop/java.awt.Color.<clinit>(Unknown Source)
at org.xhtmlrenderer.pdf.ITextOutputDevice.<init>(ITextOutputDevice.java:122)
at org.xhtmlrenderer.pdf.ITextRenderer.<init>(ITextRenderer.java:106)
at org.xhtmlrenderer.pdf.ITextRenderer.<init>(ITextRenderer.java:102)
at com.atlassian.confluence.extra.flyingpdf.sandbox.SandboxPdfConversionTask.createRenderer(SandboxPdfConversionTask.java:104)
...
...
...
原因
This error stack trace shows that the sandbox process was attempting to load GUI-related classes, which possibly made it look for dependent linux X11 (display) libraries (which may not be present or even needed).
This generally happens when the process picks up the presence of a valid DISPLAY configuration from the OS environment variables.
ソリューション
Please, follow these steps to overcome this situation:
Include line unset DISPLAY in your
setenv.shfile, just before the export CATALINA_OPTS lineunset DISPLAY export CATALINA_OPTS- Confluence を再起動します。
As an alternative to this, you can also check with your OS Administrator and install the missing X11 libraries for your OS version:
- Install the required libXtst-devel and libXrender-devel RPM to the server per the instructions on our Confluence UNIX and X11 Dependencids page.
- It might also be needed to configure as a System Property the following java argument: -Djava.awt.headless=true