Stash - Hibernate could not open a connection

Stash was unavailable last night. After some digging around it looks like it is either the connection to the database or tomcat memory. Can someone confirm which and what the solution is?

Jun 02, 2014 2:14:46 AM org.apache.catalina.core.StandardWrapperValve invoke

SEVERE: Servlet.service() for servlet [scmServlet] in context with path [] threw exception

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

[More of the error message here]

Caused by: org.hibernate.exception.JDBCConnectionException: Could not open connection

at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(

at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(

at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(

at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(

at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(

at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.getConnection(

at org.hibernate.internal.SessionImpl.connection(

at org.springframework.orm.hibernate4.HibernateTransactionManager.doBegin(

... 132 more

Caused by: java.sql.SQLException: Timed out waiting for a free available connection.

at com.jolbox.bonecp.BoneCP.getConnection(

at com.jolbox.bonecp.BoneCPDataSource.getConnection(

at com.atlassian.stash.internal.hibernate.DelegatingSwappableDataSource.getConnection(

at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(

at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(

at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(

... 135 more

1 answer

1 accepted

1 votes

Hi Jen,

For some reason no database connection could be obtained. This could be because the database server was temporarily unreachable or because the server was under such high load that all database connections were already in use.

Can you open a support ticket on https://support.atlassian.comand upload a support zip so we can have a look at your logs?



Does Stash have a temporary buffer where it writes locally if the databse is unavailable? If so, how long does it write for?

I'm asking because it looks like our database was not writable for two hours and for the first hour Stash continued to function.

We encountered the same issue yesterday. What was the resolution/root cause to this issue?

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

631 views 0 4
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot