bma*_*kan 8 ssl gitlab gitlab-ci-runner
几个月来,我遇到了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
Run Code Online (Sandbox Code Playgroud)
这一行是关键的一行:
fatal: unable to access 'https://gitlab-ci-token:[MASKED]@<hostname>/<gtlab-group>/<gitlab-project>.git/': Problem with the SSL CA cert (path? access rights?)
Run Code Online (Sandbox Code Playgroud)
我尝试取消注册跑步者并注册一个新跑步者。一段时间后,它也因相同的错误而失败(第一次运行通常运行良好)。
此外,其他机器上的运行程序也可以正常工作,并且不会因上述错误消息而失败。
我认为该问题是由CI_SERVER_TLS_CA_FILE以下位置的文件丢失引起的:
/var/gitlab-runner/builds/<gitlab-runner-id>/0/<gtlab-group>/<gitlab-project>.tmp/CI_SERVER_TLS_CA_FILE
Run Code Online (Sandbox Code Playgroud)
我尝试git pull在错误目录中执行 a 操作,但收到了相同的消息。当我从另一个包含该文件的目录复制这个丢失的文件后,我得到以下信息:
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/'
Run Code Online (Sandbox Code Playgroud)
据我所知,这些令牌是为一次性使用而生成的,并在作业完成后被丢弃。这让我相信丢失的文件就是问题所在。
这个文件是从哪里复制的?为什么不见了?我可以做什么来解决这个问题?
我一直在研究 GitLab 问题,但没有运气。
听起来您的一个或多个运行程序不信任您的 gitlab 主机上的证书。您必须追踪用于签署 TLS 证书的根证书和中间证书,并将其添加到运行者的主机中。
对于 CentOS 上的跑步者,我遵循本指南(对于 CentOS,更高版本的命令相同):https ://manuals.gfi.com/en/kerio/connect/content/server-configuration/ssl-certificates/将受信任的根证书添加到server-1605.html。
| 归档时间: |
|
| 查看次数: |
6102 次 |
| 最近记录: |