go-git icon indicating copy to clipboard operation
go-git copied to clipboard

go-git returns PackFileNotFound, but git does not report a Problem

Open pampersrocker opened this issue 6 years ago • 3 comments

In go-gitea/gitea#8330 we encountered a problem where go-git is returning a PackFileNotFoundError on a otherwise perfectly normal git repository (as described in the original issue, git is not reporting any error with git fsck or git fsck --full and a git repack does not resolve the problem either.

A single sommit in the repository seems to cause the problem. However the project in which this occurs is confidential so I cannot share the full repository for analysis, but if you can guide me how I may retrieve additional information which may be useful for further analysis of this commit, I can see what I can do.

Maybe @robertschulze or @smile34 can provide infos as well.

pampersrocker avatar Oct 05 '19 11:10 pampersrocker

Can you please provide listing of the .git/objects/packs/ directory? Is there a objects/info/packs file in the repository? If yes, can you share it please?

filipnavara avatar Oct 05 '19 12:10 filipnavara

The following packsDirContents.txt is the output of ls -la of the .git/objects/packs/ dir, the pack.txt is the objects/info/packs file, just with .txt added as GitHub does not allow empty file extensions.

packsDirContents.txt

pack.txt

pampersrocker avatar Oct 05 '19 12:10 pampersrocker

Looking at the other comments, indeed a complete run of git gc fixes the problem as it removes any .tmp and packs everything into a single pack file.

pampersrocker avatar Oct 06 '19 11:10 pampersrocker