'GIT LFS is stuck in filter-process command

I have a GIT repository in Bitbucket, which uses GIT-LFS:

Whenever I try to clone the repository, git-lfs.exe gets stuck with the following command-line:

"C:\Program Files\Git\mingw64\bin\git-lfs.exe" filter-process

This happens in all of the following cases:

  1. When I try to clone the repository directoy (using git clone https://...)
  2. When I try to add the repository as a submodule (when running git submodule update)
  3. After I abort any of the above commands and run git reset --hard in the clone of the repository using GIT-LFS (which then has missing files and changes).

I am using

$ git-lfs --version
git-lfs/3.1.2 (GitHub; windows amd64; go 1.17.6)
$ git --version
git version 2.35.1.windows.2

and also had the same problem with

$ git-lfs --version
git-lfs/2.12.1 (GitHub; windows amd64; go 1.14.10; git 85b28e06)

I have several other working directories where the same repository is a submodule, and running git submodule update in these works fine (but there are no changes, so the command doesn't really have to do anything).

UPDATE: After enabling tracing, as suggested in this answer, and waiting long enough, it turned out GIT LFS is "stuck" while downloading the actual files from LFS, which just seems to be extremely slow (despite the total size of the files being only about 1 GB. File dates suggest the total download took over 1.5 hours!). It eventually finishes, and all files are where they should be. This maybe an issue related to Bitbucket. Any suggestions on what could cause this (other than contacting Atlassian support)?

(Any advice on how to debug this issue is also a valid answer)



Solution 1:[1]

The way you'd go about debugging this is to set GIT_TRACE=1, GIT_TRANSFER_TRACE=1, and GIT_CURL_VERBOSE=1 in the environment when performing your Git operation. (If you're using Git Bash, you can just prepend those, space-separated, to the git clone command.).

That will let you see if Git LFS is actually starting up and making progress. If so, you'll be able to see the requests being made and if there's a problem with them.

If it's not, then things are trickier. We have seen some cases where people using a non-default antivirus can see breakage because Git LFS is written in Go, and Go binaries tend to have unconventional structure. It's possible endpoint monitoring software on Windows could do the same thing. In either case, you should remove the affected software, reboot, and use just the default antivirus instead.

Solution 2:[2]

Sometimes, getting the files from the server may simply be very slow and take a long time, and you just have to wait for it to finish. You do not have to accept this, but it may be all you can do or may have time for in some situations.

If you are unsure whether it is stuck or just slow, check this answer to see what the command is doing while it is "stuck".

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 bk2204
Solution 2 Florian Winter