git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Help with "fatal: unable to read ...." error during GC?

From
Paul Smith <paul@mad-scientist.net>
Date
Aug 8, 2018, 17:35 UTC
Message-ID
<b247434b62ccd30f32adbebb83fa6ea12b51b6ff.camel@mad-scientist.net>
In-Reply-To
<20180808160612.GC1607@sigill.intra.peff.net>
On Wed, 2018-08-08 at 12:06 -0400, Jeff King wrote:
Show 16 quoted lines
> I'd have expected fsck to find it, too. However, looking at the code,
> I'm not convinced that fsck is actually considering detached worktree
> heads properly, either. Try:
> 
>   git rev-list --all --reflog --objects >/dev/null
> 
> which I know checks worktrees correctly. I'd expect that to fail.
> 
> If it does, then we need to narrow down which worktree is corrupt.
> Perhaps something like:
> 
>   git worktree list |
>   while read worktree head junk; do
>         git rev-list --objects $head >/dev/null ||
>         echo "$worktree seems corrupt"
>   done

Thanks for the note! Unhappily for me none of these operations seem to find any actionable problems...

$ git rev-list --all --reflog --objects >/dev/null warning: reflog of 'HEAD' references pruned commits warning: reflog of 'HEAD' references pruned commits warning: reflog of 'HEAD' references pruned commits warning: reflog of 'HEAD' references pruned commits warning: reflog of 'HEAD' references pruned commits warning: reflog of 'HEAD' references pruned commits warning: reflog of 'HEAD' references pruned commits warning: reflog of 'HEAD' references pruned commits warning: reflog of 'HEAD' references pruned commits warning: reflog of 'HEAD' references pruned commits $ echo $? 0

$ git worktree list | while read wt head junk; do \
  git rev-list --objects $head >/dev/null || echo "$wt seems corrupt"; \
  done
$

Just to be sure I updated the loop above to echo $wt and $head and they were correct. I also re-ran git gc after the above and still got the original error output so it didn't magically fix itself :).

Previous: Jeff KingNext: Jeff King
Message 3 of 13 in “Help with "fatal: unable to read ...." error during GC?”
  1. Paul SmithAug 8, 2018
  2. Jeff KingAug 8, 2018
  3. Paul SmithAug 8, 2018
  4. Jeff KingAug 8, 2018
  5. Paul SmithAug 8, 2018
  6. Paul SmithAug 9, 2018
  7. Jeff KingAug 9, 2018
  8. Paul SmithAug 11, 2018
  9. Jeff KingAug 11, 2018
  10. Jeff KingAug 11, 2018
  11. Duy NguyenAug 11, 2018
  12. Jeff KingAug 11, 2018
  13. Duy NguyenAug 12, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.