首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >gitlab-runner的git克隆失败,出现"Problem with the SSL CA cert (path? access rights?)“

gitlab-runner的git克隆失败,出现"Problem with the SSL CA cert (path? access rights?)“
EN

Stack Overflow用户
提问于 2021-01-13 19:02:31
回答 1查看 1.3K关注 0票数 3

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

代码语言:javascript
复制
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

这一行是至关重要的:

代码语言:javascript
复制
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文件引起的:

代码语言:javascript
复制
/var/gitlab-runner/builds/<gitlab-runner-id>/0/<gtlab-group>/<gitlab-project>.tmp/CI_SERVER_TLS_CA_FILE

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

代码语言:javascript
复制
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的问题,但运气不佳。

EN

回答 1

Stack Overflow用户

发布于 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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65700613

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档