Bamboo unable to restart due to error; JDBCConnectionException: Unable to acquire JDBC Connection

Devendar Gangapuram
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 13, 2024

Hi Team, 

 

Our BAMBOO v8.0.5 running as windows service already from long time. But recently,  from last 3-4 weeks we are getting following error as not restarting BAMBOO automatically. 

BAMBOO logs error: 

2024-11-09 01:13:15,941 WARN [scheduler_Worker-4] [PoolBase] HikariPool-2 - Failed to validate connection ConnectionID:790 ClientConnectionId: 87be0d9f-6407-47f8-a44c-75cc51f41afd (The connection is closed.). Possibly consider using a shorter maxLifetime value. 2024-11-09 01:13:17,905 INFO [http-nio-8085-exec-1] [JohnsonFilter] The application is still starting up, or there are errors. Redirecting request from '/plugins/servlet' to '/error/errorEvents.action' 2024-11-09 01:13:22,903 INFO [http-nio-8085-exec-25] [JohnsonFilter] The application is still starting up, or there are errors. Redirecting request from '/plugins/servlet' to '/error/errorEvents.action' 2024-11-09 01:13:27,897 INFO [http-nio-8085-exec-10] [JohnsonFilter] The application is still starting up, or there are errors. Redirecting request from '/plugins/servlet' to '/error/errorEvents.action' 2024-11-09 01:13:32,896 INFO [http-nio-8085-exec-9] [JohnsonFilter] The application is still starting up, or there are errors. Redirecting request from '/plugins/servlet' to '/error/errorEvents.action' 2024-11-09 01:13:37,907 INFO [http-nio-8085-exec-18] [JohnsonFilter] The application is still starting up, or there are errors. Redirecting request from '/plugins/servlet' to '/error/errorEvents.action' 2024-11-09 01:13:42,903 INFO [http-nio-8085-exec-12] [JohnsonFilter] The application is still starting up, or there are errors. Redirecting request from '/plugins/servlet' to '/error/errorEvents.action' 2024-11-09 01:13:45,952 WARN [scheduler_Worker-4] [SqlExceptionHelper] SQL Error: 0, SQLState: null 2024-11-09 01:13:45,952 ERROR [scheduler_Worker-4] [SqlExceptionHelper] HikariPool-2 - Connection is not available, request timed out after 30009ms. 2024-11-09 01:13:45,952 ERROR [scheduler_Worker-4] [SqlExceptionHelper] The connection is closed. 2024-11-09 01:13:45,952 ERROR [scheduler_Worker-9] [StashTriggerQuartzJob] Unexpected error has occurred when checking connection to Stash repositories: falling back to polling com.google.common.util.concurrent.UncheckedExecutionException: org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2051) at com.google.common.cache.LocalCache.get(LocalCache.java:3962) at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3985) at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4946) at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4952) at com.atlassian.bamboo. at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:17) at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:41) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) Caused by: org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection at org.springframework.orm.hibernate5.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:598) at org.springframework.transaction.support.AbstractPlatformTransactionManager.startTransaction(AbstractPlatformTransactionManager.java:400) at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373) at sun.reflect.GeneratedMethodAccessor203.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208) a at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2155) at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2045) ... 84 more Caused by: org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:48) at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99) at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.acquireConnectionIfNeeded(LogicalConnectionManagedImpl.java:111) at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.getPhysicalConnection(LogicalConnectionManagedImpl.java:138) at org.hibernate.internal.SessionImpl.connection(SessionImpl.java:480) at org.springframework.orm.hibernate5.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:500) ... 105 more Caused by: java.sql.SQLTransientConnectionException: HikariPool-2 - Connection is not available, request timed out after 30009ms. at com.zaxxer.hikari.pool.HikariPool.createTimeoutException(HikariPool.java:676) at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:190) at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:155) at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:100) at org.hibernate.hikaricp.internal.HikariCPConnectionProvider.getConnection(HikariCPConnectionProvider.java:77) at org.hibernate.internal.NonContextualJdbcConnectionAccess.obtainConnection(NonContextualJdbcConnectionAccess.java:38) at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.acquireConnectionIfNeeded(LogicalConnectionManagedImpl.java:108) ... 108 more Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:234) at com.microsoft.sqlserver.jdbc.SQLServerConnection.checkClosed(SQLServerConnection.java:1130) at com.microsoft.sqlserver.jdbc.SQLServerConnection.setNetworkTimeout(SQLServerConnection.java:5509) at com.zaxxer.hikari.pool.PoolBase.setNetworkTimeout(PoolBase.java:550) at com.zaxxer.hikari.pool.PoolBase.isConnectionAlive(PoolBase.java:165) at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:179) ... 113 more 2024-11-09 01:13:45,952 ERROR [scheduler_Worker-4] [StashTriggerQuartzJob] Unexpected error has occurred when checking connection to Stash repositories: falling back to polling com.google.common.util.concurrent.UncheckedExecutionException: org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2051) at com.google.common.cache.LocalCache.get(LocalCache.java:3962) at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3985)

 

 

Could you please check , why this " Unable to acquire JDBC Connection" causing?

 

Fast reply helps us to avoid PROD issues. Thank you in advance. 

Dev G. 

1 answer

0 votes
Devendar Gangapuram
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 18, 2024

Hi all,

 

Please some one help me on this error to resolve. 

 

 

 

Thank you in advance,

Dev G

Shashank Kumar
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 18, 2024

Hello Dev,

welcome to Atlassian community

Looking at the error looks like Bamboo is not able to get the connection from the Database > 

org.springframework.transaction.CannotCreateTransactionException: Could not 
open Hibernate Session for transaction; nested exception is org.hibernate.
exception.JDBCConnectionException: Unable to acquire JDBC Connection at

Please check if the DB server is available from the Bamboo server, you can follow How to troubleshoot Bamboo connectivity issues with Databases to troubleshoot the DB server connectivity from Bamboo application.

Regards,

Shashank Kumar

**please don't forget to Accept the answer if your query was answered**

 

Like Steffen Opel _Utoolity_ likes this
Devendar Gangapuram
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 21, 2024

Thank you for the reply @Shashank Kumar

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events