Fixing the Git error "error: unable to find"
Asked Answered
git
M

2

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?

Mars answered 14/8, 2012 at 16:55 Comment(4)
This is a problem known to mask other problems. E.g. Do you have enough disk left for your repository?Marble
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?Mars
Do you have direct access to the remote repository (origin)?Wyck
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.Mars
I
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
Interoffice answered 14/8, 2012 at 19:40 Comment(1)
this seems to be working but I keep getting such error several times. Is there way how many such objects I need to recover?Adolescent
C
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

Conversation answered 14/8, 2012 at 19:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.