【发布时间】:2021-12-06 12:28:22
【问题描述】:
当我尝试构建配置为从 GitLab 签出的 Jenkins 作业时,我得到以下错误输出(截断):
....................
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from git@10.777.77.777: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 -- git@10.777.77.777: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.
git@10.170.8.204: 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
错误:获取远程 repo 'origin' 时出错 完成:失败
我正在尝试按照这篇帖子 Jenkins_Gitlab 设置 CI/CD 管道
我希望我添加的私钥应该能够开箱即用地签出(注意:Jenkins 服务器和 Gitlab 服务器都在同一个 Debian 实例上运行)。
在 ~/.ssh 目录中,我有以下内容:
root@myservername:~/.ssh# ls -ld
drwx------ 2 root root 4096 Oct 18 15:30 .
在我的 Jenkins 工作的源代码管理选项卡中,我还在 Gitlab 中添加了 我从项目中提取的 SSH 链接。但是,我不确定的是该项目在 Gitlab 中显示的以下消息:
我错过了什么?
【问题讨论】: