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

PR merge using Rebase and merge times out

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • High
    • 8.12.0, 8.8.7, 8.9.4, 8.10.4, 8.11.3
    • 8.0.0, 8.1.0, 8.2.0, 8.0.1, 8.1.1, 8.0.2, 8.1.2, 8.2.1, 8.3.0, 8.0.3, 8.1.3, 8.2.2, 8.3.1, 8.0.4, 8.1.4, 8.2.3, 8.0.5, 8.1.5, 8.2.4, 8.3.2, 8.3.3, 8.3.4, 8.4.0, 8.4.1, 8.4.2, 8.4.3, 8.4.4, 8.5.0, 8.5.1, 8.5.2, 8.5.3, 8.5.4, 8.6.0, 8.6.1, 8.6.2, 8.6.3, 8.6.4, 8.7.0, 8.7.1, 8.7.2, 8.7.3, 8.7.4, 8.8.0, 8.8.1, 8.8.2, 8.8.3, 8.8.4, 8.8.5, 8.9.0, 8.9.1, 8.9.2, 8.10.0, 8.10.1, 8.10.2, 8.11.0, 8.11.1, 8.8.6
    • Pull Request - Merge

    Description

      Issue Summary

      While trying to merge PR using Rebase and merge or Rebase and fast-forward strategy getting the message: 'git cat-file --batch' timed out; exited with code 0 on the Bitbucket UI and in the logs.

      This is reproducible on Data Center: Not tried

      Steps to Reproduce

      1. Step 1: Create branch in repository where the first file is encountered within a subdirectory more than 1 level deep
      2. Step 2: Create a PR between another branch with the same kind of directory structure (this can happen if either source or destination branch has only folders at the top-level or both the branches have only folders at the top-level)
      3. Step 3: Try to merge using Rebase and Merge strategy

      Expected Results

      The PR will be merged successfully.

      Actual Results

      The PR merge will timeout after around 5 minutes
      The below exception is thrown in the atlassian-bitbucket.log file:

      2023-04-05 18:49:31,022 DEBUG [http-nio-6882-exec-8] ajaitly @XEBU6Fx1124x347x0 1c0nnck 0:0:0:0:0:0:0:1 "POST /rest/api/latest/projects/FIR/repos/dir-test/pull-requests/2/merge HTTP/1.1" c.a.s.i.r.e.ServiceExceptionMapper Mapping ServiceException to REST response 500
      com.atlassian.bitbucket.scm.CommandTimeoutException: 'git cat-file --batch' timed out; exited with code 0
      	at com.atlassian.stash.internal.scm.git.mesh.DefaultErrorTranslator.translateTimeout(DefaultErrorTranslator.java:426)
      ...............
      

      can also be exited with code 15 in some cases.

      • Bitbucket Profiler logs:
        2023-04-05 18:49:31,028 | http-nio-6882-exec-8 | @XEBU6Fx1124x347x0 | ajaitly | 1c0nnck
        [300082.5ms] - "POST /rest/api/latest/projects/FIR/repos/dir-test/pull-requests/2/merge HTTP/1.1"
         [300066.3ms] - PullRequest com.atlassian.bitbucket.pull.PullRequestService.merge(PullRequestMergeRequest)
          [1.6ms] - InternalPullRequest com.atlassian.stash.internal.pull.PullRequestDao.findByRepositoryScopedId(int,long)
          [1.1ms] - Object com.atlassian.stash.internal.Dao.update(Object)
          [300050.8ms] - Branch com.atlassian.stash.internal.scm.git.mesh.RpcPullRequestClient.merge(PullRequest,Builder,String)
          [2.2ms] - Object com.atlassian.stash.internal.Dao.update(Object)
        
      • Bitbucket Access logs:
        0:0:0:0:0:0:0:1 | http | o@XEBU6Fx1124x347x0 | ajaitly | 2023-04-05 18:49:31,028 | "POST /rest/api/latest/projects/FIR/repos/dir-test/pull-requests/2/merge HTTP/1.1" | "http://localhost:6882/b882/projects/FIR/repos/dir-test/pull-requests/2/overview" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36" | 500 | 133 | 164 | - | 300083 | 1c0nnck | 
        
      • Mesh application logs
        2023-04-05 18:44:23,860 DEBUG [grpc-server:thread-19] ajaitly 4518L3RRx1124x240x2 @XEBU6Fx1124x324x0 127.0.0.1 "PullRequestService/UpdateRefs" (>1 <0) c.a.bitbucket.mesh.git.RawGitAgent afd42a5d473d451cd133-12: Could not resolve refs/pull-requests/2/from directly or from packed-refs
        2023-04-05 18:44:23,861 DEBUG [grpc-server:thread-19] ajaitly 4518L3RRx1124x240x2 @XEBU6Fx1124x324x0 127.0.0.1 "PullRequestService/UpdateRefs" (>1 <0) c.a.bitbucket.mesh.git.RawGitAgent afd42a5d473d451cd133-12: Could not resolve refs/pull-requests/2/merge directly or from packed-refs
        2023-04-05 18:44:23,862 DEBUG [grpc-server:thread-19] ajaitly 4518L3RRx1124x240x2 @XEBU6Fx1124x324x0 127.0.0.1 "PullRequestService/UpdateRefs" (>1 <0) c.a.bitbucket.mesh.git.RawGitAgent afd42a5d473d451cd133-12: Could not resolve stash-refs/pull-requests/2/from directly or from packed-refs
        2023-04-05 18:44:23,864 DEBUG [grpc-server:thread-19] ajaitly 4518L3RRx1124x240x2 @XEBU6Fx1124x324x0 127.0.0.1 "PullRequestService/UpdateRefs" (>1 <0) c.a.bitbucket.mesh.git.RawGitAgent afd42a5d473d451cd133-12: Could not resolve refs/pull-requests/2/from directly or from packed-refs
        

      Workaround

      • Workaround 1: Try using a different merge strategy for merging the pull request (for example "Merge commit --no-ff" or "Squash --squash")
      • Workaround 2: Add a file to the top-level of the repository

      Attachments

        1. error-message.png
          error-message.png
          286 kB
        2. no-error-message.png
          no-error-message.png
          257 kB

        Issue Links

          Activity

            People

              khughes@atlassian.com Kristy
              04f11a9d4cc8 Apoorva
              Votes:
              3 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: