Skip to content
Latchkey

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.

Bamboo
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

  1. Open the plan branches list and find the branch flagged as missing.
  2. Delete the plan branch if its source branch is gone, or repoint it to an existing branch.
  3. Enable automatic branch cleanup so merged branches are removed.
Bamboo administration
# Plan > Branches > <branch> > Delete plan branch
# Plan configuration > Branches > enable "Delete plan branches" cleanup

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

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →