-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major
-
Component/s: core, ssh-plugin, ssh-slaves-plugin, trilead-api-plugin
-
Environment:org.jenkins-ci.main:jenkins-war:2.170
org.jenkins-ci:crypto-util:1.1
org.jenkins-ci.modules:sshd:2.6
org.kohsuke:trilead-putty-extension:1.2
org.jenkins-ci.modules:ssh-cli-auth:1.5
org.jenkins-ci.plugins:ssh-slaves:1.29.4
-
ssh-slaves-1.30.0
If you do not set the host field in the Node configuration it is possible to save it, then when it tries to connect fails with an NPE

Agent connection log
ERROR: Unexpected error in launching a agent. This is probably a bug in Jenkins. java.lang.NullPointerException at com.trilead.ssh2.KnownHosts.hostnameMatches(KnownHosts.java:313) at com.trilead.ssh2.KnownHosts.getAllKnownHostEntries(KnownHosts.java:260) at com.trilead.ssh2.KnownHosts.recommendHostkeyAlgorithms(KnownHosts.java:504) at com.trilead.ssh2.KnownHosts.getPreferredServerHostkeyAlgorithmOrder(KnownHosts.java:282) at hudson.plugins.sshslaves.verifiers.KnownHostsFileKeyVerificationStrategy.getPreferredKeyAlgorithms(KnownHostsFileKeyVerificationStrategy.java:92) at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:837) at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:833) 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) [04/04/19 15:40:41] Launch failed - cleaning up connection
Â
Config.xml
<?xml version='1.1' encoding='UTF-8'?> <slave> Â Â <name>agentNullHost</name> Â Â <description>agent description</description> Â Â <remoteFS>/home/jenkins</remoteFS> Â Â <numExecutors>1</numExecutors> Â Â <mode>NORMAL</mode> Â Â <retentionStrategy class="hudson.slaves.RetentionStrategy$Always"/> Â Â Â <launcher class="hudson.plugins.sshslaves.SSHLauncher" plugin="ssh-slaves@1.29.4"> Â Â Â Â Â Â <port>22</port> Â Â Â Â Â Â <credentialsId>my-credentials</credentialsId> Â Â Â Â <launchTimeoutSeconds>210</launchTimeoutSeconds> Â Â Â Â Â Â <maxNumRetries>10</maxNumRetries> Â Â Â Â <retryWaitTime>15</retryWaitTime> Â Â Â Â Â Â <sshHostKeyVerificationStrategy class="hudson.plugins.sshslaves.verifiers.NonVerifyingKeyVerificationStrategy"/> Â Â Â Â <tcpNoDelay>true</tcpNoDelay> Â </launcher> Â <label>linux</label> Â <nodeProperties/> </slave>
- links to