當我嘗試構建配置為從 GitLab 結帳的 Jenkins 作業時,我收到以下錯誤輸出(已截斷):
....................
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from [email protected]:root/xxx.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:1001)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1242)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1302)
....................................................
....................................................
at hudson.model.Executor.run(Executor.java:431)
Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --force --progress -- [email protected]:root/xxx.git refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: Load key "/var/lib/jenkins/workspace/gitlabjenkinsdemo@tmp/jenkins-gitclient-ssh1964800292912998995.key": invalid format
Permission denied, please try again.
Permission denied, please try again.
[email protected]: Permission denied (publickey,password).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2681)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2102)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:86)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:624)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:999)
... 11 more
錯誤:獲取遠程存盤庫“來源”時出錯已完成:失敗
我正在嘗試按照這篇
我錯過了什么?
uj5u.com熱心網友回復:
Jenkins 服務器和 Gitlab 服務器都運行在同一個 Debian 實體上
理想情況下,它們會使用自己關聯的服務帳戶運行,而不是“ root”。
但是,即使如此root,這也應該有效。
檢查您已經添加了SSH私鑰,并確保至少進行測驗,它不是一個有密碼保護的(意味著私鑰檔案并沒有有一個Proc-Type: 4,ENCRYPTED行之)
這可能是jenkins-gitclient-ssh1964800292912998995.key": invalid format你擁有的原因。
(或者你已經用 CRLF 而不是 LF 作為行尾復制了私鑰檔案內容)
(或者你已經復制了一個公鑰,其中需要一個私鑰,反之亦然)
從討論:
- 私鑰必須在 Jenkins 中再次注冊(確保它的 eol——行尾——是 LF,而不是 CRLF)
- 分支需要重命名:
我的倉庫
master在我做的時候有git init,所以main當我設定 GitLab 遠程時必須將分支重命名為
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/327031.html
上一篇:Java我的影像被底部和頂部切割
