一、把/etc/gitlab/gitlab-secrets.json /etc/gitlab/gitlab.rb 这两个文件覆盖到新环境下,

# 刷新配置
gitlab-ctl reconfigure
# 重启
gitlab-ctl restart

二、如果上述操作还是报500

需要重置所有的 Token 记录,关于 Webhooks 也需要重新创建

gitlab-rails dbconsole

PS:如果这个命令能进,那么最好,如果不能进,请直接看三.(我就是因为这个命令没办法进去)

执行:

=> DELETE FROM ci_group_variables;
=> DELETE FROM ci_variables;
# Clear project tokens
=> UPDATE projects SET runners_token = null, runners_token_encrypted = null;
# Clear group tokens
=> UPDATE namespaces SET runners_token = null, runners_token_encrypted = null;
# Clear instance tokens
=> UPDATE application_settings SET runners_registration_token_encrypted = null;
# Clear key used for JWT authentication
# This may break the $CI_JWT_TOKEN job variable:
# https://gitlab.com/gitlab-org/gitlab/-/issues/325965
=> UPDATE application_settings SET encrypted_ci_jwt_signing_key = null;
# Clear runner tokens
=> UPDATE ci_runners SET token = null, token_encrypted = null;
# Clear build tokens
=> UPDATE ci_builds SET token = null, token_encrypted = null;
# truncate web_hooks table
=> TRUNCATE web_hooks CASCADE;
=> quit;

重启gitlab服务:

gitlab-ctl restart

三、别处进入gitlab DB

su - gitlab-psql  //登录用户
psql -h /var/opt/gitlab/postgresql -d gitlabhq_production  //连接到gitlabhq_production库

然后按二的数据库操作进行清空即可。操作完记得重启gitlab服务

Centos 7 断电导致 generating /run/initramfs/rdsosreport.txt 问题

物理断电,有时候会出现

generating “/run/initramfs/rdsosreport.txt”
entering emergencymode.
exit the shell to continue
type “journalctl” to view system logs.
you might want to save “/run/initramfs/rdsosreport.txt” to a usb stick or /boot after mounting them and attach it to a bug report。

处理步骤:

  1. 切换到 /dev/mapper 目录 查找 -root 文件,代表通配符 (如 centos 系统,文件为:centos-root)。
cd /dev/mapper
  1. 执行 xfs_repair /dev/mapper/-rootxfs_repair /dev/mapper/-root -L

最后reboot重启就行。

  1. 下载并安装Sublime Text 4 Build 4107;
  2. 使用浏览器打开网站:https://hexed.it/
  3. 打开Sublime Text安装目录选择文件 sublime_text.exe
  4. 搜索80 38 00并更改为FE 00 90(第一个匹配)
  5. 保存文件到本地
  6. 备份sublime_text.exe文件(只需重命名)
  7. 将修改过的sublime_text.exe复制到sublime text 4安装目录中
  8. 增加 hosts 内容
127.0.0.1 www.sublimetext.com
127.0.0.1 sublimetext.com
127.0.0.1 sublimehq.com
127.0.0.1 telemetry.sublimehq.com
127.0.0.1 license.sublimehq.com
127.0.0.1 45.55.255.55
127.0.0.1 45.55.41.223

590060-20210706102747558-1423132274.png