Bamboo builds are getting hung and unable to stop it if buildresultsummary details are missing from the Database

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Medium
    • 10.2.18, 12.1.6
    • Affects Version/s: 10.2.9
    • Component/s: Builds
    • None
    • 1
    • Severity 3 - Minor

      Issue Summary

      The problem is seen when the users try to fail a Build. The Build never fails and on the screen you'll see message that the “Build is being stopped” but it never stops.

      This issue occurs when the Database(buildresultsummary table) is missing either one or more of the Job details of the plan which is being failed. 

      From the Bamboo UI, the issue occurred when the original plan was run and it failed and the user tried to stop the build and then re ran the same build without any changes.

      With the above steps I was not able to replicate the issue, but I can replicate the issue if I manually modify the entries in the Database.

      The original problem which we are trying to solve here is that failing a running build should be completed, irrespective of the Job status in the Database. 

      Steps to Reproduce

      1) Create a plan and keep the structure as follows > Stage 1 - 2 Jobs , Stage 2 - 1 Job , Stage 3 - 1 Job

      2) Keep only 1 agent available for the whole plan

      3) In both the Jobs of Stage 1, keep a script task with sleep 200 so that they run for little longer

      4)Run the Build, 1 Job from stage 1 would be running and 1 Job from stage 1 would get queued up

      5) Remove the queue job details from buildresultsummary_customdata and  buildresultsummary tables by manual deleting the entry

      6) Try to stop the Build

      Expected Results

      The Build should get failed

      Actual Results

      Build does not fail and plan re run gets disabled ( If concurrent build is not enabled for the plan ). You cannot fail the build. 

      See the below flow for the error message 

      1. We can check in the atlassian-bamboo.log file that the Job was queued up 

      2026-02-05 11:09:14,474 INFO [14-BAM::ChainExec:pool-15-thread-4] [ChainExecutionManagerImpl] Build PROJECT-PLAN-JOB-614 has been dispatched
      
      2026-02-05 11:09:14,478 INFO [14-BAM::ChainExec:pool-15-thread-4] [BuildQueueManagerImpl] Attempting to queue PROJECT-PLAN-JOB-614.
      
      2026-02-05 11:09:14,478 INFO [14-BAM::ChainExec:pool-15-thread-4] [ExecutionPhaseServiceImpl]  #614 (PROJECT-PLAN-JOB-614) queued
      

      2. If we try to fail the build, you'll see the below message in the logs

      2026-02-05 11:11:45,382 INFO [http-nio-8085-exec-63 url: /build/admin/stopPlan.action; user: testuser] [PlanStatePersisterImpl] 
      Updating delta states of build following PROJECT-PLAN-JOB-614
       
      2026-02-05 11:11:45,394 ERROR [http-nio-8085-exec-63 url: /build/admin/stopPlan.action; user: testuser] [LocalBuildResultProcessor] Result summary with result plan key PROJECT-PLAN-JOB-614 could not be found, aborting finishing...
      
      2026-02-05 11:11:45,394 INFO [http-nio-8085-exec-63 url: /build/admin/stopPlan.action; user: testuser] [ForceBuildStopper] Handling event com.atlassian.bamboo.event.BuildCanceledEvent[source=com.atlassian.bamboo.build.DefaultStopBuildManager@37832dfe] job=PROJECT-PLAN-JOB #614
      
      2026-02-05 11:11:45,394 INFO [http-nio-8085-exec-63 url: /build/admin/stopPlan.action; user: testuser] [ForceBuildStopper] getting the build definition from key: PROJECT-PLAN-JOB 

      3. Below error message is seen as Bamboo is not able to find the buildResultsSummary from the database. If you run a query in buildresultsummary table for this Job no rows would be returned. 

      2026-02-05 11:11:49,363 ERROR [scheduler_Worker-9] [JobRunShell] Job OrphanedBuildMonitorJobScheduler.OrphanedBuildMonitorJob threw an unhandled Exception: 
      java.lang.NullPointerException: Cannot invoke "com.atlassian.bamboo.resultsummary.BuildResultsSummary.getLifeCycleState()" because "buildResultsSummary" is null
      	at com.atlassian.bamboo.build.monitoring.OrphanedBuildMonitorJob.lambda$cleanUpBuildsWhichDidntFinalizeProperly$2(OrphanedBuildMonitorJob.java:227) ~[atlassian-bamboo-core-10.2.9.jar:?]
      	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:178) ~[?:?]
      

      Workaround

      Bamboo needs to be restarted for the build states to be restored for the particular buildresult.

      You can also enable concurrent build so that the option to run a new build is enabled and you are not stuck. 

              Assignee:
              Marcin Gardias
              Reporter:
              Shashank Kumar
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: