System properties not loading as expected on Confluence
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
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 editing the <Install-folder>/bin/setenv.sh to add extra system properties, you notice that they are not being loaded by the Confluence process.
Environment
Confluence running on Linux.
Diagnosis
You can check the properties being used by the Confluence process as follows:
- Visit Cog Icon > General Configuration > System Information and look for CATALINA_OPTS, or
- Run the following command on the server terminal:
ps -ef | grep org.apache.catalina.startup.Bootstrap
Inspecting the list, you can't see the extra property you just added. You may also notice other properties are missing.
Cause
This can be caused by not adding the trailing ${CATALINA_OPTS} that should be closing each CATALINA_OPTS= entry on the file. This needs to be present to append the current line to that variable. If it is missing, it causes all previous items to be overwritten.
Solution
Check if that is the case by looking for properties added like this in <Install-folder>/bin/setenv.sh:
CATALINA_OPTS="-Dsynchrony.memory.max=4g"
synchrony.memory.max is just an example, look for any line that does not contain ${CATALINA_OPTS} at the end.
If you find such entries, edit them so they look like this:
CATALINA_OPTS="-Dsynchrony.memory.max=4g ${CATALINA_OPTS}"
Save the file and restart Confluence, all properties should be loaded now. Remember to repeat this on all nodes if running Data Center.