Search code examples
gitgithubgit-lfs

git pull fails when pulling lfs file


I'm getting an Authorization error and a 'smudge filter' error when I git pull from my publicly-visible repo. The error occurs when downloading a file that is pointed to by git lfs. My repo looks like this:

folder
folder
.gitattributes
python file
big_binary_file.h5

The error I get looks like this:

Downloading big_binary_file.h5 (262 MB)
Error downloading object: big_binary_file.h5: Smudge error: Error downloading big_binary_file.h5:
batch response: Authorization error: https://github.com/user/repo.git/objects/batch
Check that you have proper access to the repository

Errors logged to log_path/log.log
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: big_binary_file.h5: smudge filter lfs failed

I don't believe I have any authorization issues because the other files from my repo pull seamlessly. My repo is public and a git lfs file shouldn't have any special authorization needed, right?

My .gitattrbutes correctly identifies that '.h5' files should be fetched using LFS. It looks like this:

*.h5 filter=lfs diff=lfs merge=lfs -text

Has anyone gotten a similar error when they git pull and can they shine light on where I went wrong or what might be the cause of this?

Here are things I've tried (and you might try to if you run into this page looking for advice:)

My lfs.url is the same as remote.origin.url

  • I've looked at my git credentials to make sure they are set correctly.
  • I've verified that my repo is publicly visible and that my .gitattributes is setup correctly.
  • I've made sure git lfs is setup on my system and have used it to push to the same repo.
  • I've tried diagnosing git lfs logs last.
  • I tried using git reset and then pulling.

Solution

  • Your lfs.url should not be the same as your remote.origin.url. If you don't need a different LFS remote than your regular Git remote, you should omit the lfs.url configuration setting and let Git LFS autodiscover it.

    Otherwise, typically your lfs.url is supposed to end with /info/lfs. Thus, https://github.com/user/repo.git/info/lfs would be the right option.