1

git version 1.7.7.4

I went to clone from my git respository and I got the following errors:

remote: fatal: failed to read object a89f72f06a1f6f56f924b0e8ae9e33f477da8fcd: Invalid argument
error: git upload-pack: git-pack-objects died with error.
remote: aborting due to possible repository corruption on the remote side.
fatal: early EOF
fatal: git upload-pack: aborting due to possible repository corruption on the remote side.
fatal: index-pack failed

So I went to the repository itself to check and I got this:

git fsck
fatal: failed to read object 1aea37c864c6b5d0d60d6fc38117bc420671b692: Invalid argument

I then did this to try and fix the problem:

git gc --prune
fatal: failed to read object a89f72f06a1f6f56f924b0e8ae9e33f477da8fcd: Invalid argument
error: failed to run repack

Is there anyway I can get this problem resolved?

Many thanks,

ant2009
  • 27,094
  • 154
  • 411
  • 609

1 Answers1

1

Git represents everything as a collection of objects, either on disk (as a loose object) or in a pack (as a compressed object). While cloning, git walks the entire history to determine which objects to send. If an object is missing, well that's bad news -- the error message is right, the repository is likely corrupted (either a loose object has gone missing or possibly the whole pack).

You MAY have a chance by trying to clone a different branch. If the walker doesn't come across that missing object, you'll be fine. If you feel insanely ambitious, you can dig into the git storage data structures and see if you can patch together the history by hand (this would be unbelievably hard, but not impossible).

Otherwise -- it's git. If you've made any clones recently, then congrats, you've got a full backup. Push from your cloned repo and the missing objects will be filled in.

Good luck.

Chris Eberle
  • 47,994
  • 12
  • 82
  • 119
  • If you have a good repository, it easy to copy that object over. See http://stackoverflow.com/questions/801577/how-to-recover-git-objects-damaged-by-hard-disk-failure – J-16 SDiZ Dec 23 '11 at 05:32