MySQL Communications link failure

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

Database operations fail with the following error:

1 2 3 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.

1 2 3 ... <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.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.