Bamboo is not able to stop a build

Still need help?

The Atlassian Community is here for you.

Ask the community


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

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

Environment

Any supported version of Bamboo. 

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
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.


Last modified on Aug 12, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.