MySQL Communications link failure

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

Database operations fail with the following error:

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.)
	at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)

Cause

MySQL server is timing out Bamboo servers' DB connections due to inactivity.

Resolution

This can be resolved in two ways.

Adding validation query to your Bamboo Server

If you're using a datasource on Tomcat server see, Surviving Connection Closures.

If you're using standalone Bamboo Server, then add the following to your BAMBOO-HOME/bamboo.cfg.xml file and restart Bamboo.

...
   <property name="hibernate.c3p0.validate">true</property>
...

 

Increasing time-out period on MySQL Server.

Alternatively, you can increase the wait_timeout to a greater value in your my.cnf file as per this document and restart MySQL Server.

Last modified on Jul 22, 2013

Was this helpful?

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