struts.multipart.saveDir property not being defined causes error during export to PDF and Index propagation in Confluence Data Center
プラットフォームについて: Data Center のみ - この記事は、Data Center プラットフォームのアトラシアン製品にのみ適用されます。
この KB は Data Center バージョンの製品用に作成されています。Data Center 固有ではない機能の Data Center KB は、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
要約
After upgrading Confluence, one of these two events may happen:
- Exporting a page to PDF fails or exporting a space to PDF hangs because
struts.multipart.saveDir
property is not defined. - Index propagation causes NullPointerException because
struts.multipart.saveDir
property is not defined.
環境
Confluence 8 or later versions.
診断
Export to PDF - struts.multipart.saveDir property has not been defined
Depending on the situation (exporting an individual page or a space), the following error will be observed in the Confluence UI:
Checking in the atlassian-confluence.log
file, the following entry can be found:
2023-10-27 14:19:17,958 ERROR [http-nio-8090-exec-13] [atlassian.confluence.servlet.ConfluenceServletDispatcher] sendError Could not execute action
-- url: /confluence/spaces/flyingpdf/pdfpageexport.action | traceId: b45547d2bff77cde | userName: admin | referer: https://CONFLUENCE_URL/confluence/display/PD
java.lang.IllegalStateException: struts.multipart.saveDir property has not been defined
at com.atlassian.confluence.impl.filestore.ConfluenceFileStoreDirectories.resolveBootstrapPathProperty(ConfluenceFileStoreDirectories.java:44)
at com.atlassian.confluence.impl.filestore.ConfluenceFileStoreDirectories.getTempDirectory(ConfluenceFileStoreDirectories.java:33)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
...
...
Index Propagation - NullPointerException
Reindex would be successful on one node but it fails during Index propagation stage as struts.multipart.saveDir
property is not defined.
The following NullPointerException would appear in the atlassian-confluence.log
2024-01-11 00:08:46,079 INFO [Caesium-1-3] [impl.system.runner.CreateIndexSnapshotMaintenanceTaskRunner] execute Creating index snapshots. They will then be propagated to other nodes
2024-01-11 00:08:46,083 ERROR [Caesium-1-3] [confluence.impl.system.JournalSystemMaintenanceTaskQueue] processEntriesInternal Encountered an unrecoverable error while executing the system task. This task will be skipped. 'JournalEntry{id=221289286, journalId=JournalIdentifier{journalName=system_maintenance}, creationDate=Thu Jan 11 00:08:37 CET 2024, type=CREATE_INDEX_SNAPSHOT, message={\"sourceNodeId\":\"38bc48e5\",\"indices\":[\"MAIN_INDEX\",\"CHANGE_INDEX\"]}}'java.lang.NullPointerException
at java.base/sun.nio.fs.UnixPath.normalizeAndCheck(UnixPath.java:75)
at java.base/sun.nio.fs.UnixPath.<init>(UnixPath.java:69)
at java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:279)
at java.base/java.nio.file.Path.of(Path.java:147)
at java.base/java.nio.file.Paths.get(Paths.java:69)
...
...
原因
As part of Confluence 8, property webwork.multipart.saveDir
is replaced by struts.multipart.saveDir
in confluence.cfg.xml
file.
This will be done automatically implemented when Confluence is upgraded to version 8.0 or higher, but occasionally the upgrade task fails and the change is not automatically done.
ソリューション
- Confluence を停止します。
- Navigate to
CONFLUENCE_HOME
directory and locate theconfluence.cfg.xml
file - Take a backup of
confluence.cfg.xml
file Edit the
confluence.cfg.xml
file, adding the following property:<property name="struts.multipart.saveDir">${localHome}/temp</property>
As a reference point, you can replace or add the property below the previously used property:
<property name="webwork.multipart.saveDir">${localHome}/temp</property>
- Start your Confluence instance again