找回密码
 立即注册
搜索
查看: 331|回复: 0

解决向 Jenkins( Windows) 添加 Git 仓库时报错的问题

[复制链接]

266

主题

0

回帖

1119

积分

管理员

积分
1119
发表于 2023-12-26 00:09:45 | 显示全部楼层 |阅读模式

向 Jenkins( Windows) 添加 Git 仓库时总是报错,当添加 HTTPS 仓库地址时报错:

Failed to connect to repository : Command "C:\Program Files\Git\bin\git.exe ls-remote -h -- >https://git.\***.com/gitlab/git.git HEAD" returned status code 128:

stdout:

stderr: fatal: unable to access 'https://git.***.com/gitlab/git.git/': OpenSSL SSL_connect: >SSL_ERROR_SYSCALL in connection to git.***.com:443

当添加 SSH 仓库地址时报错:

Failed to connect to repository : Command "C:\Program Files\Git\bin\git.exe ls-remote -h -- >git@git.***.com:gitlab/git.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.

即便给 Git 配置了 SSL 证书,创建了秘钥,问题依旧。最后查出原因是安装 Jenkins 选择了使用 LocalSystem 账户运行服务,这导致 Git 不能使用本地用户所做的配置,所以秘钥和证书都不起作用。

解决方法是在服务管理器中将登录用户换为你的系统账户。

或者重新安装 Jenkins,选择你所使用的本地账户或域账户作为服务的启动账户。

注意,使用本地账户时输入框要输入 计算机名\账户名


您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|棱讯科技 ( 粤ICP备2024228160号-2|粤公网安备44030002003510号 )

GMT+8, 2024-7-27 13:18 , Processed in 0.015510 second(s), 3 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表