jenkinsci / jenkinsci/ec2-plugin

[JENKINS-66736] Connect to Windows Agent failing with "different server found for same hostname"

Open
#1,841 3 comments 0 reactions 0 assignees View on GitHub
component:ec2-plugin imported-jira-issue priority:blocker resolution:unresolved
Dominant language
Java
Stars
292
Forks
709
Avg merge
3d 16h
Merged PRs (30d)
4

Description

Agent launches and begins to connect, but then log on master/controller shows error below and eventually Windows agent connection times out as failure. No Windows agents are thus available to perform build tasks.

{{2021-09-26 14:28:22.740+0000 [id=3752]  INFO    c.h.smbj.connection.Connection#close: Closed connection to 10.134.37.223

2021-09-26 14:28:22.740+0000 [id=3901] INFO c.h.smbj.transport.PacketReader#run: Thread[Packet Reader for 10.134.37.223,5,main] stopped.
2021-09-26 14:28:22.740+0000 [id=3752] WARNING h.plugins.ec2.win.WinConnection#pingFailingIfSSHHandShakeError: Failed to verify connectivity to Windows agent
com.hierynomus.protocol.transport.TransportException: Different server found for same hostname '10.134.37.223', disconnecting...
at com.hierynomus.smbj.connection.SMBProtocolNegotiator.initializeOrValidateServerDetails(SMBProtocolNegotiator.java:232)
at com.hierynomus.smbj.connection.SMBProtocolNegotiator.negotiateDialect(SMBProtocolNegotiator.java:83)
at com.hierynomus.smbj.connection.Connection.connect(Connection.java:141)
at com.hierynomus.smbj.SMBClient.getEstablishedOrConnect(SMBClient.java:96)
at com.hierynomus.smbj.SMBClient.connect(SMBClient.java:71)
at hudson.plugins.ec2.win.WinConnection.pingFailingIfSSHHandShakeError(WinConnection.java:136)
at hudson.plugins.ec2.win.EC2WindowsLauncher.connectToWinRM(EC2WindowsLauncher.java:189)
at hudson.plugins.ec2.win.EC2WindowsLauncher.launchScript(EC2WindowsLauncher.java:52)
at hudson.plugins.ec2.EC2ComputerLauncher.launch(EC2ComputerLauncher.java:48)
at hudson.slaves.SlaveComputer.lambda$_connect$0(SlaveComputer.java:295)
at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:80)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)}}

The issue seems tied to this method where the cached server is being validated and coming back as invalid from here.

This seems to be regression in 1.64 version of the plugin as nothing in our environment has changed since this was validated as working with version 1.61.

---
Originally reported by guy_davis, imported from: Connect to Windows Agent failing with "different server found for same hostname"


  • assignee: raihaan
  • status: Open
  • priority: Blocker
  • component(s): ec2-plugin
  • label(s): plugin, windows
  • resolution: Unresolved
  • votes: 0
  • watchers: 3
  • imported: 2025-12-06

Raw content of original issue

Agent launches and begins to connect, but then log on master/controller shows error below and eventually Windows agent connection times out as failure. No Windows agents are thus available to perform build tasks.


{{2021-09-26 14:28:22.740+0000 [id=3752]  INFO    c.h.smbj.connection.Connection#close: Closed connection to 10.134.37.223

2021-09-26 14:28:22.740+0000 [id=3901] INFO c.h.smbj.transport.PacketReader#run: Thread[Packet Reader for 10.134.37.223,5,main] stopped.
2021-09-26 14:28:22.740+0000 [id=3752] WARNING h.plugins.ec2.win.WinConnection#pingFailingIfSSHHandShakeError: Failed to verify connectivity to Windows agent
com.hierynomus.protocol.transport.TransportException: Different server found for same hostname '10.134.37.223', disconnecting...
at com.hierynomus.smbj.connection.SMBProtocolNegotiator.initializeOrValidateServerDetails(SMBProtocolNegotiator.java:232)
at com.hierynomus.smbj.connection.SMBProtocolNegotiator.negotiateDialect(SMBProtocolNegotiator.java:83)
at com.hierynomus.smbj.connection.Connection.connect(Connection.java:141)
at com.hierynomus.smbj.SMBClient.getEstablishedOrConnect(SMBClient.java:96)
at com.hierynomus.smbj.SMBClient.connect(SMBClient.java:71)
at hudson.plugins.ec2.win.WinConnection.pingFailingIfSSHHandShakeError(WinConnection.java:136)
at hudson.plugins.ec2.win.EC2WindowsLauncher.connectToWinRM(EC2WindowsLauncher.java:189)
at hudson.plugins.ec2.win.EC2WindowsLauncher.launchScript(EC2WindowsLauncher.java:52)
at hudson.plugins.ec2.EC2ComputerLauncher.launch(EC2ComputerLauncher.java:48)
at hudson.slaves.SlaveComputer.lambda$_connect$0(SlaveComputer.java:295)
at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:80)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)}}

The issue seems tied to this method where the cached server is being validated and coming back as invalid from here.

This seems to be regression in 1.64 version of the plugin as nothing in our environment has changed since this was validated as working with version 1.61.

environment

```
Jenkins version: 2.303.1

ec2-plugin: 1.64

Master/Controller OS: CentOS 7 (fully up-to-date)

Slave/Agent OS: Windows Server 2019
```

Contributor guide

Open the contributing guide

Research direction

Start with the Windows connection path in WinConnection.java and EC2WindowsLauncher.java, then inspect the referenced SMBProtocolNegotiator.java validation path. Reproduce the Windows agent connection failure and compare behavior between ec2-plugin 1.61 and 1.64; done means the agent connects without the reported timeout or server-identity error.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, java
Domain
cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.