Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Pull requests show that target branch is not available

Jon March 6, 2019

After Upgrading to Bitbucket Server 6.1 from 5.16, Pull Reuqests that were open are now stating that "The branch '[branch]' does not exist. The effective diff cannot be displayed until '[branch]' is pushed and the pull request reopened."  

[Branch name] is any target branch for a pull request that was opened prior to the upgrade.

However, when I look at the list of branches in the repository, the branch in question is absolutely there.

Does anyone have any ideas?

2 answers

1 accepted

0 votes
Answer accepted
Jon March 7, 2019

I ended up declining and re-opening the pull requests and that fixed it.

0 votes
Bryan Turner
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 6, 2019

@Jon

Does this happen for every pull request? Or only some? The error message in question means that Bitbucket Server ran a `git merge-base` between the latest commits on the source and target branches (as recorded in your database) and Git printed "fatal: Not a valid commit name", indicating that one (or both) of the commits did not exist in the repository.

Please open a support case. Whatever the issue is, it's not something we'll be able to effectively troubleshoot here. On a support case, you can share additional logging and context to help us resolve the issue. It might be helpful to reference this question when raising the issue with support.

Best regards,
Bryan Turner
Atlassian Bitbucket

Bryan Turner
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 6, 2019

If the branch name shown in the error message is for the pull request's target, that means the "Not a valid commit name" message from `git merge-base` matches the commit ID recorded in the database for the pull request's target branch. (Otherwise the UI message would show the source branch's name.)

When the upgrade was performed, did you perhaps take an inconsistent backup of your home directory and database and perform the upgrade? The most likely culprit for an issue like this is that your repository data is older than your database data, and so pull requests in the database reference commits that aren't in the repository.

Note that the branch itself may exist; what matters is whether the branch still includes the commit the pull request is looking for. You can check the commits the pull request is expecting by retrieving it via REST (e.g. https://bitbucket.example.com/projects/KEY/repos/slug/pull-requests/1, substituting "KEY", "slug" and "1" for the appropriate project key, repository slug and pull request ID).

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events