Bamboo is not able to stop a build

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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

Bamboo is not able to stop a build currently running in the build queue.

Diagnosis

When a user tries to stop a build from the UI, the action seems to do nothing. In the logs we will see a message similar to this one:

atlassian-bamboo.log

1 2 3 4 5 6 7 8 9 10 2022-06-21 06:28:46,560 INFO [http-nio-8080-exec-175] [DefaultStopBuildManager] : Request to stop 'PR-PL-JOB-1' 2022-06-21 06:28:46,560 INFO [http-nio-8080-exec-175] [DefaultStopBuildManager] Stopping build PR-PL-JOB-1 on agent 12341234 2022-06-21 06:28:46,564 INFO [http-nio-8080-exec-175] [ForceBuildStopper] Handling event com.atlassian.bamboo.event.BuildCanceledEvent[source=com.atlassian.bamboo.build.DefaultStopBuildManager@61d65d10] job=PR-PL-JOB #1 2022-06-21 06:28:46,568 ERROR [http-nio-8080-exec-175] [AsynchronousAbleEventDispatcher] There was an exception thrown trying to dispatch event [com.atlassian.bamboo.event.BuildCanceledEvent[source=com.atlassian.bamboo.build.DefaultStopBuildManager@61d65d10] job=PR-PL-JOB #1] from the invoker [com.atlassian.event.internal.ComparableListenerInvoker@51981cd8] com.atlassian.bamboo.build.BuildDefinitionManager$BuildDefinitionNotFoundException: No plan exists for PR-PL-JOB at com.atlassian.bamboo.build.DefaultBuildDefinitionManagerTx.getNotNullPlanByKey(DefaultBuildDefinitionManagerTx.java:141) at com.atlassian.bamboo.build.DefaultBuildDefinitionManagerTx.getBuildDefinition(DefaultBuildDefinitionManagerTx.java:58) at sun.reflect.GeneratedMethodAccessor8159.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) (...)

Cause

The key clue of the error is "No plan exists for...". The reason why this happens is because the exact PROJECT-PLAN-JOB definition doesn't exist anymore in the DB. Possible reasons for this can be:

  • The plan being moved from one project to another mid-execution.

  • The job being deleted.

  • The plan being deleted.

  • Any other that would break the key "PR-PL-JOB"

At this point, the build queue is in an inconsistent state. The build on queue is now orphan and cannot be recovered.

Solution

Restarting Bamboo will empty the build queue, solving the problem.

Updated on March 12, 2025

Still need help?

The Atlassian Community is here for you.