Git repository indexing fails because it cannot delete the branch which you are currently on

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

The following appears in the atlassian-fisheye.log:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 2013-04-04 17:14:08,986 ERROR - Error removing local branch: [error: Cannot delete the branch 'the_branch_name' which you are currently on.] com.atlassian.utils.process.ProcessException: While executing: "git branch -D the_branch_name " in [/opt/fisheye/FISHEYE_INST/var/cache/REPO_NAME/clone] at com.atlassian.fisheye.dvcs.client.DvcsContext.executeCommand(DvcsContext.java:262) at com.atlassian.fisheye.dvcs.client.DvcsContext.executeCommand(DvcsContext.java:254) at com.atlassian.fisheye.git.GitScanner.removeLocalBranch(GitScanner.java:225) at com.atlassian.fisheye.git.GitScanner.fetchLatest(GitScanner.java:202) at com.atlassian.fisheye.dvcs.DvcsScanner.updateClone(DvcsScanner.java:153) at com.atlassian.fisheye.dvcs.DvcsScanner.updateLocalRepoCache(DvcsScanner.java:140) at com.cenqua.fisheye.rep.BaseRepositoryScanner.ping(BaseRepositoryScanner.java:175) at com.cenqua.fisheye.rep.BaseRepositoryEngine.doSlurp(BaseRepositoryEngine.java:92) at com.cenqua.fisheye.rep.RepositoryEngine.slurp(RepositoryEngine.java:382) at com.cenqua.fisheye.rep.ping.OneOffPingRequest.doRequest(OneOffPingRequest.java:28) at com.cenqua.fisheye.rep.ping.PingRequest.process(PingRequest.java:58) at com.cenqua.fisheye.rep.RepositoryHandle.processPingRequests(RepositoryHandle.java:198) at com.cenqua.fisheye.rep.RepositoryHandle.access$100(RepositoryHandle.java:50) at com.cenqua.fisheye.rep.RepositoryHandle$2.run(RepositoryHandle.java:156) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: com.atlassian.utils.process.ProcessException: Non-zero exit code: 1 at com.atlassian.utils.process.PluggableProcessHandler.complete(PluggableProcessHandler.java:83) at com.atlassian.utils.process.ExternalProcessImpl.finish(ExternalProcessImpl.java:308) at com.atlassian.utils.process.ExternalProcessImpl.execute(ExternalProcessImpl.java:351) at com.atlassian.fisheye.dvcs.client.DvcsContext.executeCommand(DvcsContext.java:259)

Cause

Fisheye is not aware of some commits that have been deleted from one of the repositories. The repository can be identified from the path in the error message, for example in the above stacktrace, the repository is REPO_NAME.

Resolution

A re-clone and re-index of the repository is required. This can be done by performing the following:

  1. Navigate to Administration >> Repository Settings >> Repositories

  2. Select the repository that is affected to bring up the repository Summary Page

  3. Select Maintenance on the left.

  4. Next to Re-clone and Re-index, click on the Start button

This will have Fisheye to re-index all contents related to that repository.

ℹ️ Depending on the size of the repository it may take a lot of time so it is recommended to perform this outside of business hours.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.