Bamboo branch plan "branch not found" in CI
A Bamboo plan branch tracks a repository branch. When that source branch is deleted or renamed, the plan branch cannot resolve it and the build fails with the branch not found.
What this error means
A branch plan build fails during checkout with "branch <name> not found" or "reference not found", or the plan branch is flagged as having a missing branch.
Updating source to branch 'feature/login' failed:
reference 'refs/heads/feature/login' not found - the branch may have been deleted.Common causes
The source branch was deleted or renamed
The repository branch the plan branch tracks was removed or renamed, so the ref no longer resolves during checkout.
Stale plan branch after a merge
The branch was merged and deleted upstream, but the Bamboo plan branch was left behind pointing at the gone ref.
How to fix it
Delete or repoint the stale plan branch
- Open the plan branches list and find the branch flagged as missing.
- Delete the plan branch if its source branch is gone, or repoint it to an existing branch.
- Enable automatic branch cleanup so merged branches are removed.
# Plan > Branches > <branch> > Delete plan branch
# Plan configuration > Branches > enable "Delete plan branches" cleanupRecreate the branch if it was removed by mistake
If the source branch was deleted in error, push it back to the repository so the plan branch can resolve it again.
How to prevent it
- Enable automatic plan branch cleanup for merged or deleted branches.
- Coordinate branch deletion with any running branch builds.
- Review orphaned plan branches periodically.