几个月来,我一直遇到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的问题,但运气不佳。
发布于 2021-01-23 03:14:42
听起来你的一个或多个跑步者不信任你的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。
https://stackoverflow.com/questions/65700613
复制相似问题