git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Denis Bueno <denbuen@sandia.gov>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Git clone error
Date: Tue, 31 Jul 2007 19:38:21 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.0.999.0707311924590.4161@woody.linux-foundation.org> (raw)
In-Reply-To: <C2D525CB.2A81%denbuen@sandia.gov>



On Tue, 31 Jul 2007, Denis Bueno wrote:
> 
> I'm a new git user (actually a darcs convert) and am running into a weird
> problem on a small and simple repository.  The error I see is:
> 
>     git[14] > git clone /Volumes/work/scripts/
>     Initialized empty Git repository in /tmp/git/scripts/.git/
>     remote: Generating pack...
>     Done counting 80 objects.
>     remote: error: unable to unpack b28b949a1a3c8eb37ca6eefd024508fa8b253429 header
>     fatal: unable to get type of object b28b949a1a3c8eb37ca6error: git-upload-pack: git-pack-objects died with error.
>     fatal: git-upload-pack: aborting due to possible repository corruption on the remote side.
>     remote: aborting due to possible repository corruption on the remote side.
>     fatal: early EOF
>     fatal: index-pack died with error code 128
>     fetch-pack from '/Volumes/work/scripts/.git' failed.

Well, it says so, but the most likely issue really is that there is 
"corruption on the remote side".

Please do

	cd /Volumes/work/scripts
	git fsck --full

which I would guess will almost certainly talk about some kind of problems 
with that object "b28b949a1a3c8eb37ca6eefd024508fa8b253429". And possibly 
more.

The "unable to unpack .. header" problem would at a guess be a totally 
corrupted loose object. You should have a file named

	.git/objects/b2/8b949a1a3c8eb37ca6eefd024508fa8b253429

and it sounds like that file is corrupt. So far, apart from a CRLF 
conversion bug (that you wouldn't have triggered on OS X anyway), I think 
every single time we've seen that, it's been a real disk or memory 
corruption.

Trying to restore corrupt objects can be quite hard, since git stores them 
in a compressed format, and so git single-bit errors are very detectable 
(that's kind of the point of having cryptographically secure hashes!), but 
they are very much not fixable, unless you can find the original data that 
*resulted* in that object some way (in another clone of the git 
repository, or in a backup).

There are certainly ways to figure out what that object _should_ be, 
though. For example, if that object is the only corrupted entry, and it's 
a blob (ie pure data object), what you can generally do is still use the 
repo (as long as you avoid that particular blob), and do things like

	git log --raw -r --no-abbrev

and you'll see the git history with all blobs named with their SHA1's. 
Then you can just search for that b28b949.. name, and you'll see exactly 
which file (in which version) it was, and if you can just find a backup of 
that file (or re-create it *exactly* from previous versions and your 
memory of it), you can re-generate the git object and thus save your 
repository.

Of course, a much easier option tends to be to just have a backup 
repository that has that object in it, and then you can literally just 
copy that b28b949 object over.

In short: git basically guarantees that it will *find* all corruption, but 
it doesn't do backups for you. Backups are easy to do (cloning), and git 
also makes incremental backups trivial (ie just do "git fetch" or "git 
push"), but git won't do backups for you unless you ask for them that way.

			Linus

  parent reply	other threads:[~2007-08-01  2:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-31 23:45 Git clone error Denis Bueno
2007-08-01  0:22 ` Junio C Hamano
2007-08-01  2:38 ` Linus Torvalds [this message]
2007-08-01 14:24   ` Denis Bueno
2007-08-01 16:19     ` Linus Torvalds
2007-08-01 16:36       ` Linus Torvalds
2007-08-01 17:17         ` Johannes Schindelin
2007-08-01 20:22           ` Denis Bueno
2007-08-01 21:12             ` Johannes Schindelin
2007-08-02 15:08               ` Denis Bueno
2007-08-02 17:08                 ` Johannes Schindelin
2007-08-02 17:40                   ` Linus Torvalds
2007-08-01 16:37       ` Steffen Prohaska
  -- strict thread matches above, loose matches on Subject: below --
2008-04-05 17:20 git " Chuck Ritter
2008-04-05 20:09 ` Junio C Hamano
2008-08-28 12:57 Git " srinivasan.malligarjunan
2008-08-28 14:11 ` Andreas Ericsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.0.999.0707311924590.4161@woody.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=denbuen@sandia.gov \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).