Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-12429

Pull request diff returns 500 Server Error if branches have no common ancestor

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Medium
    • 7.21.0
    • 7.3.0, 7.8.1, 7.11.1
    • Pull Requests
    • None

    Description

      Issue Summary

      When trying to display the diff of a Pull Request a 500 Server Error is displayed if the branches to be merged have no common ancestor.

      Steps to Reproduce

      1. Create two branches, ensuring they have no common ancestor
      2. Create a pull request involving these two branches
      3. Try to display the diff

      Expected Results

      The diff is displayed Despite the compare page showing a diff, Pull Requests are unable to display a diff if there is no common ancestor. Show an error message in the PR diff telling the user to merge the target branch into the source branch.

      Actual Results

      A 500 Server Error is displayed.
      The below exception is thrown in the atlassian-bitbucket.log file:

      com.atlassian.bitbucket.scm.git.command.merge.GitNoCommonAncestorException: Incoming branch "feature/brancha" shares no common ancestor with target branch "feature/branchb". It is not possible to produce an effective diff for pull request 1 in PROJ/repo.
      	at com.atlassian.stash.internal.scm.git.command.merge.AbstractMergeBaseExitHandler.isNonZeroExitCodeException(AbstractMergeBaseExitHandler.java:28)
      	at com.atlassian.bitbucket.scm.git.command.GitCommandExitHandler.evaluateThrowable(GitCommandExitHandler.java:110)
      	at com.atlassian.bitbucket.scm.git.command.GitCommandExitHandler.onError(GitCommandExitHandler.java:208)
      	at com.atlassian.bitbucket.scm.DefaultCommandExitHandler.onExit(DefaultCommandExitHandler.java:32)
      	at com.atlassian.bitbucket.internal.process.nu.NioNuProcessHandler.callExitHandler(NioNuProcessHandler.java:281)
      	at com.atlassian.bitbucket.internal.process.nu.NioNuProcessHandler.finish(NioNuProcessHandler.java:322)
      	at com.atlassian.bitbucket.internal.process.nu.NioNuProcessHandler.onExit(NioNuProcessHandler.java:123)
      	at com.zaxxer.nuprocess.internal.BasePosixProcess.onExit(BasePosixProcess.java:319)
      	at com.zaxxer.nuprocess.linux.ProcessEpoll.handleExit(ProcessEpoll.java:371)
      	at com.zaxxer.nuprocess.linux.ProcessEpoll.cleanupProcess(ProcessEpoll.java:334)
      	at com.zaxxer.nuprocess.linux.ProcessEpoll.process(ProcessEpoll.java:272)
      	at com.zaxxer.nuprocess.internal.BaseEventProcessor.run(BaseEventProcessor.java:81)
      	at com.zaxxer.nuprocess.linux.ProcessEpoll.run(ProcessEpoll.java:188)
      [...]
      

      Workaround

      Merge the two branches locally and push the merge as the tip of your source branch

      Attachments

        Issue Links

          Activity

            People

              bturner Bryan Turner (Inactive)
              cglockner Christian Glockner
              Votes:
              6 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Backbone Issue Sync