Gitkab repocheck (git fsck) fails, but I don't know how to really fix it

I have a self-hosted gitlab instance and suddenly one of my projects is sending
emails telling me that the repo check is failing.

I run gitlab-15.0.0-ee via docker. I checked the log file repocheck.log file and this
is the content:

$ cat repocheck.log
E, [2022-06-07T19:08:10.599782 #435] ERROR -- : xxx/xxx: Could not fsck repository: dangling blob ed44e089d0eaf14fc152871bdca12aa6de01a5f1
dangling blob 4317819507d8e4e3ddcce6f3c01b8890e56cc157
dangling commit 2b1f190885dae6bbef0986cd50bc61c790331312
dangling blob 0f7c7218e71e1bd8b964184e149c214734d41944
dangling blob 6f16132326f43f1fd3a9a9cd717830643a162c8a
dangling commit 3b87a380a8095fe83fed257fd89e178323b89bea
dangling commit 14ca539d07483fc309f94cea685fc893a3efaf51
dangling commit 3cf64b574d2ecbc4ffe06559f9495db22bb5f2c9
dangling blob 535b94cb0a9048bbe45eb35ba53a02fe795be823
dangling commit 6778eef6143982b0d96f2934e515b36254e9a31f
dangling commit 0294e6bca9f2a5cacd7bbea61c62e5b5d92eb98f
dangling blob 4144f7437938ea8b0fe5ce6c8a498995b4f96f7c
dangling blob b64cd7abaa200ac4fea060b0dfb8542e260cb301
dangling blob 90545fea55b5e5c1f6245281ebac02b1dd8bfd04
error: Could not read 0957f8065b8fecfa80005eafa673a2a8b67ddbed
failed to parse commit 0957f8065b8fecfa80005eafa673a2a8b67ddbed from object database for commit-graph
error: Could not read 0a70090f6519febb2edbd9c416b5dff46d92d1a1
failed to parse commit 0a70090f6519febb2edbd9c416b5dff46d92d1a1 from object database for commit-graph
error: Could not read 126be254518dfd5b29a553fcfe7843787cbeed08
....


and the file has around 200 more commits that are not present in the
commit-graph.

On my local repository most of those commits are still present and they are
indeed not reachable, so a git gc on the server removed those commits that are
still present on my local repository. I don’t seem to be missing merge requests
so it doesn’t make sense to me why gitlab thinks that this is a problem.

Sadly the official documentation is very vague about what do do other than
tell to to locate the repocheck.log file and or to click on Clear all
repository checks
if the error persists. That doesn’t help at all, because even
after clicking on Clear all repository checks, I’m still getting the same
error. So what is gitlab actually testing and why is it failing?

So my question is, what can I really do to fix this? To me everything looks
fine, so why is gitlab marking these commits are needed when they are not
reachable? Could it be that some merge request is pointing to these commits and
if so, how can I fix it? Like I said, I don’t seems to be missing any merge
request so far.

Thanks

1 Like

No one ever responded to your question?
I have similar issue and I am thinking about opening a ticket with GitLab Support

This post has helped me with dangling commits: Repocheck dangling commit - #6 by dnsmichi