GitLab projects failed their last repository check

Hi,

Below are the instruction of how we solved an issue in GitLab docker environment

  1. find all repositories that failed on link “See the affected projects in the GitLab admin panel” that you’ve received from GitLab
    http://yourgitlab_link/admin/projects?last_repository_check_failed=1

  2. Check /var/log/gitlab/gitlab-rails/repocheck.log file that is generated when “Trigger repository check” is triggered in project admin area. If file is empty then trigger repository check manually again. This step is not so important even though the file is empty or not, because you will get similar output with command fsck described little lower.

  3. open specific project
    Menu->Admin->Projects->your project
    and search for “Gitaly relative path”
    @hashed/48/b3/48b361d46638bfa4eee090c158a750a69c7beec3a62e703e2801125551b1b157.git

  4. go to docker console (connect to container) and run fsck command on that specific repository
    (see more instructions on Repository checks | GitLab)
    command:
    /opt/gitlab/embedded/bin/git -C /var/opt/gitlab/git-data/repositories/@hashed/48/b3/48b361d46638bfa4eee090c158a750a69c7beec3a62e703e2801125551b1b157.git fsck
    and check if there are any errors like

  • error: Could not read 098b53ffbe581e25b…
  • failed to parse commit 098b53ffbe581e25b… from object database for commit-graph
  1. now run garbage collector gc with
    /opt/gitlab/embedded/bin/git -C /var/opt/gitlab/git-data/repositories/@hashed/48/b3/48b361d46638bfa4eee090c158a750a69c7beec3a62e703e2801125551b1b157.git gc

  2. and check again repository with fsck
    /opt/gitlab/embedded/bin/git -C /var/opt/gitlab/git-data/repositories/@hashed/48/b3/48b361d46638bfa4eee090c158a750a69c7beec3a62e703e2801125551b1b157.git fsck
    and errors and fails should be cleared

  3. run again “Trigger repository check” in check if repository check has passed successfully. If it was successful then this repository shouldn’t be in repository list that have failed to pass the repository check (See the affected projects in the GitLab admin panel) or http://yourgitlab_link/admin/projects?last_repository_check_failed=1

8 Likes