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 vote
Accepted answer

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 Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

1,945 views 7 10
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