-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
--- | ||
date: 2024-05-18T19:29:51+0800 | ||
title: gitlab从14.5.2升级到16.3.7 | ||
tags: [gitlab] | ||
categories: [var] | ||
--- | ||
|
||
通过工具,找到[升级路径](https://gitlab-com.gitlab.io/support/toolbox/upgrade-path/)。 | ||
|
||
从 14.5.2=>14.9.5=>14.10.5=>15.0.5=>15.4.6,一路相安无事,正常 apt install。 | ||
|
||
## 15.11.13 | ||
|
||
从 15.4.6 升级 15.11.13 时,apt install 报错,关键错误日志如下, | ||
|
||
```shell | ||
PG::CheckViolation: ERROR: check constraint "check_70f294ef54" is violated by some row | ||
``` | ||
|
||
根据官方的[升级说明](https://docs.gitlab.com/ee/update/versions/gitlab_15_changes.html),按以下步骤修复, | ||
|
||
```shell | ||
1)root:~# sudo gitlab-psql | ||
|
||
2)gitlabhq_production=# select * from oauth_access_tokens where expires_in IS NULL; | ||
3)gitlabhq_production=# UPDATE oauth_access_tokens SET expires_in = '7200' WHERE expires_in IS NULL; | ||
|
||
4)root:~# gilab-rake db:migrate | ||
|
||
5)root:~# gitlab-rake db:migrate:status | ||
|
||
6)root:~# apt install -f | ||
``` | ||
|
||
进到数据库终端(1),查下记录(2),再按说明执行更新语句(3)。 | ||
执行成功后,退出到Shell终端,执行数据表迁移的命令(4)。 | ||
执行成功后,检查一下数据表迁移的状态,确保全部是UP/OK状态。 | ||
最后继续升级(6)。 | ||
|
||
|
||
## 16.1.6 | ||
|
||
从 15.11.13 升级 16.1.6 时,升级成功、没有报错。 | ||
但是无论LDAP还是Standard,都登录不进去。Standard登录时、页面报500错误。 | ||
|
||
找到关键日志,在登录时的关键报错信息如下, | ||
|
||
```shell | ||
root:~# tail -f /var/log/gitlab/gitlab-rails/production.log | ||
...(略) | ||
ActiveRecord::StatementInvalid (PG::CheckViolation: ERROR: new row for relation "users" violates check constraint "check_0dd5948e38" | ||
...(略) | ||
``` | ||
根据已有的[故障报告](https://gitlab.com/gitlab-org/gitlab/-/issues/416242),最终完成修复。 | ||
``` | ||
1)root~# gitlab-rails dbconsole | ||
...(这里要稍等几秒钟,有点慢,并不是没响应) | ||
|
||
2)gitlabhq_production=> select * from users WHERE user_type IS NULL; | ||
3)gitlabhq_production=> UPDATE users SET user_type = 0 WHERE user_type IS NULL; | ||
``` | ||
特别注意末尾的分号(3),无脑复制粘贴没用的…… | ||
## 16.3.7 | ||
正常 apt install,相安无事。 | ||
还有更新的版本,以后再说~ | ||