After upgrading the EC2 plugin from 1.59 to 1.60.x launching Windows instances no longer functions. Instances will launch, but the plugin is never able to establish connectivity with the remote agent for configuration.
The Jenkins log file indicates a UnsupportedOperationException while negotiating the SMB connection. Stack trace below
2021-06-09 14:55:26.138+0000 [id=73] INFO c.h.smbj.connection.Connection#connect: Successfully connected to: 10.56.36.89
2021-06-09 14:55:26.417+0000 [id=73] WARNING h.plugins.ec2.win.WinConnection#pingFailingIfSSHHandShakeError: Failed to verify connectivity to Windows agent
java.lang.UnsupportedOperationException
{{ at com.hierynomus.security.jce.JceSecurityProvider.getDerivationFunction(JceSecurityProvider.java:64)}}
{{ at com.hierynomus.smbj.connection.SMBSessionBuilder.deriveKey(SMBSessionBuilder.java:302)}}
{{ at com.hierynomus.smbj.connection.SMBSessionBuilder.deriveKeys(SMBSessionBuilder.java:270)}}
{{ at com.hierynomus.smbj.connection.SMBSessionBuilder.setupSession(SMBSessionBuilder.java:162)}}
{{ at com.hierynomus.smbj.connection.SMBSessionBuilder.setupSession(SMBSessionBuilder.java:142)}}
{{ at com.hierynomus.smbj.connection.SMBSessionBuilder.establish(SMBSessionBuilder.java:109)}}
{{ at com.hierynomus.smbj.connection.Connection.authenticate(Connection.java:192)}}
{{ at hudson.plugins.ec2.win.WinConnection.pingFailingIfSSHHandShakeError(WinConnection.java:127)}}
{{ 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:294)}}
{{ 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)}}
This appears to be caused by an update to the smbj dependency
https://github.com/jenkinsci/ec2-plugin/pull/619
The smbj package changed the default SMB protocol from 2 to 3 in v11
https://github.com/hierynomus/smbj/commit/a7e9e074cd129aec61c6ce9cd41734887e4e8674
An issue was submitted with smbj to use BouncyCastle as the default, but is not available in a release as of this issue. It is available on the master branch.
https://github.com/hierynomus/smbj/issues/638
- links to