struts.multipart.saveDir property not being defined causes error during export to PDF and Index propagation

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

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. 

Environment

Confluence 8 or later versions. 

Diagnosis

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) 
...
...


Cause

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. 

Solution

  1. Stop Confluence
  2. Navigate to CONFLUENCE_HOME  directory and locate the confluence.cfg.xml file
  3. Take a backup of confluence.cfg.xml  file
  4. 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> 
  5. Start your Confluence instance again



Last modified on Mar 12, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.