GitLab项目未能通过其最后一个存储库检查

发布于 2025-02-01 02:26:42 字数 425 浏览 3 评论 0 原文

我收到了GitLab警报邮件,指出“一个项目未能通过其最后一个存储库检查”。 我确实检查了Gitlab管理面板中的错误,为“最后一个存储库检查(刚才)失败。请参阅“ procheck.log”文件以获取错误消息。”正如GitLab的Admin面板中建议的那样,我已经检查了repocheck.log文件,错误如下。

“无法FSCK存储库:错误:无法读取0F188244898707E6090498BC03AAFD8AC25E7776E 无法解析提交0F188244898707E6090498BC03AAFD8AC25E7776E从对象数据库中用于commit-graph 错误:无法读取4AB7111F3F8F1083CEE8E33EC033C18EDFEFB0E9“

上周这与另一个回购相同。即使有类似的错误消息,它尚未解决,并且尚未解决。好的。 无法为此找到适当的解决方案。任何人都可以为此提供帮助。

I have received a gitlab alert mail stating that "One project failed its last repository check".
I did check the error in Gitlab admin panel as "Last repository check (just now) failed. See the 'repocheck.log' file for error messages." As suggested in Admin Panel in Gitlab, i have checked the repocheck.log file and the error is as below.

"Could not fsck repository: error: Could not read 0f188244898707e6090498bc03aafd8ac25e776e
failed to parse commit 0f188244898707e6090498bc03aafd8ac25e776e from object database for commit-graph
error: Could not read 4ab7111f3f8f1083cee8e33ec033c18edfefb0e9"

This happened the same with another repo last week. Even that had similar error message and it is not resolved yet. Tried to clone the same repo in another gitlab instance to recreate the issue but the repo check there seems to be fine.
Unable to find proper solution for that. Could any one please help on this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

情感失落者 2025-02-08 02:26:42

我现在遇到并修复了两次,我发现了修复程序在论坛上

  1. 在实例的管理面板上查找所有失败的存储库:https:// your-gitlab-instance/admin/projects?last_repository_check_failed = 1
  2. 从该页面打开库在其 gitaly相对路径下,它应该看起来像@hashed/d4/d4/d4/c530f048efdf2711df2711df6f6fa15198ff480035833303624f8b97c174c174fadc2cab5e582.git

注意!以下命令应与GitLab运行的用户一起运行。您可以使用 sudo su [用户名] 进行此操作,在我的情况下,用户名是 git 。他们将与 sudo 一起使用,但是它可能会创建Gitlab用户无法访问的文件或文件夹。

  1. 运行 fsck 命令使用回购的相对路径(这应该应该输出与您的/var/log/gitlab/gitlab-rails/repocheck.log file)的文本:
/opt/gitlab/embedded/bin/git -C /var/opt/gitlab/git-data/repositories/[Gitlab relative path] fsck
# example
/opt/gitlab/embedded/bin/git -C /var/opt/gitlab/git-data/repositories/\@hashed/d4/73/c530f048efdf2711df6fa15198ff48003583303624f8b97c174fadc2cab5e582.git fsck
  1. 运行 gc 命令使用回购相对路径。这可能需要一分钟才能完成。
/opt/gitlab/embedded/bin/git -C /var/opt/gitlab/git-data/repositories/[Gitlab relative path] gc
# example
/opt/gitlab/embedded/bin/git -C /var/opt/gitlab/git-data/repositories/\@hashed/d4/73/c530f048efdf2711df6fa15198ff48003583303624f8b97c174fadc2cab5e582.git gc
  1. 从步骤3开始再次运行 fsck 命令,以检查命令
  2. 是否从步骤2开始在存储库页面上成功,单击蓝色触发存储库检查按钮

I've now come across and fixed this twice, I found the fix on the forum:

  1. Find all your failed repos at your instance's admin panel: https://your-gitlab-instance/admin/projects?last_repository_check_failed=1
  2. Open the repo from that page and copy down its Gitaly relative path, it should look like @hashed/d4/73/c530f048efdf2711df6fa15198ff48003583303624f8b97c174fadc2cab5e582.git

NOTE! The following commands should be run with the user that gitlab runs as. You can do this with sudo su [username], in my case the username was git. They will work with sudo, but it may create files or folders that the gitlab user won't be able to access.

  1. Run the fsck command using the repo's relative path (This should output the same text as your /var/log/gitlab/gitlab-rails/repocheck.log file):
/opt/gitlab/embedded/bin/git -C /var/opt/gitlab/git-data/repositories/[Gitlab relative path] fsck
# example
/opt/gitlab/embedded/bin/git -C /var/opt/gitlab/git-data/repositories/\@hashed/d4/73/c530f048efdf2711df6fa15198ff48003583303624f8b97c174fadc2cab5e582.git fsck
  1. Run the gc command using the repo's relative path. This may take a minute to complete.
/opt/gitlab/embedded/bin/git -C /var/opt/gitlab/git-data/repositories/[Gitlab relative path] gc
# example
/opt/gitlab/embedded/bin/git -C /var/opt/gitlab/git-data/repositories/\@hashed/d4/73/c530f048efdf2711df6fa15198ff48003583303624f8b97c174fadc2cab5e582.git gc
  1. Run the fsck command again from step 3 to check that the command was successful
  2. On the repo's page from step 2, click the blue Trigger repository check button
薄荷→糖丶微凉 2025-02-08 02:26:42

这似乎是一个活跃的问题:问题已有两年历史了,但是我链接到的注释已有今天的更新,包括有关修复程序和解决方法的信息。

无论如何: commit-graph 是一个相对较新的功能,并且由于它是包装数据的一种索引形式,因此可以重新创建它。因此,损坏的存储库可以轻松固定而不会丢失数据。

It seems to be an active issue: https://gitlab.com/gitlab-org/gitaly/-/issues/2359#note_966195929 The issue is a couple of years old, but the note I link to, has updates from today, including info on fixes and workarounds.

In any case: The commit-graph is a relatively new feature and since it is a form of index into packed data, it can be recreated. So the corrupted repo can be easily fixed without loss of data.

梦晓ヶ微光ヅ倾城 2025-02-08 02:26:42

它可以像这样重现:

  1. 访问提交图:项目侧栏 /存储库 /图
  2. 删除可见的提交之一,通过重写历史记录:
git checkout <branch>
git reset head~1 
git commit -am "Replace last commit with a new one" 
git push --force
  1. 刷新步骤1的页面

现在,gitlab将向您发送“ gitlab projection in gitlab projection a ins the comport fip他们的最后一个存储库检查“运行存储库时,请在计划的间隔上检查。

我认为这是一个错误,管理员和维护者对此有警告,因为实际上没有什么错。请参阅 https://stackoverflow =“ gitlab问题”> Anders Bandholm 有关更多详细信息。

It can be reproduced like this:

  1. Visit a commit graph: Project sidebar / Repository / Graph
  2. Delete one of the visible commits by rewriting history:
git checkout <branch>
git reset head~1 
git commit -am "Replace last commit with a new one" 
git push --force
  1. Refresh the page of step 1

Now GitLab will send you "A commit graph at GitLab projects failed their last repository check" when it runs the repository check on a scheduled interval.

I'd consider it a bug that admins and maintainers get a warning about this, since nothing is wrong really. See the GitLab issues linked by Anders Bandholm for more details.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文