Gitlab-runner 的 Git 克隆失败并出现"Problem with the SSL CA cert (path? access rights?)"



几个月来,我一直有gitlab-runner的问题,它随机失败,日志如下:

Running with gitlab-runner 13.7.0 (943fc252)
on <gitlab-runner-name> <gitlab-runner-id>
Preparing the "shell" executor
00:00
Using Shell executor...
Preparing environment
00:00
Running on <hostname>...
Getting source from Git repository
00:00
Fetching changes...
Reinitialized existing Git repository in /var/gitlab-runner/builds/<gitlab-runner-id>/0/<gtlab-group>/<gitlab-project>/.git/
fatal: unable to access 'https://gitlab-ci-token:[MASKED]@<hostname>/<gtlab-group>/<gitlab-project>.git/': Problem with the SSL CA cert (path? access rights?)
ERROR: Job failed: exit status 1

这条线是至关重要的:

fatal: unable to access 'https://gitlab-ci-token:[MASKED]@<hostname>/<gtlab-group>/<gitlab-project>.git/': Problem with the SSL CA cert (path? access rights?)

我试着注销跑步者并注册一个新的跑步者。过了一段时间,它也因同样的错误而失败(第一次运行通常效果良好(
此外,其他机器上的运行程序工作正常,不会出现上述错误消息。

我认为问题是由中丢失的CI_SERVER_TLS_CA_FILE文件引起的

/var/gitlab-runner/builds/<gitlab-runner-id>/0/<gtlab-group>/<gitlab-project>.tmp/CI_SERVER_TLS_CA_FILE

我尝试在有故障的目录中执行git pull,得到了相同的消息。在我从另一个目录中复制了这个丢失的文件后,我得到了以下内容:

remote: HTTP Basic: Access denied
fatal: Authentication failed for 'https://gitlab-ci-token:<gitlab-runner-token>@gitlab.lab.sk.alcatel-lucent.com/<gtlab-group>/<gitlab-project>.git/'

据我所知,这些令牌是一次性生成的,在作业完成后会被丢弃。这让我相信丢失的文件就是问题所在。

这个文件是从哪里复制的?为什么它不见了?我能做些什么来解决这个问题
我一直在查看GitLab的问题,但运气不好。

听起来你的一个或多个跑步者不信任gitlab主机上的证书。您必须找到用于签署TLS证书的根证书和中间证书,并将其添加到跑步者的主机中。

对于我在CentOS上的跑步者,我遵循以下指南(对于CentOS,更高版本的命令相同(:https://manuals.gfi.com/en/kerio/connect/content/server-configuration/ssl-certificates/adding-trusted-root-certificates-to-the-server-1605.html.

最新更新