Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BitBucket Git Error: did not send all necessary objects

I am using bitbucket and git to revision a project I am currently working on. Today I tried to pull down the latest working copy of the project but was met with an error that I cant seem to find any solution to.

$ git pull
Password for 'bitbucket.org':
remote: Counting objects: 65, done.
remote: Compressing objects: 100% (31/31) done.
remote: Total 34 (delta 19), reused 0 (delta 0)
Upacking objects: 100% (34/34), done.
fatal: bad object 4324324....(etc object number)
error: https://bitbucket.org/myusername/myproject.git did not send all necessary objects

I have searched for this error "did not send all necessary objects" but there doesn't seem to be any documentation regarding this issue can anyone help please?

like image 899
Theo Kouzelis Avatar asked Jan 09 '12 13:01

Theo Kouzelis


2 Answers

"did not send all necessary objects" is the manifestation of the error, not the error itself.
For information, this message comes from builtin/fetch.c method store_updated_refs(), which calls connected.c method check_everything_connected(). It performs a

git rev-list --verify-objects --stdin --not --all
/*
 * If we feed all the commits we want to verify to this command
 *
 *  $ git rev-list --verify-objects --stdin --not --all
 *
 * and if it does not error out, that means everything reachable from
 * these commits locally exists and is connected to some of our
 * existing refs.
 *
 * Returns 0 if everything is connected, non-zero otherwise.
 */

The real issue is during the unpacking phase:

Upacking objects: 100% (34/34), done.
fatal: bad object 4324324....(etc object number)

It shouldn't be tied to some BitBucket hiccup, since its status page is clear.

So it might be linked to some corruption, added during a previous push by another contributor. If any clone of that BitBucket repo from any user results in the same message, you need to contact the support for them to troubleshoot this repo.

like image 100
VonC Avatar answered Sep 20 '22 11:09

VonC


git pull --prune fixed the similar error message I had on a repo.

like image 40
Ribens Avatar answered Sep 20 '22 11:09

Ribens