Bamboo Deployment Crashes on Hibernate JDBC Connection Error

We're experiencing intermittent deployment failures.  It seems to stem from Hibernate not being able to obtain a connection from our MySQL database.  Bamboo 5.8.1 and MySQL 5.5, both running as Windows NT services. At the lowest level it's a ResourcePool exception.  Has anyone out there seen this? i can't find any reference to it on this site.

thanks,

ed

 

 

 

org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection

...

Caused by: java.sql.SQLException: An SQLException was provoked by the following failure: com.mchange.v2.resourcepool.ResourcePoolException: A ResourcePool cannot acquire a new resource -- the factory or source appears to be down

 

2 answers

1 vote

Hello Edward,

Thank you for your question.

Under "<bamboo-home>/bamboo.cfg.xml" you will find the following property that describes how many database connection poll Bamboo will be running:

&lt;property name="hibernate.c3p0.max_size"&gt;100&lt;/property&gt;

The default 100 is given when installing Bamboo 5.8.1, however, if you came in from an upgrade, this value could be different.

Based on the log entry above, it seems the value above is not enough to handle the amount of requests to your database and, in this case, the same needs to be increased (i.e.: 200).

However, only increasing Bamboo will not make any difference if you MySQL is not configured to handle those connections. Please, connect to you MySQL database from Command Prompt / Terminal using the information presented in "<bamboo-home>/bamboo.cfg.xml":

# connect to database
mysql -u USERNAME -pPASSWORD -h HOSTNAMEORIP DATABASE
 
# show maximum connections value
mysql&gt; show variables like '%max_connections%';
+-----------------------------------------------+-----------------+
| Variable_name                                 | Value           |
+-----------------------------------------------+-----------------+
| max_connections                               | 100             |
+-----------------------------------------------+-----------------+

If the value in max_connections is lower than the one increased in Bamboo, please open my.ini (Windows) / my.cnf (Linux/MacOSX) and increase this value.

For any change described in here it is required restart the application so the changes will be applied.

If you find this answer useful, I would kindly ask you to accept it so the same will be visible to others who might be facing the same issue you have inquired.

Thank you for your understanding.

Kind regards,
Rafael P. Sperafico
Atlassian Support

It may be because of memory leak, please restart the MySQL to see if it helps.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,368 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you