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

kwvwclae  于 2022-11-28  发布在  Docker
关注(0)|答案(1)|浏览(2059)

我不小心把我在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的信息。

smdnsysy

smdnsysy1#

我最终通过设置一个新的Gitlab Docker容器并按照文档中的说明备份和恢复Gitlab(https://docs.gitlab.com/ee/raketasks/backup_restore.html)来解决这个问题。
请注意,还必须备份以下文件中的机密:

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

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

相关问题