2. 成功解决 BUG:Exception when publishing, ...[Failed to connect and initialize SSH connection...

简介: 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

image.png

问题描述

使用 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
相关文章
|
3月前
|
网络协议 Shell 网络安全
ssh: connect to host github.com port 22: Connection refused
本文讨论了在使用Git命令操作GitHub时遇到的"ssh: connect to host github.com port 22: Connection refused"错误,分析了可能的原因,并提供了使用443端口或https协议作为解决方案,最终确定问题是由于DNS解析错误导致,通过修改hosts文件解决。
ssh: connect to host github.com port 22: Connection refused
|
6月前
|
Linux 网络安全
Linux(16)ssh_exchange_identification: read: Connection reset by peer问题
Linux(16)ssh_exchange_identification: read: Connection reset by peer问题
60 0
|
4月前
|
网络安全 开发工具 git
【git】解决git报错:ssh:connect to host github.com port 22: Connection timed out 亲测有效
【git】解决git报错:ssh:connect to host github.com port 22: Connection timed out 亲测有效
1103 1
|
4月前
|
网络安全 数据安全/隐私保护
服务器密码登录出现了:SSH connection failed: connect ECONNREFUSEDxxxxxxxx:22 * Xshell提示 SSH connection fa
服务器密码登录出现了:SSH connection failed: connect ECONNREFUSEDxxxxxxxx:22 * Xshell提示 SSH connection fa
|
6月前
|
分布式计算 Hadoop 网络安全
[m1pro ] ssh: connect to host localhost port 22: Connection refused
[m1pro ] ssh: connect to host localhost port 22: Connection refused
|
Linux 网络安全 数据安全/隐私保护
Linux下ssh远程主机报错:ssh_exchange_identification: read: Connection 解决
Linux下ssh远程主机报错:ssh_exchange_identification: read: Connection 解决
202 0
|
iOS开发
iOS 逆向编程(Error)ssh_exchange_identification: read: Connection reset by peer
iOS 逆向编程(Error)ssh_exchange_identification: read: Connection reset by peer
139 0
|
Linux Shell 网络安全
【Linux】——在Xshell输入ssh root@公网ip进行远程连接Linux失败,显示(port 22): Connection failed的完美解决方法
【Linux】——在Xshell输入ssh root@公网ip进行远程连接Linux失败,显示(port 22): Connection failed的完美解决方法
960 0
|
分布式计算 Hadoop 程序员
Apache Hadoop 启动报错:masternode:ssh: connect to host master port 22: Connection timed out 总结
Apache Hadoop 启动报错:masternode:ssh: connect to host master port 22: Connection timed out 总结
436 0
Apache Hadoop 启动报错:masternode:ssh: connect to host master port 22: Connection timed out 总结
ssh2 Connection .connect()方法抛出连接过早关闭异常
ssh2 Connection .connect()方法抛出连接过早关闭异常
ssh2 Connection .connect()方法抛出连接过早关闭异常