繁体   English   中英

gitlab-runner 的 git 克隆失败,并出现“SSL CA 证书问题(路径?访问权限?)”

[英]gitlab-runner's git clone fails with “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.将可信根证书添加到服务器 1605.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM