Uploaded image for project: 'Bitbucket Server'
  1. Bitbucket Server
  2. BSERV-12896

Merging PR from fork to main repo gives 500 error




      Issue Summary

      Unable to access PR after merge from fork to main.

      Steps to Reproduce

      Replication on Bitbucket 7.7.1 instance:

      1. Created a repository called new-repo, here: http://localhost:6771/b771/projects/FIR/repos/new-repo/browse. It has all the branches.
      2. Then forked it in my username ajaitly, called new-repo-fork: http://localhost:6771/b771/users/ajaitly/repos/new-repo-fork/browse
      3. Created a PR between branch bug/ARGUS-23284 from the fork repo, to the master branch in the main repo:
      4. Merged the PR, the option for Delete source after merging is checked
      5. Tried to access the Diff tab of the PR, got the same error:
      • The Overview and Builds tab are fine, even the Commits tab. Error occurs only when we open that commit, or any other commit in that PR and while accessing the Diff tab.
      • This issue occurs with other branches as well like feature type branch for example.

      Expected Results

      We should be able to see all the tabs of the PR successfully.

      Actual Results

      • We get an "Couldn't find ref error. The remote hung up unexpectedly" on the UI.
      • The below exception is thrown in the atlassian-bitbucket.log file:
        2021-06-09 10:08:00,236 DEBUG [http-nio-6771-exec-5] ajaitly @3AERBSx608x979x0 1bdz5uq 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/FIR/repos/avengers/pull-requests/3/changes HTTP/1.1" c.a.s.i.r.e.ServiceExceptionMapper Mapping ServiceException to REST response 500
        com.atlassian.bitbucket.scm.CommandFailedException: '/usr/bin/git fetch /Users/ajaitly/bitbucket-home/atlassian-bitbucket-7.7.1/shared/data/repositories/4 refs/heads/bug/ARGUS-23284:' exited with code 128 saying: fatal: couldn't find remote ref refs/heads/bug/ARGUS-23284
        fatal: the remote end hung up unexpectedly

        After a while when you try to access, it works fine. Attaching the full log file:


      If we try to access it after a while it may work. This issue is fixed in 7.12.0 and onwards, you can upgrade to that version or above that


        1. atlassian-bitbucket-2021-06-07.log
          18 kB
        2. atlassian-bitbucket-access-2021-06-07.0.log
          14 kB
        3. Creating PR.png
          Creating PR.png
          219 kB
        4. error screenshot.png
          error screenshot.png
          301 kB
        5. Merge PR.png
          Merge PR.png
          312 kB

        Issue Links



              khughes@atlassian.com Kristy
              04f11a9d4cc8 Apoorva
              1 Vote for this issue
              6 Start watching this issue



                Backbone Issue Sync