Issue #3075 resolved

[Git] Accepting pull request corrupts repository

Elm City Labs
created an issue

I just set up a Git repo (booksavr.git), and forked it from my organizations (elmcitylabs) account into dlo/booksavr.git.

I made a small change to test out the pull requests, and successfully (at least I thought) merged into into the main branch.

However, when trying to pull down from the new tree, I get this error:

{{{ $ git pull origin master fatal: loose object 70e3b32923b05bbe280ca1226c4e4acb8b1ed54f (stored in ./objects/70/e3b32923b05bbe280ca1226c4e4acb8b1ed54f) is corrupt fatal: The remote end hung up unexpectedly }}}

I then tried to inspect this object--but then realized this was on the remote, so I couldn't. My next line of attack was to simply bypass the pull request altogether and just force the push into the main repo.

This is what happened:

{{{ $ git push origin master --force Counting objects: 762, done. Delta compression using up to 2 threads. Compressing objects: 100% (269/269), done. Writing objects: 100% (701/701), 1.05 MiB, done. Total 701 (delta 442), reused 679 (delta 423) remote: fatal: loose object 70e3b32923b05bbe280ca1226c4e4acb8b1ed54f (stored in /data/netapp02/netapp02_sas01_09/data/d-859/r-387859//objects/70/e3b32923b05bbe280ca1226c4e4acb8b1ed54f) is corrupt remote: fatal: loose object 70e3b32923b05bbe280ca1226c4e4acb8b1ed54f (stored in /data/netapp02/netapp02_sas01_09/data/d-859/r-387859//objects/70/e3b32923b05bbe280ca1226c4e4acb8b1ed54f) is corrupt remote: fatal: loose object 70e3b32923b05bbe280ca1226c4e4acb8b1ed54f (stored in /data/netapp02/netapp02_sas01_09/data/d-859/r-387859//objects/70/e3b32923b05bbe280ca1226c4e4acb8b1ed54f) is corrupt remote: bb/acl: dlo is allowed. accepted payload. remote: fatal: loose object 70e3b32923b05bbe280ca1226c4e4acb8b1ed54f (stored in /data/netapp02/netapp02_sas01_09/data/d-859/r-387859//objects/70/e3b32923b05bbe280ca1226c4e4acb8b1ed54f) is corrupt remote: fatal: loose object 70e3b32923b05bbe280ca1226c4e4acb8b1ed54f (stored in /data/netapp02/netapp02_sas01_09/data/d-859/r-387859//objects/70/e3b32923b05bbe280ca1226c4e4acb8b1ed54f) is corrupt remote: fatal: loose object 70e3b32923b05bbe280ca1226c4e4acb8b1ed54f (stored in /data/netapp02/netapp02_sas01_09/data/d-859/r-387859//objects/70/e3b32923b05bbe280ca1226c4e4acb8b1ed54f) is corrupt To git@git.elmcitylabs.com:elmcitylabs/booksavr.git + 70e3b32...0ba2040 master -> master (forced update) }}}

Comments (6)

  1. Brodie Rao staff

    After an initial investigation, the actual data in the repository isn't corrupt, but that particular object was created with bad file permissions. Git will report an object is corrupt when it doesn't have permission to read it.

    I'll keep looking into why that object was created with the wrong permissions. I'll let you know when I have more information.

  2. Brodie Rao staff

    OK, this should be fixed now. It turns out we were running an outdated version of libgit2 on two of our front end servers. That particular version has an issue with creating directories/files in Git repos with the right permissions.

    We've updated libgit2 on those two servers and I've manually fixed all the permissions for all Git repos on the site. You should be able to push to/pull from your repo again.

    Thanks for the report!

  3. Tere Bentikh

    for me i have about 5 branches, i was checking out one of them that was created 2 days ago, it gives me an error - loose object !!!

    this is the second time i see this error in 3 months, and on 2 different PCs and also on 2 different branches

    why is this !? and how to be solved ?

  4. Log in to comment