0

Been getting a report from my GitLab server repocheck.md that there is a problem in one of my repositories. This is the problem:

    E, [2020-04-04T10:25:00.323291 #27099] ERROR -- : Could not fsck repository: broken link from tree 8c7ba0f6c712df32e991ae9262f1c7514fd22473
    to blob 806164c98a18ddc2295c246e5509674471d6f54a
    missing blob 806164c98a18ddc2295c246e5509674471d6f54a

How can I resolve this problem on the server?

I have a good copy of that repo on a client:

Pete@sev MINGW64 ~/Documents/path/to/client/repo (master)
$ git gc
Enumerating objects: 536, done.
Counting objects: 100% (536/536), done.
Delta compression using up to 8 threads
Compressing objects: 100% (424/424), done.
Writing objects: 100% (536/536), done.
Total 536 (delta 177), reused 338 (delta 104)

Pete@sev MINGW64 ~/Documents/path/to/client/repo (master)
$ git fsck --full
Checking object directories: 100% (256/256), done.
Checking objects: 100% (536/536), done.
BarryPye
  • 1,975
  • 2
  • 18
  • 19
  • 1
    Force push the good copy to the server. – fredrik Apr 04 '20 at 17:50
  • Thx. Did not fix it. Tried `git push --force` (no fix), then `git push --force-with-lease` (no fix). – BarryPye Apr 04 '20 at 22:21
  • Otherwise, try to identify from your local repo on which branch the missing object lies, then do `git push --no-thin branch-at-stake:branch-at-stake`. – ErikMD Apr 04 '20 at 22:28
  • (cf. the doc of [`git push --no-thin`](https://git-scm.com/docs/git-push#Documentation/git-push.txt---no-thin)) – ErikMD Apr 04 '20 at 22:30
  • Thx. Nice suggestion about `--no-thin`! Still did not fix the problem. This looks similar to an unresolved problem here: https://stackoverflow.com/questions/52428788/git-returns-failed-to-run-repack-and-inflate-returned-errors. Also tried running `git-repair` on the server directory but no fix. Next, will copy the .git directory contents to my server (after making archive of existing server contents) and re-scan with `git fsck --full`. Expecting glory with that. – BarryPye Apr 05 '20 at 04:55
  • ... and THAT fixed it. – BarryPye Apr 05 '20 at 05:07

1 Answers1

2

Since force push from the good local repo and git-repair on the server did not solve the problem, copied the contents of the .git directory from the good local repo to the server's file space (replacing all contents under the repo.git/ directory). Then ran git fsck --full to confirm the problem was gone. And it was gone.

BarryPye
  • 1,975
  • 2
  • 18
  • 19