Steps to reproduce
- Create a job with a task of type SSH that could run SSH commands on a remote server.
- Choose the authentication type to either Key without passphrase OR key with passphrase
- Enter a command such as "mkdir /home/smaiyaki/hello"
- Run the build and it will fail with the following error in the build logs.
Failed to connect to host net.schmizz.sshj.userauth.UserAuthException: Exhausted available authentication methods at net.schmizz.sshj.userauth.UserAuthImpl.authenticate(UserAuthImpl.java:114) at net.schmizz.sshj.SSHClient.auth(SSHClient.java:205) at net.schmizz.sshj.SSHClient.authPublickey(SSHClient.java:305) at com.atlassian.bamboo.plugins.scp.SshTask.execute(SshTask.java:82) at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:187) at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:93) at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:87) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:206) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:103) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:111) at com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$2.run(NamedThreadFactory.java:52) at java.lang.Thread.run(Thread.java:722) Caused by: net.schmizz.sshj.userauth.UserAuthException: publickey auth failed at net.schmizz.sshj.userauth.UserAuthImpl.handle(UserAuthImpl.java:157) at net.schmizz.sshj.transport.TransportImpl.handle(TransportImpl.java:474) at net.schmizz.sshj.transport.Decoder.decode(Decoder.java:127) at net.schmizz.sshj.transport.Decoder.received(Decoder.java:195) at net.schmizz.sshj.transport.Reader.run(Reader.java:72)
The following appears in the server logs:
2013-01-30 22:11:45,417 INFO [qtp35496097-123] [AccessLogFilter] sultan GET http://localhost:1044/bamboo44/ajax/viewPlanUpdates.action?sinceSystemTime=0&lastProject= 158047kb 2013-01-30 22:11:45,532 DEBUG [qtp35496097-123] [AccessLogFilter] END: sultan GET http://localhost:1044/bamboo44/ajax/viewPlanUpdates.action?sinceSystemTime=0&lastProject= 158047kb-68706kb 115ms 2013-01-30 22:11:50,056 ERROR [7-BAM::Default Agent::Agent:pool-16-thread-1] [Promise] <<authenticated>> woke to: net.schmizz.sshj.userauth.UserAuthException: publickey auth failed 2013-01-30 22:11:50,056 INFO [7-BAM::Default Agent::Agent:pool-16-thread-1] [UserAuthImpl] `publickey` auth failed 2013-01-30 22:11:50,062 INFO [7-BAM::Default Agent::Agent:pool-16-thread-1] [ExecuteBuildTask] TESTA-SCP-JOB1-12: Running post build plugin 'NCover Results Collector' 2013-01-30 22:11:50,092 INFO [7-BAM::Default Agent::Agent:pool-16-thread-1] [NCoverBuildProcessor] inside NCoverBuildProcessor.call()
This issue is replicable even with the default SSH port of 22. Changing the authentication type to password works fine.
Edits
The password authentication also fails if the SSH port is not the default 22 with the error message below thrown in the build logs:
Failed to connect to host java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:69) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391) at java.net.Socket.connect(Socket.java:579) at net.schmizz.sshj.SocketClient.connect(SocketClient.java:70) at net.schmizz.sshj.SocketClient.connect(SocketClient.java:77) at net.schmizz.sshj.SocketClient.connect(SocketClient.java:103) at com.atlassian.bamboo.plugins.scp.SshTask.execute(SshTask.java:74) at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:187) at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:93) at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:87) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:206) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:103) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:111) at com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$2.run(NamedThreadFactory.java:52) at java.lang.Thread.run(Thread.java:722)
- is related to
-
BDEV-11202 Loading...
- was cloned as
-
BDEV-9270 Loading...