gpt4 book ai didi

gitlab - 搞乱了 gitlab 权限,现在不知道该怎么办

转载 作者:行者123 更新时间:2023-12-03 08:55:25 27 4
gpt4 key购买 nike

我试图让我的 gitlab-runner 工作,但我把我的 gitlab 配置弄得非常糟糕......我希望可以恢复我的自托管 gitlab 实例。

首先要做的事情是:当我运行 sudo gitlab-ctl status 时,我得到输出

down: alertmanager: 1s, normally up, want up; run: log: (pid 8770) 1438s
down: prometheus: 0s, normally up, want up; run: log: (pid 8742) 1438s

其余部分按我猜测的方式工作。正如我之前所说,由于 sudo chown ...

搞乱了配置,导致权限被拒绝错误相关的问题

有办法恢复旧的用户权限吗?或者有没有办法获取gitlab需要的权限配置信息?

非常感谢!

PS:当我运行 sudo gitlab-ctl reconfigure 时出现此错误

 ================================================================================
Error executing action `run` on resource 'execute[/opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-keys check-permissions]'
================================================================================

Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-keys check-permissions ----
STDOUT: error: could not open /var/opt/gitlab/.ssh/authorized_keys: Permission denied @ rb_sysopen - /var/opt/gitlab/.ssh/authorized_keys
-rw------- 1 gitlab-redis git 1948 Apr 23 15:33 /var/opt/gitlab/.ssh/authorized_keys
STDERR:
---- End output of /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-keys check-permissions ----
Ran /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-keys check-permissions returned 1

Resource Declaration:
---------------------
# In /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/gitlab-shell.rb

85: execute "#{gitlab_shell_keys_check} check-permissions" do
86: user git_user
87: group git_group
88: end
89:

Compiled Resource:
------------------
# Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/gitlab-shell.rb:85:in `from_file'

execute("/opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-keys check-permissions") do
action [:run]
default_guard_interpreter :execute
command "/opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-keys check-permissions"
backup 5
group "git"
returns 0
user "git"
declared_type :execute
cookbook_name "gitlab"
recipe_name "gitlab-shell"
domain nil
end

System Info:
------------
chef_version=13.6.4
platform=ubuntu
platform_version=18.04
ruby=ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]
program_name=/opt/gitlab/embedded/bin/chef-client
executable=/opt/gitlab/embedded/bin/chef-client


Running handlers:
There was an error running gitlab-ctl reconfigure:

execute[/opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-keys check-permissions] (gitlab::gitlab-shell line 85) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-keys check-permissions ----
STDOUT: error: could not open /var/opt/gitlab/.ssh/authorized_keys: Permission denied @ rb_sysopen - /var/opt/gitlab/.ssh/authorized_keys
-rw------- 1 gitlab-redis git 1948 Apr 23 15:33 /var/opt/gitlab/.ssh/authorized_keys
STDERR:
---- End output of /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-keys check-permissions ----
Ran /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-keys check-permissions returned 1

最佳答案

我认为您正在使用 GitLab Omnibus!如果是这样,请下载正确版本的update-permissions (您的 GtiLab 实例版本)并运行脚本文件。
它可以解决更改 UID/GID 以及更改文件和目录的所有权/权限时的权限问题。

注意:使用此脚本时要小心。需要root权限执行!因此,在运行之前请阅读所有文件,并确保您使用的是正确的版本。

关于gitlab - 搞乱了 gitlab 权限,现在不知道该怎么办,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55828741/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com