Confluence Crashes with a Closed Connection Error
Symptoms
Confluence crashes with the following error in atlassian-confluence.log
:
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:
<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:
<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
Last modified on Mar 30, 2016
Powered by Confluence and Scroll Viewport.