首页 新闻 会员 周边

gitlab 升级到 16.8 后 gitlab-ci 无法正常工作

0
悬赏园豆:30 [已解决问题] 解决于 2024-01-20 20:23

今天将 gitlab 升级到 16.8 后,所有的 pipeline 都处于 pending 状态,查看 pipeline 中的 job,显示的是下面的内容:

This job has not been triggered yet
This job depends on upstream jobs that need to succeed in order for this job to be triggered

请问如何解决这个问题?

问题补充:

处于 pending 状态的 pipeline 是升级之前就触发的,取消后 retry 可以正常跑完 pipeline,真正的问题是 pipeline 无法自动触发

dudu的主页 dudu | 高人七级 | 园豆:30948
提问于:2024-01-20 18:00

CHANGELOG for v16.8.0

dudu 3个月前
< >
分享
最佳答案
0

终于找到原因了,升级过程中的迁移没有全部完成造成的

我们升级 gitlab 没有启用自动迁移,在升级后通过下面的命令进行数据库迁移

gitlab-rake db:migrate RAILS_ENV=production

通过管理控制台 /admin/health_check 发现迁移没有完成

Current Status:  Unhealthy
Migrations are pending. To resolve this issue, run: bin/rails db:migrate RAILS_ENV=production You have 62 pending migrations:

再次运行迁移命令并重启 gitlab 后恢复正常

gitlab-rake db:migrate RAILS_ENV=production
gitlab-ctl restart

迁移没有完成可能是因为升级过程中的这个错误

RedisClient::UnsupportedServer (redis-client requires Redis 6+ with HELLO command available)

gitlab 16.8 开始对 redis 版本有更高的要求,至少 redis 6,后来切换到 gitlab 内置的 redis 修复了这个错误,但当时没有注意到迁移没有全部完成

dudu | 高人七级 |园豆:30948 | 2024-01-20 20:22
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册