Build had to be cancelled: it was marked as in progress in DB but no agents were assigned to it
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
Builds get stuck in the "Build is currently being stopped" while the build status shows "Building".
The agent that was processing the build has already moved on to other builds.
The build logs show the following messages:
13-Jun-2022 05:23:21 Build PROJ-PLAN-JOB-# had to be cancelled: it was marked as in progress in DB but no agents were assigned to it.
Environment
Observed on Bamboo 8.
Diagnosis
Looking at the build logs the error messages below can be seen several times:
13-Jun-2022 05:23:21 Build PROJ-PLAN-JOB-# had to be cancelled: it was marked as in progress in DB but no agents were assigned to it.
By checking the plan's audit logs (Plan > Actions > Configure Plan > Audit log), the following messages regarding invalid repository configuration can be seen:
Plan 'PROJ-PLAN'detected that the repository is invalid. The Plan will be disabled.
Cause
Mapped until now that one of the possible causes for this issue is the plan having invalid repository configurations.
Solution
Try re-saving the repository settings in the Bamboo plan: Plan > Actions > Configure Plan > Repositories > Click on the impacted repository > Save repository.
If there are any repositories that are no longer valid, please make sure to remove them from the configuration.