Bamboo startup fails with error "Could not create connection to database server." (using MySQL)
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
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
Summary
When Bamboo starts (or it's being configured for the first time), it fails to connect to the MySQL Database.
Environment
Any supported Bamboo version connected to MySQL.
Diagnosis
In the logs (<bamboo_home>/logs/atlassian-bamboo.log
) the following error can be found:
2021-10-30 11:13:59,169 WARN [C3P0PooledConnectionPoolManager[identityToken->1bqox56ak1lq1hm5p7wori|4f17a326]-HelperThread-#2] [BasicResourcePool] com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@a2a7aa6 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception:
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
at sun.reflect.GeneratedConstructorAccessor27.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
at com.mysql.jdbc.Util.getInstance(Util.java:408)
(...)
Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
at sun.security.ssl.HandshakeContext.<init>(HandshakeContext.java:171)
at sun.security.ssl.ClientHandshakeContext.<init>(ClientHandshakeContext.java:106)
at sun.security.ssl.TransportContext.kickstart(TransportContext.java:238)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:394)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:373)
at com.mysql.jdbc.ExportControlled.transformSocketToSSLSocket(ExportControlled.java:149)
... 23 more
Cause
An SSL handshake problem happens when SSL is forced in one of the ends, in an environment where SSL was not configured.
Solution
A way to avoid this problem is by telling Bamboo to not use SSL explicitly. To do this:
- Stop Bamboo.
Edit the
<bamboo_home>/bamboo.cfg.xml
file and look for the following line:<property name="hibernate.connection.url">YOUR_DB_URL</property>
Add the "
useSSL=false
" flag so it looks like this:<property name="hibernate.connection.url">YOUR_DB_URL?useSSL=false</property>
If you have more than one parameter, separate them with a semicolon.
- Start Bamboo again.