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
相关文章
|
网络安全 数据安全/隐私保护 开发者
诊断并修复SSH连接Github时遇到的"connection closed"错误。
解决"connection closed"错误往往是一个排除法的过程。需要从基础的网络检查做起,逐步过渡到深入的配置和服务端日志审查。每一步都应当仔细验证,确保不遗漏可能导致连接问题的任何细节。在执行以上步骤后,大多数SSH连接问题可以得到解决。如果所有步骤都未能解决问题,可能需要寻求更专业的技术支持,或者在GitHub社区寻找是否有其他开发者遇到并解决了类似的问题。
1725 0
|
安全 网络安全 数据安全/隐私保护
解决SSH测试连接GitHub时出现“connection closed by remote host”的问题。
然后使用 `ssh -T git@ssh.github.com`来测试连接。
1460 0
|
Linux 网络安全
Linux(16)ssh_exchange_identification: read: Connection reset by peer问题
Linux(16)ssh_exchange_identification: read: Connection reset by peer问题
712 0
|
运维 网络安全
解决ssh: connect to host IP port 22: Connection timed out报错(scp传文件指定端口)
通过这些步骤和方法,您可以有效解决“ssh: connect to host IP port 22: Connection timed out”问题,并顺利使用 `scp`命令传输文件。
18396 7
|
网络协议 Ubuntu Linux
解决ssh: connect to host IP port 22: Connection timed out报错(scp传文件指定端口)
解决 `ssh: connect to host IP port 22: Connection timed out` 报错涉及检查 SSH 服务状态、防火墙配置、网络连通性和主机名解析等多个方面。通过逐步排查上述问题,并在 `scp` 命令中正确指定端口,可以有效解决连接超时的问题,确保文件传输的顺利进行。希望本文提供的解决方案能帮助您快速定位并解决该错误。
5155 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
|
网络安全 开发工具 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 亲测有效
6845 1
|
分布式计算 Hadoop 网络安全
[m1pro ] ssh: connect to host localhost port 22: Connection refused
[m1pro ] ssh: connect to host localhost port 22: Connection refused
464 1
|
网络安全 数据安全/隐私保护
服务器密码登录出现了:SSH connection failed: connect ECONNREFUSEDxxxxxxxx:22 * Xshell提示 SSH connection fa
服务器密码登录出现了:SSH connection failed: connect ECONNREFUSEDxxxxxxxx:22 * Xshell提示 SSH connection fa
|
Linux 网络安全 数据安全/隐私保护
Linux下ssh远程主机报错:ssh_exchange_identification: read: Connection 解决
Linux下ssh远程主机报错:ssh_exchange_identification: read: Connection 解决
988 0