8

I get the following error when I do a git pull origin master.

error: Unable to find a47058d09b4ca436d65609758a9dba52235a75bd under http://myweb.com/myapp.git
Cannot obtain needed blob a47058d09b4ca436d65609758a9dba52235a75bd
while processing commit 041d57dd5bed9d6c75fe7cce944b2b2904ae3a62.
error: Fetch failed.

Everything has been working fine up until a few minutes ago. I did not do anything out of the ordinary. I've been doing my usual commit push and pull, and now I'm suddenly getting this error.

What does this error mean? What are the steps to troubleshooting/correcting this error?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
John
  • 32,403
  • 80
  • 251
  • 422
  • 1
    This is a problem known to mask other problems. E.g. Do you have enough disk left for your repository? – Christopher Aug 14 '12 at 16:59
  • How do I check the disk space on a repo? I have an ubuntu linux server. The server is at 82% capacity. I have no problem pushing and pulling on my other repositories for my other project. Does that help diagnose the problem? – John Aug 14 '12 at 17:09
  • Do you have direct access to the remote repository (origin)? – Ethan Brown Aug 14 '12 at 17:44
  • By direct access, do that mean SSH into the /var/lib/git/myapp.git ? If so, then yes. I can use shell commands to manipulate the files in the bare repository. – John Aug 14 '12 at 17:47

2 Answers2

7

Like Adam said, recover the object from another repository/clone.

Don't forget to take into account packs. So, a more generalized procedure is this:

On a 'complete' Git database:

git cat-file -p a47058d09b4ca436d65609758a9dba52235a75bd > tempfile

And on the receiving end:

git hash-object -w tempfile
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
sehe
  • 374,641
  • 47
  • 450
  • 633
0

Copy objects from your directory (.git/objects) and other people that work on a clone of this repository. One object got zapped so this should fix it.

Here is more about moving objects around: The Object Database

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Adam Dymitruk
  • 124,556
  • 26
  • 146
  • 141