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(SQLStateConversionDelegate.java:132)

at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)

at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126)

at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:112)

at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:235)

at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.getConnection(LogicalConnectionImpl.java:171)

at org.hibernate.internal.SessionImpl.connection(SessionImpl.java:450)

at org.springframework.orm.hibernate4.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:429)

... 132 more

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

at com.jolbox.bonecp.BoneCP.getConnection(BoneCP.java:503)

at com.jolbox.bonecp.BoneCPDataSource.getConnection(BoneCPDataSource.java:114)

at com.atlassian.stash.internal.hibernate.DelegatingSwappableDataSource.getConnection(DelegatingSwappableDataSource.java:48)

at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:139)

at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:380)

at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:228)

... 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?

Cheers,

Michael

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 ...

194 views 3 6
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