Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-56885

It is possible to save a Node without host configuration

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 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>
      

          [JENKINS-56885] It is possible to save a Node without host configuration

          Hao Maio created issue -
          Hao Maio made changes -
          Description Original: 1)
          | |Host Key Verification Strategy| Known hosts for Verification Strategy|

           

          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

          2)  
          | |Host Key Verification Strategy| Non verifying Verification Strategy|

           

          [SSH] Opening SSH connection to null:22.
          New: 1)
          | |Host Key Verification Strategy| Known hosts for Verification Strategy|

           

          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

          2)  
          | |Host Key Verification Strategy| Non verifying Verification Strategy|

           

          [SSH] Opening SSH connection to null:22.

           

          EDIT 05-04-2019

          -----------------------------

          *Config.xml*

          <?xml version='1.1' encoding='UTF-8'?>
          <slave>
             <name>slave01</name>
             <description>Slave for building and packaging (the delivery)</description>
             <remoteFS>/home/userName/jenkins_slave_node</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>xxxxxxxx-xxxx-xxxx-8dd0-f9d5a90c058d</credentialsId>
                 <launchTimeoutSeconds>210</launchTimeoutSeconds>
                 <maxNumRetries>10</maxNumRetries>
                 <retryWaitTime>15</retryWaitTime>
                 <sshHostKeyVerificationStrategy class="hudson.plugins.sshslaves.verifiers.NonVerifyingKeyVerificationStrategy"/>
                 <tcpNoDelay>true</tcpNoDelay>
            </launcher>
            <label>deliver packaging customer_release</label>
            <nodeProperties/>
          </slave>
          Hao Maio made changes -
          Attachment New: Screenshot from 2019-04-05 13-00-24.png [ 46641 ]
          Ivan Fernandez Calvo made changes -
          Summary Original: hostnameMatches -> NullPointerException New: It is possible to save a Node without host configuration
          Ivan Fernandez Calvo made changes -
          Description Original: 1)
          | |Host Key Verification Strategy| Known hosts for Verification Strategy|

           

          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

          2)  
          | |Host Key Verification Strategy| Non verifying Verification Strategy|

           

          [SSH] Opening SSH connection to null:22.

           

          EDIT 05-04-2019

          -----------------------------

          *Config.xml*

          <?xml version='1.1' encoding='UTF-8'?>
          <slave>
             <name>slave01</name>
             <description>Slave for building and packaging (the delivery)</description>
             <remoteFS>/home/userName/jenkins_slave_node</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>xxxxxxxx-xxxx-xxxx-8dd0-f9d5a90c058d</credentialsId>
                 <launchTimeoutSeconds>210</launchTimeoutSeconds>
                 <maxNumRetries>10</maxNumRetries>
                 <retryWaitTime>15</retryWaitTime>
                 <sshHostKeyVerificationStrategy class="hudson.plugins.sshslaves.verifiers.NonVerifyingKeyVerificationStrategy"/>
                 <tcpNoDelay>true</tcpNoDelay>
            </launcher>
            <label>deliver packaging customer_release</label>
            <nodeProperties/>
          </slave>
          New: 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

          !Screenshot from 2019-04-05 13-00-24.png!

          Agent connection log

          {code}
          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
          {code}
           

          *Config.xml*

          {code}
          <?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>
          {code}
          Ivan Fernandez Calvo made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Ivan Fernandez Calvo made changes -
          Remote Link New: This issue links to "PR (Web Link)" [ 22561 ]
          Ivan Fernandez Calvo made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Ivan Fernandez Calvo made changes -
          Attachment New: Screenshot 2019-04-07 at 14.41.02.png [ 46651 ]
          Ivan Fernandez Calvo made changes -
          Attachment New: Screenshot 2019-04-07 at 14.41.35.png [ 46652 ]
          Hao Maio made changes -
          Attachment New: Screenshot from 2019-04-08 16-45-27.png [ 46655 ]

            ifernandezcalvo Ivan Fernandez Calvo
            jenbeg Hao Maio
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: