Gitlab 显示"An error occurred while fetching folder content."



我不小心在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中单击项目时,它会显示分支、总文件大小等信息,但不会显示文件/文件本身的列表。而是显示CCD_ 2

在尝试推送时运行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 outnnTiming information for debugging purposes:nRunning checks for ref: XXXXnChecking 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的信息。

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

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

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

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

最新更新