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

Slave SetupPlugin unable to start node on-demand using "Launch agents via SSH" method

XMLWordPrintable

      Started without slave-setup-plugin installed.

      Add a number of nodes that are started with launch method "Launch agents via SSH".

      Installed slave-setup-plugin@1.10.

      Took one node and made the following config changes:

      • Launch method: Start and stop this node on-demand
        • Start script: echo "Testing slave-setup - start"
        • Stop script: echo "Testing slave-setup - stop"
        • Actual launch method: Launch agents via SSH
        • Host: <IP address>
        • Credentials: Jenkins user on master
        • Host Key Verification Strategy: Known hosts file Verification Strategy
      • Availability: Bring this agent online when in demand, and take offline when idle
        • In demand delay: 0
        • Idle delay: 5

      When the node is restarted, it is now failing with the following message:

      SSHLauncher{host='A.B.C.D', port=22, credentialsId='*****', jvmOptions='', javaPath='', prefixStartSlaveCmd='', suffixStartSlaveCmd='', launchTimeoutSeconds=60, maxNumRetries=10, retryWaitTime=15, sshHostKeyVerificationStrategy=hudson.plugins.sshslaves.verifiers.KnownHostsFileKeyVerificationStrategy, tcpNoDelay=true, trackCredentials=true}
      [06/09/21 15:34:38] [SSH] Opening SSH connection to A.B.C.D:22.
      Key exchange was not finished, connection is closed.
      SSH Connection failed with IOException: "Key exchange was not finished, connection is closed.", retrying in 15 seconds. There are 10 more retries left.
      Key exchange was not finished, connection is closed.
      SSH Connection failed with IOException: "Key exchange was not finished, connection is closed.", retrying in 15 seconds. There are 9 more retries left.
      Key exchange was not finished, connection is closed.
      SSH Connection failed with IOException: "Key exchange was not finished, connection is closed.", retrying in 15 seconds. There are 8 more retries left.
      Key exchange was not finished, connection is closed.
      SSH Connection failed with IOException: "Key exchange was not finished, connection is closed.", retrying in 15 seconds. There are 7 more retries left.
      Key exchange was not finished, connection is closed.
      SSH Connection failed with IOException: "Key exchange was not finished, connection is closed.", retrying in 15 seconds. There are 6 more retries left.
      Key exchange was not finished, connection is closed.
      SSH Connection failed with IOException: "Key exchange was not finished, connection is closed.", retrying in 15 seconds. There are 5 more retries left.
      Key exchange was not finished, connection is closed.
      SSH Connection failed with IOException: "Key exchange was not finished, connection is closed.", retrying in 15 seconds. There are 4 more retries left.
      Key exchange was not finished, connection is closed.
      SSH Connection failed with IOException: "Key exchange was not finished, connection is closed.", retrying in 15 seconds. There are 3 more retries left.
      Key exchange was not finished, connection is closed.
      SSH Connection failed with IOException: "Key exchange was not finished, connection is closed.", retrying in 15 seconds. There are 2 more retries left.
      Key exchange was not finished, connection is closed.
      SSH Connection failed with IOException: "Key exchange was not finished, connection is closed.", retrying in 15 seconds. There are 1 more retries left.
      Key exchange was not finished, connection is closed.
      ERROR: Connection is not established!
      java.lang.IllegalStateException: Connection is not established!
      	at com.trilead.ssh2.Connection.getRemainingAuthMethods(Connection.java:988)
      	at com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPublicKeyAuthenticator.getRemainingAuthMethods(TrileadSSHPublicKeyAuthenticator.java:88)
      	at com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPublicKeyAuthenticator.canAuthenticate(TrileadSSHPublicKeyAuthenticator.java:80)
      	at com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.newInstance(SSHAuthenticator.java:218)
      	at com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.newInstance(SSHAuthenticator.java:171)
      	at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:865)
      	at hudson.plugins.sshslaves.SSHLauncher$1.call(SSHLauncher.java:436)
      	at hudson.plugins.sshslaves.SSHLauncher$1.call(SSHLauncher.java:423)
      	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)
      [06/09/21 15:37:23] Launch failed - cleaning up connection
      [06/09/21 15:37:23] [SSH] Connection closed.
      

      Discovered that with "Launch method: Start and stop this node on-demand" / "Actual launch method: Launch agents via SSH", if I change the Host Key Verification Strategy to "Non verifying Verification Strategy" the plug-in is able to connect to the node.

      If I switch the main Launch method back to "Launch agents via SSH", Jenkins is able to successfully connect to the node via ssh and the node comes back online.

            peppe Giuseppe Landolfi
            klphoto Ken
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: