OS:CentOS 8
Hostname:HyperV-GitLab
必须先升级到当前大版本的最新版 在升级到下一个大版本
参考官方网站对于版本升级的说明
因为使用了外部数据源(PG),而且是12的高版本,GitLab自带pg_dump版本只到10或者11。在升级的备份部分,就备份失败,报错如下:
gitlab preinstall: Automatically backing up only the GitLab SQL database (excluding everything else!)
2020-10-01 21:47:39 +0800 -- Dumping database ...
Dumping PostgreSQL database db_gitlab ... pg_dump: server version: 12.4; pg_dump version: 11.7
pg_dump: aborting because of server version mismatch
[FAILED]
rake aborted!
Backup::Error: Backup failed
解决方法:
1.安装postgresql12的客户端
dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
dnf -qy module disable postgresql
dnf install -y postgresql12
2.重新建立pg_dump的软连接
cd /opt/gitlab/embedded/bin
mv pg_dump pg_dump.bak
ln -s /usr/bin/pg_dump /opt/gitlab/embedded/bin/pg_dump
GitLab一开始就用Yum/dnf安装,后面升级自然也一直用Yum命令升级;只到从13.1.4升级到13.1.11版本时,一直提示
[root@HyperV-GitLab opt]# yum update gitlab-ce-13.1.11
上次元数据过期检查:6:53:15 前,执行于 2020年10月01日 星期四 15时40分48秒。
依赖关系解决。
==================================================================================================================================
软件包 架构 版本 仓库 大小
==================================================================================================================================
升级:
gitlab-ce x86_64 13.1.11-ce.0.el8 gitlab-ce 716 M
事务概要
==================================================================================================================================
升级 1 软件包
总下载:716 M
确定吗?[y/N]: y
下载软件包:
gitlab-ce-13.1.11-ce.0.el8.x86_64.rpm 3.7 MB/s | 716 MB 03:13
----------------------------------------------------------------------------------------------------------------------------------
总计 3.7 MB/s | 716 MB 03:13
运行事务检查
事务检查成功。
运行事务测试
事务测试成功。
运行事务
准备中 : 1/1
运行脚本: gitlab-ce-13.1.11-ce.0.el8.x86_64 1/2
错误:%prein(gitlab-ce-13.1.11-ce.0.el8.x86_64) 脚本执行失败,退出状态码为 1
Error in PREIN scriptlet in rpm package gitlab-ce
验证 : gitlab-ce-13.1.11-ce.0.el8.x86_64 1/2
验证 : gitlab-ce-13.1.4-ce.0.el8.x86_64 2/2
失败:
gitlab-ce-13.1.4-ce.0.el8.x86_64 gitlab-ce-13.1.11-ce.0.el8.x86_64
错误:事务失败
[root@HyperV-GitLab opt]#
手动下载rpm包安装,也有相同的报错信息:
[root@HyperV-GitLab opt]# rpm -Uvh gitlab-ce-13.1.11-ce.0.el8.x86_64.rpm
警告:gitlab-ce-13.1.11-ce.0.el8.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID f27eab47: NOKEY
Verifying... ################################# [100%]
准备中... ################################# [100%]
错误:%prein(gitlab-ce-13.1.11-ce.0.el8.x86_64) 脚本执行失败,退出状态码为 1
错误:gitlab-ce-13.1.11-ce.0.el8.x86_64: 安裝 已失败
错误:gitlab-ce-13.1.4-ce.0.el8.x86_64: 删除 已跳过
OR
error: prein(gitlab-ce-13.1.11-ce.0.el8.x86_64)scriptlet failed, exit status 1
用rpm -Uvvh查看安装详情,发现错误如下:
+ upgrade_check
++ gitlab-ctl upgrade-check 13.1.4 13.13.1
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
+ ctl_results='[2020-10-01T21:17:45+08:00] WARN: Please install an English UTF-8 locale for Chef to use, falling back to C locale and disabling UTF-8 support.
I don'\''t know that command.
omnibus-ctl: command (subcommand)
check-config
.........
Container Registry Commands:
registry-garbage-collect
Run Container Registry garbage collection.'
+ found='[2020-10-01T21:17:45+08:00] WARN: Please install an English UTF-8 locale for Chef to use, falling back to C locale and disabling UTF-8 support.'
+ '[' '[2020-10-01T21:17:45+08:00] WARN: Please install an English UTF-8 locale for Chef to use, falling back to C locale and disabling UTF-8 support.' '!=' 'I don'\''t know that command.' ']'
+ exit 1
D: %prein(gitlab-ce-13.1.11-ce.0.el8.x86_64): waitpid(35960) rc 35960 status 100
error: %prein(gitlab-ce-13.1.11-ce.0.el8.x86_64) scriptlet failed, exit status 1
ufdio: 6 reads, 8219028 total bytes in 0.001505 secs
error: gitlab-ce-13.1.11-ce.0.el8.x86_64: install failed
可能是因为我安装系统的时候选择了中文,系统里竟然没有英文语言包?!
locale -a如下:
[root@HyperV-GitLab ~]# vi /etc/environment
[root@HyperV-GitLab ~]# locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
C.utf8
POSIX
zh_CN
zh_CN.gb18030
zh_CN.gbk
zh_CN.utf8
zh_HK
zh_HK.utf8
zh_SG
zh_SG.gbk
zh_SG.utf8
zh_TW
zh_TW.euctw
zh_TW.utf8
解决方法:
安装英文语言包
yum install langpacks-en.noarch