[英]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.