Jira Temporary Directory Cleaner

Still need help?

The Atlassian Community is here for you.

Ask the community

With Jira release 9.5, we’re introducing a feature to solve the issue of instances running out of space: Jira Temporary Directory Cleaner.

Learn more in the following ticket: JRASERVER-46006 - Getting issue details... STATUS

What does this feature do?

Jira will automatically clean its temporary directory during startup.

How to enable the feature?

In Jira 9.5, the feature is disabled by default. We're planning to enable it in the first half of 2023.

To enable the automatic Temporary Directory Cleaner set the tmpdir.clean.on.startup property to true. You can do this by adding a new argument in the setenv.sh script:

How does it work?

Jira will clean the directory defined by the java.io.tmpdir property.

Due to safety reasons, Jira will attempt to remove files from this directory only when the temporary directory is a subdirectory of one of the following:

  • Jira Home

  • Catalina Base (defined by the catalina.base property)

  • Catalina Home (defined by the catalina.home property)

The feature impacts Jira Service Management if the Jira temporary directory defined by the java.io.tmpdir property stores temporary files.

New classes that debug logging can be enabled for

All logs in this feature come from com.atlassian.jira.startup.TemporaryDirectoryCleaner.


INFO "The temporary directory cleaner is disabled. It can be enabled by setting the system property 'tmpdir.clean.on.startup' to true"

The Cleaner is turned off.

INFO "Cleaning the temporary directory located at {}"

The Cleaner is about to start removing temporary files.

INFO "Finished cleaning the temporary directory."

The Cleaner has finished removing temporary files.

WARNING "Finished cleaning the temporary directory, but couldn't remove the following files:\n{}"

Some files couldn’t be removed. In this case, the paths of these files will be logged into the log file. But no more than 20 paths will be logged. If there are more, the message about that will appear.

WARNING ”The temporary directory [{}] does not exist. Skipping cleaning.”

The Cleaner is enabled but the temporary directory doesn’t exist. This won’t cause the Cleaner to fail but won’t remove any files.

WARNING "The temporary directory [{}] should be located in the Jira Home directory [{}] or in one of directories defined by '{}' or '{}' properties. Skipping cleaning."

The feature is enabled but the temporary directory isn’t located in JIRA_HOME, CATALINA_HOME, or CATALINA_BASE. No file will be removed.

To fix this, change the location of the temporary directory. To find it, check java.io.tmpdir or CATALINA_TEMP.

ERROR "Failed to clean the temporary directory located at {}"

There was an exception during the cleaning. The stacktrace will be logged.
Last modified on Dec 15, 2022

Was this helpful?

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