Pull request merge checks fail if LFS client is installed

XMLWordPrintable

    • 5
    • Severity 3 - Minor
    • 12

      Summary

      If the user running Bitbucket Server has Git LFS installed, and configured in their .gitconfig file, pull requests between repositories which have a .gitattributes file that lists lfs filters will result in false merge conflicts.

      Steps to Reproduce

      1. Push a repository with LFS content and a .gitattributes that includes some lfs filters (these are created by running "git track...")
      2. Create a fork of this repository
      3. Modify one of the LFS tracked files and push changes
      4. Create pull request from the fork to the origin

      Expected Results

      PR can be merged without conflicts

      Actual Results

      The PR shows that there are merge conflicts which need to be resolved before merging.

      The below exception is thrown in the xxxxxxx.log file:

      2017-03-02 17:40:44,936 DEBUG [http-apr-7990-exec-10] jeff @16IFE63x1060x24009x0 akd42i 10.0.2.2,192.168.5.2 "GET /rest/api/latest/projects/TB/repos/scratch/pull-requests/2/merge HTTP/1.1" c.a.s.i.s.g.p.DefaultPullRequestAutoMergeStrategy TM/scratch[275]: Pull request 158@3 failed automatic merging
      com.atlassian.bitbucket.scm.MergeException: The merge could not be completed automatically. Please clone 'TB/scratch', checkout 'devel' from 'Tb/scratch' and merge 'feature/branch' from 'TB/fork' (or commit 'aac6b95cff7e83104e25f8b2160efa5ca7b07ab8') manually, resolving any conflicts, and push the results.
      at com.atlassian.stash.internal.scm.git.merge.MergeCommand.newMergeException(MergeCommand.java:170) ~[bitbucket-git-4.9.1.jar:na]
      ...
      Caused by: com.atlassian.bitbucket.scm.CommandFailedException: '/usr/bin/git merge -m Automatic merge --no-ff --log aac6b95cff7e83104e25f8b2160efa5ca7b07ab8' exited with code 128 saying: Downloading file.tgz (216.53 MB)
      Error downloading object: file.tgz (884a5c896a29fa1e4685263d7a873f5f2f030ce0d3b1c61875c8760f6b3354ac)
      Errors logged to /var/atlassian/application-data/bitbucket/tmp/git/scratch-work6156018846200346686.git/.git/lfs/objects/logs/20170301T094743.361000284.log
      Use `git lfs logs last` to view the log.
      error: external filter git-lfs smudge – %f failed 2
      error: external filter git-lfs smudge – %f failed
      fatal: file.tgz: smudge filter lfs failed
      at com.atlassian.bitbucket.scm.DefaultCommandExitHandler.onError(DefaultCommandExitHandler.java:46) ~[bitbucket-spi-4.9.1.jar:na]
      ...
      Caused by: com.atlassian.utils.process.ProcessException: Non-zero exit code: 128
      

      Workaround

      Uninstall Git LFS for the user running Bitbucket Server by running git-lfs uninstall

              Assignee:
              Michael Studman (Inactive)
              Reporter:
              Jeff Thomas
              Votes:
              3 Vote for this issue
              Watchers:
              16 Start watching this issue

                Created:
                Updated:
                Resolved: