Dockerのslaveコンテナ起動エラー@パスワード貼り付けミス

Jenkinsを起動した後、slaveコンテナを起動したところ以下のエラーが表示されました。

Slave01エージェントをクリックし状態を確認します。

f:id:lawrence-twin:20200420225613p:plain

以下の通り起動に失敗しているとエラーログが出ています。

詳細を確認する場合は「See log for more deails」

再起動する場合は「Launch Agent1」を実行します。

f:id:lawrence-twin:20200421212530p:plain

 

確認したところ以下のエラーが出ています。

■エラーログ

SSHLauncher{host='slave01', port=22, credentialsId='3e32bf5d-093a-468e-adf2-7ed1717f1269', jvmOptions='', javaPath='', prefixStartSlaveCmd=‘’,
suffixStartSlaveCmd='', launchTimeoutSeconds=60, maxNumRetries=10, retryWaitTime=15,
sshHostKeyVerificationStrategy=hudson.plugins.sshslaves.verifiers.NonVerifyingKeyVerificationStrategy, tcpNoDelay=true, trackCredentials=true}
[04/19/20 13:13:43] [SSH] Opening SSH connection to slave01:22.
[04/19/20 13:13:43] [SSH] WARNING: SSH Host Keys are not being verified. Man-in-the-middle attacks may be possible against this connection.
ERROR: Server rejected the 1 private key(s) for jenkins (credentialId:3e32bf5d-093a-468e-adf2-7ed1717f1269/method:publickey)
ERROR: Failed to authenticate as jenkins with credential=3e32bf5d-093a-468e-adf2-7ed1717f1269
java.io.IOException: Publickey authentication failed.
at com.trilead.ssh2.auth.AuthenticationManager.authenticatePublicKey(AuthenticationManager.java:358)
at com.trilead.ssh2.Connection.authenticateWithPublicKey(Connection.java:472)
at com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPublicKeyAuthenticator.doAuthenticate(TrileadSSHPublicKeyAuthenticator.java:109)
at com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.authenticate(SSHAuthenticator.java:436)
at com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.authenticate(SSHAuthenticator.java:473)
at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:863)
at hudson.plugins.sshslaves.SSHLauncher$1.call(SSHLauncher.java:435)
at hudson.plugins.sshslaves.SSHLauncher$1.call(SSHLauncher.java:422)
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)
Caused by: java.io.IOException: PEM problem: it is of unknown type
at com.trilead.ssh2.crypto.PEMDecoder.decodeKeyPair(PEMDecoder.java:500)
at com.trilead.ssh2.auth.AuthenticationManager.authenticatePublicKey(AuthenticationManager.java:292)
... 11 more
[04/19/20 13:13:43] [SSH] Authentication failed.
Authentication failed.

 

■原因

private keyの貼り付けミス。

以下の図の通り、jenkinsの認証情報を保存するにあたって-----BEGIN...の部分をコピーしていなかった。(いらないと誤認していた。)

 

f:id:lawrence-twin:20200420230223p:plain

 

認証情報に貼り付けるパスワードが適切になったことで上記エラーは解消しましたが、また別のエラーが出ているのそちらは次の記事で記載します。