# error: packfile while git fsck

5 messages from 2008-10-22 to 2008-11-03. Participants: Nicolas Ferre, Nicolas Pitre.
Thread: https://gitlist.dev/t/16010

## Nicolas Ferre, 2008-10-22 14:06

Subject: error: packfile while git fsck
Message-ID: <48FF337F.3050505@atmel.com>
URL: https://gitlist.dev/e/48FF337F.3050505%40atmel.com

```
Hi all,
(please cc me on response)

I am facing error during git status & git fsck on my tree.
This tree is cloned from various linux kernel trees.

Here are a sample of the error I see :

$ git fsck
error: packfile .git/objects/pack/pack-2ab31ad1f8cb69d091a56fe936634e4796606d49.pack does not match index
error: packfile .git/objects/pack/pack-2ab31ad1f8cb69d091a56fe936634e4796606d49.pack cannot be accessed
error: packfile .git/objects/pack/pack-2ab31ad1f8cb69d091a56fe936634e4796606d49.pack does not match index
error: packfile .git/objects/pack/pack-2ab31ad1f8cb69d091a56fe936634e4796606d49.pack cannot be accessed
error: packfile .git/objects/pack/pack-2ab31ad1f8cb69d091a56fe936634e4796606d49.pack does not match index
[..]
error: packfile .git/objects/pack/pack-2ab31ad1f8cb69d091a56fe936634e4796606d49.pack cannot be accessed
dangling blob fe130d58453393f15e0db82bca18f35998689a87
dangling commit 2515ddc6db8eb49a79f0fe5e67ff09ac7c81eab4
error: packfile .git/objects/pack/pack-2ab31ad1f8cb69d091a56fe936634e4796606d49.pack does not match index
error: packfile .git/objects/pack/pack-2ab31ad1f8cb69d091a56fe936634e4796606d49.pack cannot be accessed
error: packfile .git/objects/pack/pack-2ab31ad1f8cb69d091a56fe936634e4796606d49.pack does not match index
error: packfile .git/objects/pack/pack-2ab31ad1f8cb69d091a56fe936634e4796606d49.pack cannot be accessed
error: packfile .git/objects/pack/pack-2ab31ad1f8cb69d091a56fe936634e4796606d49.pack does not match index
error: packfile .git/objects/pack/pack-2ab31ad1f8cb69d091a56fe936634e4796606d49.pack cannot be accessed
dangling commit 6bb7a935489dab20802dde6c2cb7d8582f4849bf
error: packfile .git/objects/pack/pack-2ab31ad1f8cb69d091a56fe936634e4796606d49.pack does not match index
error: packfile .git/objects/pack/pack-2ab31ad1f8cb69d091a56fe936634e4796606d49.pack cannot be accessed
dangling commit 4aba41ea8bdc1b475861f5e5c1649ab20251090c
error: packfile .git/objects/pack/pack-2ab31ad1f8cb69d091a56fe936634e4796606d49.pack does not match index
error: packfile .git/objects/pack/pack-2ab31ad1f8cb69d091a56fe936634e4796606d49.pack cannot be accessed
[..]
$  git verify-pack .git/objects/pack/pack-2ab31ad1f8cb69d091a56fe936634e4796606d49.pack
pack-2ab31ad1f8cb69d091a56fe936634e4796606d49.pack
nferre@bendor:linux-2.6-arm > git verify-pack .git/objects/pack/pack-2ab31ad1f8cb69d091a56fe936634e4796606d49.pack
error: packfile .git/objects/pack/pack-2ab31ad1f8cb69d091a56fe936634e4796606d49.pack does not match index
fatal: packfile .git/objects/pack/pack-2ab31ad1f8cb69d091a56fe936634e4796606d49.pack cannot be accessed

What can I do to recover my git archive ?

Did I do something wrong (merging files while fetching) ?

Is it related to a known issue (I cannot figure out if it is 
after some googling) ?

Thanks for your help. Regards,
-- 
Nicolas Ferre

```

## Nicolas Pitre, 2008-10-22 14:52

Subject: Re: error: packfile while git fsck
Message-ID: <alpine.LFD.2.00.0810221049340.26244@xanadu.home>
URL: https://gitlist.dev/e/alpine.LFD.2.00.0810221049340.26244%40xanadu.home
In-Reply-To: <48FF337F.3050505@atmel.com>

```
On Wed, 22 Oct 2008, Nicolas Ferre wrote:

> Hi all,
> (please cc me on response)
> 
> I am facing error during git status & git fsck on my tree.
> This tree is cloned from various linux kernel trees.
> 
> Here are a sample of the error I see :
> 
> $ git fsck
> error: packfile
> .git/objects/pack/pack-2ab31ad1f8cb69d091a56fe936634e4796606d49.pack does not
> match index
> error: packfile
> .git/objects/pack/pack-2ab31ad1f8cb69d091a56fe936634e4796606d49.pack cannot be
> accessed
[...]

What git version?

> Did I do something wrong (merging files while fetching) ?

Unlikely.


Nicolas

```

## Nicolas Ferre, 2008-10-22 15:22

Subject: Re: error: packfile while git fsck
Message-ID: <48FF4521.5070303@atmel.com>
URL: https://gitlist.dev/e/48FF4521.5070303%40atmel.com
In-Reply-To: <alpine.LFD.2.00.0810221049340.26244@xanadu.home>

```
Nicolas Pitre :
> On Wed, 22 Oct 2008, Nicolas Ferre wrote:
> 
>> Hi all,
>> (please cc me on response)
>>
>> I am facing error during git status & git fsck on my tree.
>> This tree is cloned from various linux kernel trees.
>>
>> Here are a sample of the error I see :
>>
>> $ git fsck
>> error: packfile
>> .git/objects/pack/pack-2ab31ad1f8cb69d091a56fe936634e4796606d49.pack does not
>> match index
>> error: packfile
>> .git/objects/pack/pack-2ab31ad1f8cb69d091a56fe936634e4796606d49.pack cannot be
>> accessed
> [...]
> 
> What git version?

$ git --version
git version 1.5.3.7

Kind regards,
-- 
Nicolas Ferre

```

## Nicolas Pitre, 2008-10-22 17:35

Subject: Re: error: packfile while git fsck
Message-ID: <alpine.LFD.2.00.0810221323270.26244@xanadu.home>
URL: https://gitlist.dev/e/alpine.LFD.2.00.0810221323270.26244%40xanadu.home
In-Reply-To: <48FF4521.5070303@atmel.com>

```
On Wed, 22 Oct 2008, Nicolas Ferre wrote:

> Nicolas Pitre :
> > On Wed, 22 Oct 2008, Nicolas Ferre wrote:
> > 
> > > Hi all,
> > > (please cc me on response)
> > > 
> > > I am facing error during git status & git fsck on my tree.
> > > This tree is cloned from various linux kernel trees.
> > > 
> > > Here are a sample of the error I see :
> > > 
> > > $ git fsck
> > > error: packfile
> > > .git/objects/pack/pack-2ab31ad1f8cb69d091a56fe936634e4796606d49.pack does
> > > not
> > > match index
> > > error: packfile
> > > .git/objects/pack/pack-2ab31ad1f8cb69d091a56fe936634e4796606d49.pack
> > > cannot be
> > > accessed
> > [...]
> > 
> > What git version?
> 
> $ git --version
> git version 1.5.3.7

OK.  Since this is not bleeding edge, it is pretty unlikely that the 
corruption is due to git itself.  Furthermore, the git packs are always 
read only once they've been created, meaning that if they weren't 
corrupted at some point then something outside of git caused the 
corruption.  You really should consider the possible causes for that 
(dying disk, pilot error, etc).

As to recovery... That really depends if you have personal work 
committed to your repository.  If not then the easiest solution is 
simply to recreate it by refetching from upstream.   If you have 
personal work in there then you could try to fetch your work branch into 
the newly created repository.  The latest git version could help with 
the extraction of non-corrupted objects out of a bad pack, but if the 
objects you are interested in are themselves corrupted then your only 
hope is to have a copy of those objects somewhere else.


Nicolas

```

## Nicolas Ferre, 2008-11-03 16:18

Subject: Re: error: packfile while git fsck
Message-ID: <490F246D.1040307@atmel.com>
URL: https://gitlist.dev/e/490F246D.1040307%40atmel.com
In-Reply-To: <alpine.LFD.2.00.0810221323270.26244@xanadu.home>

```
Nicolas Pitre :
> On Wed, 22 Oct 2008, Nicolas Ferre wrote:
> 
>> Nicolas Pitre :
>>> On Wed, 22 Oct 2008, Nicolas Ferre wrote:
>>>
>>>> Hi all,
>>>> (please cc me on response)
>>>>
>>>> I am facing error during git status & git fsck on my tree.
>>>> This tree is cloned from various linux kernel trees.
>>>>
>>>> Here are a sample of the error I see :
>>>>
>>>> $ git fsck
>>>> error: packfile
>>>> .git/objects/pack/pack-2ab31ad1f8cb69d091a56fe936634e4796606d49.pack does
>>>> not
>>>> match index
>>>> error: packfile
>>>> .git/objects/pack/pack-2ab31ad1f8cb69d091a56fe936634e4796606d49.pack
>>>> cannot be
>>>> accessed
>>> [...]
>>>
>>> What git version?
>> $ git --version
>> git version 1.5.3.7
> 
> OK.  Since this is not bleeding edge, it is pretty unlikely that the 
> corruption is due to git itself.  Furthermore, the git packs are always 
> read only once they've been created, meaning that if they weren't 
> corrupted at some point then something outside of git caused the 
> corruption.  You really should consider the possible causes for that 
> (dying disk, pilot error, etc).
> 
> As to recovery... That really depends if you have personal work 
> committed to your repository.  If not then the easiest solution is 
> simply to recreate it by refetching from upstream.   If you have 
> personal work in there then you could try to fetch your work branch into 
> the newly created repository.  The latest git version could help with 
> the extraction of non-corrupted objects out of a bad pack, but if the 
> objects you are interested in are themselves corrupted then your only 
> hope is to have a copy of those objects somewhere else.

Nicolas,

Thanks for your help. I will consider migrating to a brand new git tree 
with my work imported in (it seems that my local work is not affected).

Just to know, as the object I try to access is not present, is there a 
way to rebuild the index to match this mater of fact ?

Regards,
-- 
Nicolas Ferre

```
