Bamboo throws Internal Server Error when accessing a plan
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Sometimes it is possible that you may see an Internal Server error while accessing a plan. The plan becomes inaccessible with 504 error in the UI.
Environment
7.1.2
Diagnosis
It is important to see what the error messages say. If you see the below logs, then this means Bamboo is taking long time to retrieve repository definitions:
2021-04-15 15:12:38,988 ERROR [13-PullRequestDetectionBackgroundThread:pool-20-thread-2] [BambooPluginUtils] An unexpected error has occurred while detecting pull requests: AXC-PITENTOC
io.atlassian.util.concurrent.LazyReference$InitializationException: org.springframework.dao.DataAccessResourceFailureException: could not extract ResultSet; nested exception is org.hibernate.exception.JDBCConnectionException: could not extract ResultSet
at io.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:156)
at io.atlassian.util.concurrent.LazyReference.get(LazyReference.java:116)
at com.atlassian.bamboo.plan.cache.AbstractImmutableChain.getPlanRepositoryDefinitions(AbstractImmutableChain.java:254)
at com.atlassian.bamboo.plan.PlanHelper.getPlanRepositoryDefinitions(PlanHelper.java:70)
at com.atlassian.bamboo.plan.PlanHelper.getDefaultPlanRepositoryDefinition(PlanHelper.java:90)
at com.atlassian.bamboo.plan.pullrequest.PullRequestDetector$1.lambda$null$0(PullRequestDetector.java:73)
at com.atlassian.bamboo.core.ScopedExclusionServiceHelper.lambda$adapt$2(ScopedExclusionServiceHelper.java:108)
at com.atlassian.bamboo.core.ScopedExclusionServiceImpl.withLock(ScopedExclusionServiceImpl.java:63)
at com.atlassian.bamboo.plan.pullrequest.PullRequestDetector$1.lambda$run$1(PullRequestDetector.java:71)
(...)
Though this is unusual, this means that something is cached and corrupted or creating something like an endless loop. However the reason for this is exactly unknown.
Solution
We will need refresh the cache and indexes for this work which means restarting Bamboo and trying again to access the plan. You will need to do the below steps:
- Stop Bamboo.
- Delete the content of the folders:
- <bamboo-home>/caches
- <bamboo-home>/temp
- <bamboo-home>/index
- Start Bamboo again.