简体   繁体   中英

This node is offline because Jenkins failed to launch the slave agent on it

I'm not sure of what the proper steps are for configuring the Jenkins master to build/deploy these jobs to a new slave, and how to set up the new slave, but it is giving an error. For instance, do I need to install anything on the new slave, or do any kind of setup/config? & I'm configuring on Ubuntu OS .

just before slave node1 gets launched ...
    executing pre-launch scripts ...
    [06/25/15 13:06:55] [SSH] Opening SSH connection to 192.168.4.153:22.
    ERROR: Server rejected the 1 private key(s) for jenkins (credentialId:fd3affc2-25a4-4b24-9e21-275badb8b6d9/method:publickey)
    ERROR: Failed to authenticate as jenkins with credential=fd3affc2-25a4-4b24-9e21-275badb8b6d9
    java.io.IOException: Publickey authentication failed.
        at com.trilead.ssh2.auth.AuthenticationManager.authenticatePublicKey(AuthenticationManager.java:315)
        at com.trilead.ssh2.Connection.authenticateWithPublicKey(Connection.java:467)
        at com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPublicKeyAuthenticator.doAuthenticate(TrileadSSHPublicKeyAuthenticator.java:109)
        at com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.authenticate(SSHAuthenticator.java:408)
        at com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.authenticate(SSHAuthenticator.java:428)
        at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:1173)
        at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:701)
        at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:696)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
    Caused by: java.io.IOException: Decrypted PEM has wrong padding, did you specify the correct password?
        at com.trilead.ssh2.crypto.PEMDecoder.removePadding(PEMDecoder.java:110)
        at com.trilead.ssh2.crypto.PEMDecoder.decryptPEM(PEMDecoder.java:287)
        at com.trilead.ssh2.crypto.PEMDecoder.decode(PEMDecoder.java:320)
        at com.trilead.ssh2.auth.AuthenticationManager.authenticatePublicKey(AuthenticationManager.java:224)
        ... 11 more
    [06/25/15 13:06:55] [SSH] Authentication failed.
    hudson.AbortException: Authentication failed.
        at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:1178)
        at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:701)
        at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:696)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
    [06/25/15 13:06:55] Launch failed - cleaning up connection
    [06/25/15 13:06:55] [SSH] Connection closed.

This article explains how to connect a slave to the master using the master public ssh key: https://www.caktusgroup.com/blog/2012/01/10/configuring-jenkins-slave/

To resume:

  • Generate a public SSH key on the master: ssh-keygen -t rsa (with no paraphrase)
  • Copy the public master key from .ssh/id_rsa.pub
  • On the slave, paste the public key in /home/jenkins/.ssh/authorized_keys (if /home/jenkins is your home folder)

Please confirm it solves your issue.

The .ssh directory must have proper access permissions that group and others cannot have write permissions. chmod 700 ~/.ssh should make it work

The real issue in question is Caused by: java.io.IOException: Decrypted PEM has wrong padding, did you specify the correct password? so there maybe mistake in private key text or wrong passphrase.

In my case I've got an error PEM problem: it is of unknown type with key which looks like valid:

-----BEGIN RSA PRIVATE KEY-----
...
...
-----END RSA PRIVATE KEY----

but it's not valid because I've lost last "-" character when copy/paste private key from terminal, so the right form should be:

-----BEGIN RSA PRIVATE KEY-----
...
...
-----END RSA PRIVATE KEY-----

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM