18

My repo uses git lfs. For a fresh clone, I ran:

git lfs install
git clone https://example.com/repo.git

The clone gets to the point where it starts downloading lfs files, gets to some file and then fails. The file at which it fails is different each time I attempt to clone. Very occasionally it succeeds.

Here is the output:

Cloning into 'repo'...
remote: Counting objects: 35699, done.
remote: Compressing objects: 100% (17678/17678), done.
remote: Total 35699 (delta 15603), reused 35553 (delta 15545)
Receiving objects: 100% (35699/35699), 231.45 MiB | 11.12 MiB/s, done.
Resolving deltas: 100% (15603/15603), done.
Downloading big_file.big (157.39 KB)
...
Downloading some_other_big_file.big (18.84 KB)
Error downloading object: some_other_big_file.big

Errors logged to blah.log
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: some_other_big_file.big: smudge filter lfs failed
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'

The lfs logs say:

Error downloading object: some_other_big_file.big

Smudge error: Error buffering media file: cannot write data to tempfile "blah.tmp": LFS: unexpected EOF:
github.com/git-lfs/git-lfs/errors.newWrappedError
        C:/Go/src/github.com/git-lfs/git-lfs/errors/types.go:166
github.com/git-lfs/git-lfs/errors.NewSmudgeError
        C:/Go/src/github.com/git-lfs/git-lfs/errors/types.go:252
github.com/git-lfs/git-lfs/lfs.PointerSmudge
        C:/Go/src/github.com/git-lfs/git-lfs/lfs/pointer_smudge.go:70
github.com/git-lfs/git-lfs/lfs.(*Pointer).Smudge
        C:/Go/src/github.com/git-lfs/git-lfs/lfs/pointer.go:65
github.com/git-lfs/git-lfs/commands.smudge
        C:/Go/src/github.com/git-lfs/git-lfs/commands/command_smudge.go:84
github.com/git-lfs/git-lfs/commands.filterCommand
        C:/Go/src/github.com/git-lfs/git-lfs/commands/command_filter_process.go:65
github.com/git-lfs/git-lfs/vendor/github.com/spf13/cobra.(*Command).execute
        C:/Go/src/github.com/git-lfs/git-lfs/vendor/github.com/spf13/cobra/command.go:477
github.com/git-lfs/git-lfs/vendor/github.com/spf13/cobra.(*Command).Execute
        C:/Go/src/github.com/git-lfs/git-lfs/vendor/github.com/spf13/cobra/command.go:551
github.com/git-lfs/git-lfs/commands.Run
        C:/Go/src/github.com/git-lfs/git-lfs/commands/run.go:66
main.main
        C:/Go/src/github.com/git-lfs/git-lfs/git-lfs.go:33
runtime.main
        C:/Go/src/runtime/proc.go:183
runtime.goexit
        C:/Go/src/runtime/asm_amd64.s:2086

If I try git lfs pull at this point, everything works fine.

Any idea what could be causing this failure to download the lfs files?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
UtterlyConfused
  • 983
  • 1
  • 10
  • 18

3 Answers3

30

I had the similar issue and there was already a bug reported with git lfs. While the bug was being resolved, this workaround helped me, where you skip the filter where it was failing.

// Skip smudge - We'll download binary files later in a faster batch
git lfs install --skip-smudge

// Do git clone here
git clone ...

// Fetch all the binary files in the new clone
git lfs pull

// Reinstate smudge
git lfs install --force

Credits: @strich

avp
  • 2,892
  • 28
  • 34
  • 2
    This allows me to download the LFS files as links but without the actual content. When doing the "git lfs pull" I get the "smudge filter lfs failed" error. – Kiteloopdesign May 15 '21 at 19:18
  • This helped me. But when I have multiple branches. I can't seem to checkout to any other branch this way. Although git lfs pull was a success, checking out to other branches still gives me smudge filter error. – kakyo Sep 18 '21 at 13:37
  • what is git clone "..." ? – TimChang Jan 27 '22 at 01:57
  • @TimChang: that refers to the link to the repository. i.e. git clone ssh://git@stash.srv.xxxxxx.git where xxxxxx is the name of the server where the code is hosted (I don't want to show here). – Khokhar Feb 24 '23 at 10:41
5

Try to do git lfs pull from GitBash.

It looks like the commandprompt isn't showing pass key popup, which is necessary for git lfs to work.

Kerwin Sneijders
  • 750
  • 13
  • 33
Vijay
  • 51
  • 1
  • 1
0

Git config settings

git config --global http.sslVerify true

git config --global http.sslBackend schannel

This worked for me

Syscall
  • 19,327
  • 10
  • 37
  • 52