赞
踩
最近在搭建python接口自动化项目
使用Windows10电脑 ,在本地搭建了一个 Jenkins
然后创建项目,配置gitlab工程,输入账号密码后,提示gitlab连接错误
(参考图)
Failed to connect to repository : Command "git.exe ls-remote -h -- git@**** *****/os_api_test.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.
1. 电脑端使用git pull命令 可以正常拉取到代码 (故仓库地址没有错误)
2. 通过百度查各种资料,原来是 Window上搭建的Jenkins时使用的账号秘钥,不是window系统内的秘钥,而是使用了Jenkins创建的秘钥
Window上账号秘钥: gitlab 初始化配置的的秘钥,如下图
路径在:C:\Users\【你的电脑用户名】\.ssh
Jenkins使用的秘钥路径:
C:\Windows\System32\config\systemprofile\
结论:Jenkins使用的秘钥路径没有存放gitlab的秘钥,所以Jenkins拉取不到仓库
直接复制C:\Users\【你的电脑用户名】\.ssh 整个目录下的所有文件到
C:\Windows\System32\config\systemprofile
问题解决,再打开Jenkins可以拉倒仓库
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。