[英]Jenkins fails to checkout Git repository - Host key verification failed
[英]OpenShift Jenkins git clone fails: Host key verification failed
我嘗試在 Red Hat OpenShift 環境中的 Jenkins 中構建我的 Node JS(最新版本)應用程序,但它繼續失敗並在 Jenkins 日志中顯示以下消息:
Host key verification failed.
fatal: Could not read from remote repository.
經過進一步調查,發現 Jenkins 服務器無法從應用程序服務器克隆 repo:
[JENKINS_HOST test]\> git clone ssh://GUID@APP_HOST/~/git/sof.git
Cloning into 'sof'...
The authenticity of host 'APP_HOST (172.16.6.220)' can't be established.
RSA key fingerprint is cf:ee:77:cb:0e:fc:02:d7:72:7e:ae:80:c0:90:88:a7.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/var/lib/openshift/GUID/.ssh/known_hosts).
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
我什至無法進入 Jenkins 主機上的.ssh
目錄。
拿它來說,OpenShift 應用程序管理應該處理應用程序和 CI 主機之間的所有私鑰,但似乎不起作用。
有什么想法嗎?
我在整個網絡上進行了搜索,但特定於 OpenShift 的場景並不常見。
這可以使用自定義墨盒https://cartreflect-claytondev.rhcloud.com/reflect?github=smerrill/openshift-community-git-ssh墨盒創建腳本並設置 GIT_SSH 環境變量以在沒有嚴格主機的情況下運行 git-ssh關鍵檢查。
所以,
現在 git clone 肯定沒問題
如果您不需要提交將 協議更改為http
並且您將不需要使用 ssh 密鑰,因為如果您的服務器允許並支持此協議,它應該是只讀的。
如果必須使用 ssh,則必須設置 ssh 密鑰。 沒有辦法“跳過”它。
如果有人來到這里並且他無法在 openshift 上克隆他的私人存儲庫。 不支持 SSH,也不支持 HTTP。 我有一個簡單的解決方案,效果很好。 使用 http 克隆並將您的令牌添加到 repo 鏈接,例如
git clone https://<token>@github.com/owner/repo.git
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.