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
相关文章
|
6月前
|
Linux 网络安全 数据安全/隐私保护
Linux下ssh远程主机报错:ssh_exchange_identification: read: Connection 解决
Linux下ssh远程主机报错:ssh_exchange_identification: read: Connection 解决
|
8月前
|
iOS开发
iOS 逆向编程(Error)ssh_exchange_identification: read: Connection reset by peer
iOS 逆向编程(Error)ssh_exchange_identification: read: Connection reset by peer
86 0
|
Linux Shell 网络安全
【Linux】——在Xshell输入ssh root@公网ip进行远程连接Linux失败,显示(port 22): Connection failed的完美解决方法
【Linux】——在Xshell输入ssh root@公网ip进行远程连接Linux失败,显示(port 22): Connection failed的完美解决方法
618 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 总结
305 0
Apache Hadoop 启动报错:masternode:ssh: connect to host master port 22: Connection timed out 总结
ssh2 Connection .connect()方法抛出连接过早关闭异常
ssh2 Connection .connect()方法抛出连接过早关闭异常
ssh2 Connection .connect()方法抛出连接过早关闭异常
|
网络安全
mac下 ssh: connect to host localhost port 22: Connection refused
mac下 ssh: connect to host localhost port 22: Connection refused
700 0
mac下 ssh: connect to host localhost port 22: Connection refused
|
网络协议 网络安全
SSH Connection reset处理
ssh连接执行命令出现Connection reset失败时的处理方式
1443 1
|
网络安全
mac下 ssh: connect to host localhost port 22: Connection refused
mac下 ssh: connect to host localhost port 22: Connection refused
399 0
|
Linux 网络安全
ssh连接提示 "Connection closed by remote host"
ssh连接提示 "Connection closed by remote host" ** 如果原来是可以用ssh连接的, 突然连接不上通常是连接数过多导致的.
16362 0