初始的Gitlab版本为13.6.7,准备升级到最新版本。ps.这个版本的Git有漏洞,天天被植入木马,被折磨的够呛,没办法只能升级
遇到的问题
13.6.7 ---> 13.8.8 遇到的问题
问题1. gitlab-ctl reconfigure报错
Running handlers:
There was an error running gitlab-ctl reconfigure:
bash[migrate gitlab-rails database] (gitlab::database_migrations line 55) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of "bash" "/tmp/chef-script20221114-958287-a1ins6" ----
STDOUT: rake aborted!
PG::ConnectionBad: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/opt/gitlab/postgresql/.s.PGSQL.5432"?
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:58:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => gitlab:db:configure
(See full trace by running task with --trace)
STDERR:
---- End output of "bash" "/tmp/chef-script20221114-958287-a1ins6" ----
Ran "bash" "/tmp/chef-script20221114-958287-a1ins6" returned 1
解决办法:
sudo chmod 755 /var/opt/gitlab/postgresql
sudo systemctl restart gitlab-runsvdir
-- 然后再执行
gitlab-ctl reconfigure
参考:https://www.likecs.com/show-203346724.html
问题2. root账号登录不了,提示 Invalid Login or password.
不知道什么原因,升级到13.8.8 版本后,root账号登录不上了,其他账号可正常登录。没办法只能想办法了修改密码了
- 使用gitlab-rails console 命令进入gitlab提供的命令行控制环境
gitlab-rails console
- 定位到root账号
user = User.where(id: 1).first
- 为这个root用户设置新的密码password
user.password = 'youpassword'
- 强制保存设置
user.save!