Confluence XML Backup fails in Azure SQL Database with "The connection is closed" error
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
Problem
When taking XML backups in Confluence, the following errors appears after some time and XML backup fails.
1
2
WARN [Caesium-1-1] [v2.c3p0.impl.NewPooledConnection] log [c3p0] Another error has occurred [ com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed. ] which will not be reported to listeners!
com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed.
Diagnosis
Environment
This can happen when Confluence is using Azure SQL Database.
Diagnostic Steps
XML backup will kick off successfully and will continue for a while until it fails with this error. This issue is usually repeatable and the backup will fail after a specific period of time.
Cause
It's likely that Azure SQL drops the database connection after a certain time frame. For exact reason, it will be best to contact Azure SQL support.
Workaround
This issue can be avoided by changing the mode of SQL connectivity from proxy mode to redirect mode.
According to the guide of Azure SQL, these modes mean the following.
Redirect mode
A policy of Redirect means that connections after the TCP session is established to the Azure SQL database, the client session is then redirected to the proxy middleware with a change to the destination virtual IP from that of the Azure SQL Database gateway to that of the proxy middleware. Thereafter, all subsequent packets flow directly via the proxy middleware, bypassing the Azure SQL Database gateway.
Proxy Mode
A policy of Proxy means that the TCP session is established via the Azure SQL Database gateway and all subsequent packets flow via the gateway.
More information about this can be found in the following articles.
Was this helpful?