从备份还原Jenkins配置后无法访问git存储库

时间:2019-05-21 13:47:49

标签: git jenkins

我通过从JENKINS_HOME目录复制文件来进行了jenkins配置备份。我将它们复制到另一台装有新Jenkins安装程序的计算机上的Jenkins主目录中。当我打开一项需要从git存储库下载文件的工作时,我得到

Failed to connect to repository : Command "C:\Program Files\Git\cmd\git.exe ls-remote -h git@git.path.com:project/main.git HEAD" returned status code 128:
stdout: 
stderr: Load key "C:\\WINDOWS\\TEMP\\ssh1234567.key": invalid format 
Permission denied, please try again. 
Permission denied, please try again. 
git@git.path.com: Permission denied (publickey,password). 
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

但是凭据位于詹金斯凭据下。 .ssh文件夹也被复制。关于可能出了什么问题的任何建议吗?

1 个答案:

答案 0 :(得分:0)

我遇到了同样的错误,我的情况是:

I copies id_rsa.pub public key to jenkins credentials, but id_rsa.pub public key is for gitub\gitlab... while id_rsa this private key is for jenkins credentials

我将这个私钥id_rsa复制到jenkins凭证后,一切正常!