Confluence on Docker: Wrong parameters passed to Synchrony
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
As per the Confluence Docker HUB we have 3 JVM properties to pass Heap memory and code cache size.
- JVM_MINIMUM_MEMORY
- JVM_MAXIMUM_MEMORY
- JVM_RESERVED_CODE_CACHE_SIZE
For passing other JVM properties like Synchrony Heap, Forward Proxy, etc, the Confluence Docker image provides another flag for that.
- JVM_SUPPORT_RECOMMENDED_ARGS
If we have one environment variable for JVM_SUPPORT_RECOMMENDED_ARGS we can pass that like below in the docker run command.
docker run -e JVM_SUPPORT_RECOMMENDED_ARGS=-Djavax.net.ssl.trustStore=/var/atlassian/application-data/confluence/cacerts -v confluenceVolume:/var/atlassian/application-data/confluence --name="confluence" -d -p 8090:8090 -p 8091:8091 atlassian/confluence
If you have more than one environment variable for JVM_SUPPORT_RECOMMENDED_ARGS, you can pass those variables in the same Run command or create one file, and that you can pass to the Confluence Run command.
Cause
If we don't pass these values properly, we will see some issues like below
JVM_SUPPORT_RECOMMENDED_ARGS='-Dsynchrony.memory.max=2g -Datlassian.mail.fetchdisabled=true -Datlassian.mail.senddisabled=true -Dcrowd.use.legacy.ad.incremental.sync=true'
Solution
The correct way to pass the value if they are more than one:
Option 1
Here we need to pass all values in " quotes
docker run -e JVM_SUPPORT_RECOMMENDED_ARGS="-Djavax.net.ssl.trustStore=/var/atlassian/application-data/confluence/cacerts -Dsynchrony.memory.max=2g -Datlassian.mail.fetchdisabled=true -Datlassian.mail.senddisabled=true -Dcrowd.use.legacy.ad.incremental.sync=true" -v confluenceVolume:/var/atlassian/application-data/confluence --name="confluence" -d -p 8090:8090 -p 8091:8091 atlassian/confluence
Option 2
Create env_variable file and set all variables without any quotes like the below:
JVM_SUPPORT_RECOMMENDED_ARGS= -Djavax.net.ssl.trustStore=/var/atlassian/application-data/confluence/cacerts -Dsynchrony.memory.max=2g -Datlassian.mail.fetchdisabled=true -Datlassian.mail.senddisabled=true -Dcrowd.use.legacy.ad.incremental.sync=true
Pass this file to Confluence Docker run command
docker run --env-file my-env.txt -v confluenceVolume:/var/atlassian/application-data/confluence --name="confluence" -d -p 8090:8090 -p 8091:8091 atlassian/confluence
To check if our environment variable is passed properly use the below command where the docker run command will be passed with the env option.
Option 1
If you running the command without an environment file:
docker run -e JVM_SUPPORT_RECOMMENDED_ARGS="-Djavax.net.ssl.trustStore=/var/atlassian/application-data/confluence/cacerts -Dsynchrony.memory.max=2g -Datlassian.mail.fetchdisabled=true -Datlassian.mail.senddisabled=true -Dcrowd.use.legacy.ad.incremental.sync=true" -v confluenceVolume:/var/atlassian/application-data/confluence --name="confluence" -d -p 8090:8090 -p 8091:8091 atlassian/confluence env
Option 2
If you are running Docker run the command with an environment variable:
docker run --env-file my-env.txt -v confluenceVolume:/var/atlassian/application-data/confluence --name="confluence" -d -p 8090:8090 -p 8091:8091 atlassian/confluence env
Note - If a Docker Compose file is used to run the Confluence container, then double quotes(") are not required inside the docker-compose.yml file to include multiple variables in the JVM_SUPPORT_RECOMMENDED_ARGS.
JVM_SUPPORT_RECOMMENDED_ARGS=-Djdk.tls.client.protocols=TLSv1.3 -Dupm.plugin.upload.enabled=true -Dsynchrony.memory.max=2g