Gitlab 显示“获取文件夹内容时发生错误。”

问题描述 投票:0回答:1

我不小心弄乱了在 Docker 容器中运行的自托管 Gitlab 上的文件所有者(在错误的级别上进行了 chown...)。我设法恢复了大部分所有权。

这是通过运行

docker exec gitlab_container_name update-permissions
来完成的。但是,这并没有立即解决问题,因为日志仍然显示 grafana 数据库的权限被拒绝错误。为了解决这个问题,我继续设置一个新的 Gitlab 并比较/恢复所有权。

虽然 Gitlab 本身现在再次运行,但我仍然收到以下错误:

  1. 当我尝试推动时,我收到:
remote: GitLab: Push operation timed out
remote:
remote: Timing information for debugging purposes:
remote: Running checks for ref: XXXX
remote: Checking if you are allowed to push... (62.94ms)
remote: Checking if default branch is being deleted... (0.31ms)
remote: Scanning repository for blobs stored in LFS and verifying their files have been uploaded to GitLab... (cancelled after 29547.57ms)
To http://gitlab.XXXX.XX/XXXX/XXXX.git
 ! [remote rejected]   XXXXX -> XXXX (pre-receive hook declined)
error: failed to push some refs to 'http://gitlab.XXXX.XX/XXXX/XXXX.git'
  1. 当我在 Web UI 中单击某个项目时,它会显示分支、总文件大小等信息,但不显示文件/文件本身的列表。相反,会显示
    **An error occurred while fetching folder content.**

在尝试推送时运行

gitlab-ctl tail
显示以下内容:

{"level":"info","msg":"I, [2021-07-05T17:13:19.676164 #3372254]  INFO -- sentry: ** [Raven] Raven 3.0.4 configured not to capture errors: DSN not set","supervisor.args":["bundle","exec","bin/ruby-cd","/var/opt/gitlab/gitaly","/opt/gitlab/embedded/service/gitaly-ruby/bin/gitaly-ruby","3368488","/var/opt/gitlab/gitaly/internal_sockets/ruby.0"],"supervisor.name":"gitaly-ruby.0","time":"2021-07-05T17:13:19.692Z"}
{"error":"exit status 1","level":"warning","msg":"exited","supervisor.args":["bundle","exec","bin/ruby-cd","/var/opt/gitlab/gitaly","/opt/gitlab/embedded/service/gitaly-ruby/bin/gitaly-ruby","3368488","/var/opt/gitlab/gitaly/internal_sockets/ruby.0"],"supervisor.name":"gitaly-ruby.0","time":"2021-07-05T17:13:19.698Z"}
{"level":"info","msg":"I, [2021-07-05T17:13:20.817759 #3372257]  INFO -- sentry: ** [Raven] Raven 3.0.4 configured not to capture errors: DSN not set","supervisor.args":["bundle","exec","bin/ruby-cd","/var/opt/gitlab/gitaly","/opt/gitlab/embedded/service/gitaly-ruby/bin/gitaly-ruby","3368488","/var/opt/gitlab/gitaly/internal_sockets/ruby.1"],"supervisor.name":"gitaly-ruby.1","time":"2021-07-05T17:13:20.835Z"}
{"error":"exit status 1","level":"warning","msg":"exited","supervisor.args":["bundle","exec","bin/ruby-cd","/var/opt/gitlab/gitaly","/opt/gitlab/embedded/service/gitaly-ruby/bin/gitaly-ruby","3368488","/var/opt/gitlab/gitaly/internal_sockets/ruby.1"],"supervisor.name":"gitaly-ruby.1","time":"2021-07-05T17:13:20.843Z"}
[...]
{"correlation_id":"01F9VTFEM5X7N2PZR6WVDAQQYN","error":"GitLab: Push operation timed out\n\nTiming information for debugging purposes:\nRunning checks for ref: XXXX\nChecking if you are allowed to push... (13.42ms)\nChecking if default branch is being deleted... (0.43ms)\nScanning repository for blobs stored in LFS and verifying their files have been uploaded to GitLab... (cancelled after 29583.1ms)","grpc.meta.deadline_type":"none","grpc.method":"PreReceiveHook","grpc.request.fullMethod":"/gitaly.HookService/PreReceiveHook","grpc.request.glProjectPath":"XXXX/XXXX","grpc.request.glRepository":"project-5","grpc.request.repoPath":"@hashed/ef/2d/ef2d127de37b942baad06145e54b0c619a1f22327b2ebbcfbec78f5564afe39d.git","grpc.request.repoStorage":"default","grpc.request.topLevelGroup":"@hashed","grpc.service":"gitaly.HookService","grpc.start_time":"2021-07-05T17:11:59.178Z","level":"warning","msg":"stopping transaction because pre-receive hook failed","peer.address":"@","pid":3368488,"span.kind":"server","system":"grpc","time":"2021-07-05T17:12:29.025Z"}

有人知道如何解决这个问题吗?

编辑:我添加了评论中讨论的有关

docker exec gitlab_container_name update-permissions
的信息。

docker gitlab
1个回答
0
投票

我最终通过设置一个新的 Gitlab Docker 容器并按照文档中的说明备份和恢复 Gitlab 解决了这个问题 (https://docs.gitlab.com/ee/raketasks/backup_restore.html)。

请注意,备份以下文件中的机密也很重要:

/etc/gitlab/gitlab-secrets.json
/etc/gitlab/gitlab.rb

这个过程非常简单和顺利,根据存储库的文件大小,备份和恢复只需要几分钟。

© www.soinside.com 2019 - 2024. All rights reserved.