Whole team gets ‘too many unreachable loose objects’ messages

This is followed by issue 14357 (GitLab 8.6- or less)

The manual fix was:

  • SSH into worker1
  • cd into the gitlab-org/gitlab-ce directory
  • ran rm gc.log, this just contained the line ” warning: There are too many unreachable loose objects; run ‘git prune’ to remove them.”
  • ran git prune and prayed it didn’t break things (which it thankfully didn’t)

But it looks like, starting GitLab 8.7, auto gc is disabled.
This is also done in the context of (still opened) issue 13524:

Typically after a rebase, amend or other action that requires a force push we can have dangled commits.

Such “dereferenced” commits are getting lost due to git gc that may be executed internally or by using GitLab Housekeeping features.

If it happens that there was a discussion attached to a specific commit – it is not available after dereferenced commit has been garbage-collected.

Commits are being recorded in push events and are available through system notes added to merge request, and currently this produces error 500 in GitLab.

Update: that issue was closed a month later (July 2016) with:

  • MR 5062: Don’t garbage collect commits that have related DB records like comments

Makes sure a commit is kept around when Git garbage collection runs.
Git GC will delete commits from the repository that are no longer in any branches or tags, but we want to keep some of these commits around, for example if they have comments or CI builds.

  • MR 4101: Refactor: Convert existing array-based diff refs to the DiffRefs model

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)