Confluence Crashes with a Closed Connection 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

Symptoms

Confluence crashes with the following error in atlassian-confluence.log:

1 2 3 4 5 6 7 8 9 2013-07-24 10:56:42,602 WARN [main] [springframework.jdbc.support.SQLErrorCodesFactory] getErrorCodes Error while extracting database product name - falling back to empty error codes org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: Closed Connection at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:296) at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:320) at org.springframework.jdbc.support.SQLErrorCodesFactory.getErrorCodes(SQLErrorCodesFactory.java:216) at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.setDataSource(SQLErrorCodeSQLExceptionTranslator.java:140) at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.<init>(SQLErrorCodeSQLExceptionTranslator.java:103) at org.springframework.jdbc.support.JdbcAccessor.getExceptionTranslator(JdbcAccessor.java:99) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:407)

Cause

There's a ReadTimeout property set in your database connection properties. For example:

1 2 3 4 5 6 7 8 9 10 11 <Resource name="jdbc/confluenceDS" auth="Container" type="javax.sql.DataSource" username="asda" password="sadas" driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@( DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = aet)(PORT = 1531)) (ADDRESS = (PROTOCOL = TCP)(HOST = aet)(PORT = 1531)) (LOAD_BALANCE = yes) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = AETU) ))" connectionProperties="SetBigStringTryClob=true;oracle.jdbc.ReadTimeout=50000;" maxActive="30" maxIdle="10" maxWait="-1" validationQuery="select 1 from dual"/> />

In the above configuration, that property is oracle.jdbc.ReadTimeout=50000;.

Resolution

  • Remove the ReadTimeout property in the database connection properties. For the example above, change the datasource to this:

    1 2 3 4 5 6 7 8 9 10 11 <Resource name="jdbc/confluenceDS" auth="Container" type="javax.sql.DataSource" username="asda" password="sadas" driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@( DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = aet)(PORT = 1531)) (ADDRESS = (PROTOCOL = TCP)(HOST = aet)(PORT = 1531)) (LOAD_BALANCE = yes) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = AETU) ))" connectionProperties="SetBigStringTryClob=true;" maxActive="30" maxIdle="10" maxWait="-1" validationQuery="select 1 from dual"/> />

    (Remove the oracle.jdbc.ReadTimeout=50000; )

  • Restart Confluence

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.