Collaborative editing stops working when enabling TLS on the database connection
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 enabling TLS on the database connection, users can't create or edit pages. After clicking on the Create or Edit button, the following error is displayed:
Something went wrong after loading the editor. Copy your unsaved changes and refresh the page to keep editing.
Environment
Confluence DC running with TLS database connection and using a custom truststore, we can identify that by the following JVM argument:
CATALINA_OPTS="-Djavax.net.ssl.trustStore=<pathtokeystore> ${CATALINA_OPTS}"
Diagnosis
Checking the atlassian-synchrony.log, we can find the following:
2024-06-10 09:22:13,177 DEBUG [280:StdOutHandler [/app/confluence/installation/jre/bin/java]] java.sql.SQLRecoverableException: IO Error: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target, connect lapse 4 ms., Authentication lapse 0 ms
....
2024-06-10 09:22:13,180 DEBUG [280:StdOutHandler [/app/confluence/installation/jre/bin/java]] \tat com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175)
2024-06-10 09:22:13,180 DEBUG [280:StdOutHandler [/app/confluence/installation/jre/bin/java]] \tat com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220)
Cause
This error can happen because Synchrony starts with the truststore from the bundled java for Confluence, then Synchrony is not able to connect to the database.
Solution
Edit or create the file <Confluence-home>/synchrony-args.properties as follows:
javax.net.ssl.trustStore=<pathtofile>
javax.net.ssl.trustStorePassword=<PASSWORD>
Then restart Synchrony on the Collaborative editing page.