Skip to content

git-lfs 3.0.0 - zero byte files not tracked by git-lfs are resulting in Object does not exist on the server #4645

Closed

Description

@EricVogl-carta

Describe the bug
In two separate repositories today, after upgrading to git lfs 3.0.0 (these happened to be on circle-ci pipelines with unpinned versions of git lfs), the following error occurred:

[e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855] Object does not exist on the server: [404] Object does not exist on the server
error: failed to fetch some objects from 'https://github.com/<repo name redacted>/info/lfs'

Oddly enough - the exact same object ID was reported in two completely different repos.

Running

git log --all -p -S e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

Did not return any objects.

However, running

git-lfs ls-files --all | grep e3b0c44

returned a series of files, none of which are being tracked by git-lfs, all of which are zero bytes in size.

Pinning the version of git-lfs used to 2.13.3 resolved the issue.

To Reproduce
Steps to reproduce the behavior:

  1. Create a repository with an empty file in it and some other non-empty file tracked with git-lfs
  2. Pull

Expected behavior
No error, as these files are not tracked by git lfs.

System environment
Ubuntu 16.04 (ubuntu-1604:202007-01) running on circle-ci
Git config:

filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
url.ssh://[email protected]=https://github.com
gc.auto=0
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
[email protected]:carta/ds-reporting-service.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
lfs.repositoryformatversion=0

Output of git lfs env

git-lfs/3.0.0 (GitHub; linux amd64; go 1.17)
git version 2.27.0

Endpoint=https://github.com/<redacted repo name>.git/info/lfs (auth=none)
  [email protected]:<redacted>/<redacted repo name>.git
LocalWorkingDir=/home/circleci/<redacted repo name>
LocalGitDir=/home/circleci/<redacted repo name>/.git
LocalGitStorageDir=/home/circleci/<redacted repo name>/.git
LocalMediaDir=/home/circleci/<redacted repo name>/.git/lfs/objects
LocalReferenceDirs=
TempDir=/home/circleci/<redacted repo name>/.git/lfs/tmp
ConcurrentTransfers=8
TusTransfers=false
BasicTransfersOnly=false
SkipDownloadErrors=false
FetchRecentAlways=false
FetchRecentRefsDays=7
FetchRecentCommitsDays=0
FetchRecentRefsIncludeRemotes=true
PruneOffsetDays=3
PruneVerifyRemoteAlways=false
PruneRemoteName=origin
LfsStorageDir=/home/circleci/<redacted repo name>/.git/lfs
AccessDownload=none
AccessUpload=none
DownloadTransfers=basic,lfs-standalone-file,ssh
UploadTransfers=basic,lfs-standalone-file,ssh
GIT_ASKPASS=echo
GIT_EXEC_PATH=/usr/lib/git-core
git config filter.lfs.process = "git-lfs filter-process"
git config filter.lfs.smudge = "git-lfs smudge -- %f"
git config filter.lfs.clean = "git-lfs clean -- %f"

Activity

  1. slonopotamus commented on Sep 27, 2021

    @slonopotamus
    Contributor

    Confirming, we also hit this issue.

    Previous series about zero-sized LFS objects: #3863, #2863, #2447. I believe that the proper fix is to restore pre-3.0.0 behavior. Forcing users to rewrite their repo history because they had zero-sized LFS object is lots of manwork with unclear benefits.

    There's also #3865.

  2. bk2204 commented on Sep 27, 2021

    @bk2204
    Member

    Yeah, this definitely sounds like a bug. We changed how we parse files, but that should not have resulted in this behavior. I'll try to get a patch into 3.0.1.

  3. bk2204 commented on Sep 27, 2021

    @bk2204
    Member

    This should be fixed with #4654. It would be great if you could test and verify that the code there works for you.

  4. EricVogl-carta commented on Sep 27, 2021

    @EricVogl-carta
    Author

    This should be fixed with #4654. It would be great if you could test and verify that the code there works for you.

    Thanks so much! This does appear to fix the issue. git-lfs ls-files --all no longer lists zero-byte files, git-lfs fetch no longer complains about missing objects.

  5. bk2204 commented on Sep 27, 2021

    @bk2204
    Member

    Great. I'll try to get it included in 3.0.1 release today or tomorrow.

  6. Kallekro commented on Sep 29, 2021

    @Kallekro

    We experienced the same bug monday which caused our builds to fail, so we forced our build agents to use the previous LFS version 2.13.3.

    Thanks so much! This does appear to fix the issue. git-lfs ls-files --all no longer lists zero-byte files, git-lfs fetch no longer complains about missing objects.

    I agree that git lfs fetch no longer complains about missing objects, but we still experience that git-lfs ls-files --all lists zero-byte files that shouldn't be tracked by LFS.

    If I use git lfs fetch --all the output shows how many objects are found, and here I still see one more with the new version 3.0.1 than when using version 2.13.3.

    Additionally, running git lfs ls-files | grep e3b0c44298 also still lists the empty files that was causing a problem when fetching in version 3.0.0.

    Oddly enough, when I use the --all flag, ie. git lfs ls-files --all | grep e3b0c44298 fewer 0 byte files are listed, but there are still some listed.

  7. bk2204 commented on Sep 29, 2021

    @bk2204
    Member

    @Kallekro Could you open a new issue for that? That's going to be a different bug and a different fix.

  8. slonopotamus commented on Sep 29, 2021

    @slonopotamus
    Contributor

    @bk2204 just for history: do you know by chance what change in git-lfs caused this regression?

  9. bk2204 commented on Sep 29, 2021

    @bk2204
    Member

    It's probably efaf9a2 without a suitable preparatory commit to fix up that case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions