Bamboo build queue status is not seen in Build Activity dashboard
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 builds do not show up under the Queue section inside the Build > Build activity page. The builds only start showing up on the page once the build starts (under the Building section).
Environment
Issue was seen in 8.0.4 but it can be applicable for other Bamboo versions as well.
Diagnosis
It is important to identify if all builds are in queued state and not seen in the build dashboard or just one. To understand if the build was queued immediately after it got dispatched, then it means that Bamboo did not spend too much time updating the repository cache. It should've appeared in the queue.
2021-11-30 11:10:37,991 INFO [7-DelayedChangeDetectionThread:pool-13-thread-5891] [ChainExecutionManagerImpl] Build NWP-JOB1-1 has been dispatched
2021-11-30 11:10:37,992 INFO [AtlassianEvent::0-BAM::EVENTS:pool-1-thread-6] [BuildQueueManagerImpl] Attempting to queue Git LFS - gitlfs testing - Default Job #37 (NWP-JOB1-1).
2021-11-30 11:10:37,993 INFO [AtlassianEvent::0-BAM::EVENTS:pool-1-thread-6] [ExecutionPhaseServiceImpl] Git LFS - gitlfs testing - Default Job #1 (NWP-JOB1-1) queued
2021-11-30 11:10:38,000 INFO [AtlassianEvent::0-BAM::EVENTS:pool-1-thread-8] [BitbucketServerBuildStatusUpdater] Sending build notification to Stash (build key: NWP-JOB1-1, repository: new-repo)
2021-11-30 11:10:38,007 INFO [AtlassianEvent::0-BAM::EVENTS:pool-1-thread-6] [BuildQueueManagerImpl] Sent ExecutableQueueUpdate: addToQueue, agents known to be affected: []
Along with the above message, if you see Bamboo reporting several errors attempting to access files inside the <BAMBOO-HOME>/shared/serverState/queue folder with the following stack:
2021-11-30 11:12:06,253 INFO [http-nio-8085-exec-55] [CommonContextMaps] Loading common context for GWP-JOB1-19
2021-11-30 11:12:06,253 INFO [http-nio-8085-exec-55] [XStreamQueuePersisterImpl] Loading offloaded context for: GWP-JOB1-19
2021-11-30 11:12:06,254 ERROR [http-nio-8085-exec-55] [JsonStreamResult]
java.lang.RuntimeException: Unexpected exception
at com.atlassian.bamboo.util.BambooObjectUtils.asRuntimeException(BambooObjectUtils.java:119)
at com.atlassian.bamboo.v2.build.queue.queues.XStreamQueuePersisterImpl.load(XStreamQueuePersisterImpl.java:70)
at com.atlassian.bamboo.v2.build.queue.queues.CommonContextMaps$ForwardingOffloadingCommonContextMap.load(CommonContextMaps.java:112)
at com.atlassian.bamboo.v2.build.queue.queues.CommonContextMaps$ForwardingOffloadingCommonContextMap.get(CommonContextMaps.java:91)
at com.atlassian.bamboo.v2.build.queue.queues.AbstractQueueOfExecutables.get(AbstractQueueOfExecutables.java:251)
at com.atlassian.bamboo.v2.build.queue.BuildQueueManagerImpl.peekContext(BuildQueueManagerImpl.java:323)
at com.atlassian.bamboo.v2.build.queue.QueueManagerView.getQueueView(QueueManagerView.java:70)
at com.atlassian.bamboo.ww2.actions.build.BuildJsonProviderAction.streamQueuedBuilds(BuildJsonProviderAction.java:160)
at com.atlassian.bamboo.ww2.actions.build.BuildJsonProviderAction.streamJson(BuildJsonProviderAction.java:154)
at com.atlassian.bamboo.ww2.actions.build.DashboardSummaryAction.streamJson(DashboardSummaryAction.java:12)
at com.atlassian.bamboo.struts.JsonStreamResult.execute(JsonStreamResult.java:35)
at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:375)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:279)
at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:181)
at com.atlassian.bamboo.ww2.interceptors.BambooWorkflowInterceptor.validateWorkflow(BambooWorkflowInterceptor.java:36)
at com.atlassian.bamboo.ww2.interceptors.BambooWorkflowInterceptor.doIntercept(BambooWorkflowInterceptor.java:20)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:99)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)
at com.atlassian.bamboo.ww2.interceptors.BambooValidationInterceptor.validate(BambooValidationInterceptor.java:32)
at com.atlassian.bamboo.ww2.interceptors.BambooValidationInterceptor.doIntercept(BambooValidationInterceptor.java:16)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:99)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.atlassian.bamboo.ww2.interceptors.FieldErrorUsageVerifier.intercept(FieldErrorUsageVerifier.java:43)
...
Caused by: java.io.FileNotFoundException: /var/atlassian/application-data/bamboo/shared/serverState/queue/GWP-JOB1-19 (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at com.atlassian.bamboo.v2.build.queue.queues.XStreamQueuePersisterImpl.load(XStreamQueuePersisterImpl.java:63)
... 277 more
Cause
It is important to understand here that generally, this issue appears when the builds are actually waiting for the change detection to happen and it is being loaded in the cache. If there are many builds which are referring to the same repositories then it this quite possible that you may encounter this issue.
Solution
Restarting Bamboo could help resolve this issue.