Re: fatal: unable to read <hash>
- Reply: Bjoern A. Zeeb: "Re: fatal: unable to read <hash>"
- In reply to: Bjoern A. Zeeb: "fatal: unable to read <hash>"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 26 Jul 2023 15:57:57 UTC
Does the .git/gc.log file contain more info (I suspect not)? I've seen file ownership/permission problems if one sometimes runs git commands as different users (particularly root and not-root) in the same repo. So, first try to "chown -R me:mygroup ." at the top of your Git repo, to make sure you own all the files, particularly the ones in .git/. I believe the gc operation is trying to read a file named .git/objects/b9/cdc058e6eb1b3d8b5e29ad9b911d3da98f65a7 (note the / after "b9"). If the chown doesn't fix things, take a look in .git/objects/b9/ and see what's up with the files there. The b9 directory itself might also have bad juju. (Don't forget to remove .git/gc.log before trying to run "git gc" manually!) M. On 2023-07-25 20:21, Bjoern A. Zeeb wrote: > Hi, > > on one of my trees I am getting: > > --- 8< 8< 8< ----------------------------------------------------------- > % git fetch freebsd > Auto packing the repository in background for optimum performance. > See "git help gc" for manual housekeeping. > warning: The last gc run reported the following. Please correct the root > cause > and remove .git/gc.log > Automatic cleanup will not be performed until the file is removed. > > fatal: unable to read b9cdc058e6eb1b3d8b5e29ad9b911d3da98f65a7 > fatal: failed to run repack > --- 8< 8< 8< ----------------------------------------------------------- > > I am not concerned about the background gc but the fatal error about the > hash displayed. > > I have no clue how to solve this, nor do I know what object that hash > is/was. > > Does anyone know how to "repair" this wihtout having to blow away the > local copy with all its development branches (which would be rather > painful)? > > /bz >