Can't detect branches for plan error even though the Automatic branch management is disabled

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

Problem

Automatic branch management is disabled.

The Plan Summary page have the error "Can't detect branches for plan PROJ-PLAN"

The following appears in the atlassian-bamboo.log

1 2 2016-05-31 16:39:15,101 DEBUG [11-BranchDetectionBackgroundThread:pool-19-thread-2] [BranchDetectionServiceImpl] Detecting already existing branches for plan PROJ-PLAN 2016-05-31 16:39:15,463 INFO [11-BranchDetectionBackgroundThread:pool-19-thread-2] [DefaultErrorHandler] Recording an error: Can't detect branches for plan PROJ-PLAN

Cause

Bamboo detected a branch to be initialized for that Plan in the database and try to connect to the repository to initialize it.

Resolution

  1. Shutdown Bamboo

  2. Backup database for rollback purposes

  3. Search for the problematic data with the following SQL query depending on the build key:

    1 SELECT * FROM VCS_BRANCH WHERE CHAIN_ID=(SELECT BUILD_ID FROM BUILD WHERE FULL_KEY='PROJ-PLAN');

    The problematic data is the result with NAME that contain "initialize.chain.branches".

  4. Delete the problematic data

    Always back up your data before making any database modifications. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.

    1 DELETE FROM VCS_BRANCH WHERE CHAIN_ID=(SELECT BUILD_ID FROM BUILD WHERE FULL_KEY='PROJ-PLAN') AND NAME like '%initialize.chain.branches%';
  5. Restart Bamboo

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.