Login After a Long Inactivity on Confluence Fails with 'com.mysql.jdbc.CommunicationsException Communications link failure' CommunicationsException Error

Still need help?

The Atlassian Community is here for you.

Ask the community


When using MySQL, the first person that tries to login to confluence in the morning can't (after a 8 hour period of inactivity). After about 15 minutes, everybody can login without problem. The following appears in the atlassian-confluence.log:

2007-10-11 09:01:33,925 FATAL [TP-Processor8] [user.provider.jdbc.JDBCCredentialsProvider] handles Could not see if [fver] is handled
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:


MESSAGE: Broken pipe


java.net.SocketException: Broken pipe
	at java.net.SocketOutputStream.socketWrite0(Native Method)
	at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
	at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
	at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
	at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
	at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2692)
	at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2621)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1552)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1666)
	at com.mysql.jdbc.Connection.execSQL(Connection.java:2994)
	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:936)
	at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1030)
	at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
	at com.opensymphony.user.provider.jdbc.JDBCCredentialsProvider.handles(JDBCCredentialsProvider.java:131)
	at bucket.user.providers.ChainedUserProvider.handles(ChainedUserProvider.java:125)


MySQL's JDBC drivers usually close a connection that remains idle for a certain amount of time (normally eight hours). Since Confluence uses a connection pool, this means that pooled connections will be terminated if they are not used within a certain time period.


Using Direct JDBC connection

Append '?autoReconnect=true' to the end of your database's JDBC URL (without the quotes).

Using a Tomcat data source connection

The Commons DBCP (Database Connection Pool) which is used by the Tomcat application server can validate connections (by running a simple SQL query) before issuing them, and if a broken connection is detected, a new one is created to replace it. To do this you will need to set the "validationQuery" option on the database connection pool.

Add the 'validationQuery' and other parameter when configuring the datasource in the catalina/localhost/confluence.xml file (or <confluence install>/conf/server.xml if using standalone installation):

<value>select 1</value>

If you are using JNDI connection please add the following lines into your Resource:

validationQuery="select 1"
Last modified on Mar 30, 2016

Was this helpful?

Provide feedback about this article
Powered by Confluence and Scroll Viewport.