2. 成功解决 BUG:Exception when publishing, ...[Failed to connect and initialize SSH connection...
2023-06-14 2336
版权
版权声明:
本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《 阿里云开发者社区用户服务协议》和 《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写 侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
简介: SSH: Connecting from host [WIN-...]SSH: Connecting with configuration [192.168....] ...ERROR: Exception when publishing, exception message [Failed to connect and initialize SSH connection. Message: [Failed to connect session for config [192.168....]. Message [java.net.ConnectException: Connection
使用 Jenkins 构建项目时,提示下面错误:
... SSH: Connecting from host [WIN-...] SSH: Connecting with configuration [192.168....] ... ERROR: Exception when publishing, exception message [Failed to connect and initialize SSH connection. Message: [Failed to connect session for config [192.168....]. Message [java.net.ConnectException: Connection timed out: connect]]] Build step 'Send build artifacts over SSH' changed build result to UNSTABLE Finished: UNSTABLE 原因分析从错误信息可以看出是 Jenkins 服务器连接生产服务器未成功,需要登录 Jenkins 服务器进行问题排查。
登录 Jenkins 服务器,通过 ping 测试是否能连通生产服务器。经过测试,确实无法连通。
解决方案Jenkins 服务器连接生产服务器通常会使用 VPN 等工具,经检查是因为 VPN 登录失败原因导致的。
重新登录 VPN ,能够连通生产服务器了。再次构建 Jenkins 项目,可以正常发布。
SSH: EXEC: completed after 15,584 ms SSH: Disconnecting configuration [192.168....] ... SSH: Transferred 1 file(s) Finished: SUCCESS