【发布时间】:2022-01-17 18:18:48
【问题描述】:
我正在尝试将我的 jenkins 服务器连接到我在 gitlab.com 上的私有存储库。 我已经将 gitlab 的 API 访问令牌添加到我的 jenkins 服务器,并将 Jenkins 公钥添加到 gitlab 帐户的 ssh-keys。
将我的 gitlab 存储库添加到我的 jenkins 管道后,出现以下错误:
Failed to connect to repository : Command "git ls-remote -h -- git@gitlab.com:user_name/repo_name.git HEAD" returned status code 128:
stdout:
stderr: Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
当我尝试在我的 Jenkins 服务器上运行以下命令时:
ssh -T git@gitlab.com:user_name/repo_name.git
我收到以下错误:
ssh: Could not resolve hostname gitlab.com:user_name/repo_name.git: Name or service not known
即使在提供 SSH 密钥和访问令牌之后,我也无法弄清楚我的 Jenkins 服务器无法访问存储库的原因。
【问题讨论】:
标签: jenkins gitlab jenkins-pipeline gitlab-api