It is not possible to produce an effective diff for pull request
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
Summary
Problem
A pull request cannot be merged with a 500 error on a pull request stating:
Incoming branch 'branch' shares no common ancestor with target branch 'other_branch'. It is not possible to produce an effective diff for pull request 52 in PRO/web.
Diagnosis
You see the following in the atlassian-bitbucket.log
:
1
2
2016-05-09 10:02:45,101 DEBUG [http-nio-7990-exec-7] admin @1NICTZEx602x2096x1 1c2ktev 127.0.0.1 "GET /rest/api/latest/projects/WEB/repos/web/pull-requests/14027/merge HTTP/1.1" c.a.s.r.e.ServiceExceptionMapper Mapping ServiceException to REST response 500
com.atlassian.stash.scm.git.merge.NoCommonAncestorException: Incoming branch 'branch' shares no common ancestor with target branch 'other_branch'. It is not possible to produce an effective diff for pull request 52 in PRO/web.
Cause
Bitbucket's database is out of sync with it's file system usually because the database and file system were backed up separately while Bitbucket was still running. In the future shut down Bitbucket and then take a backup to ensure the filesystem is synchronized with the database.
Solution
Resolution
Decline and reopen the pull request which triggers a rescope of the pull request.
Was this helpful?