0

Installed Jenkins on Linux machine and jenkins hosted on name say jiort04:8080. Created slave name it as mac-slave in Jenkins and launch method used it as Launch agent via Java Web Start Method and necessary configurations are added. However, it failed to connect to slave said logs and error attached below screen-shot.enter image description here

Log

`

java.net.UnknownHostException: jiort04
 at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
 at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
 at java.net.Socket.connect(Socket.java:589)
 at java.net.Socket.connect(Socket.java:538)
 at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
 at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
 at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
 at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)
 at sun.net.www.http.HttpClient.New(HttpClient.java:308)
 at sun.net.www.http.HttpClient.New(HttpClient.java:326)
 at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1202)
 at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1138)
 at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1022)
 at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1020)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.security.AccessController.doPrivilegedWithCombiner(AccessController.java:782)
 at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1019)
 at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:966)
 at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1546)
 at sun.net.www.protocol.http.HttpURLConnection.access$200(HttpURLConnection.java:91)
 at sun.net.www.protocol.http.HttpURLConnection$9.run(HttpURLConnection.java:1466)
 at sun.net.www.protocol.http.HttpURLConnection$9.run(HttpURLConnection.java:1464)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.security.AccessController.doPrivilegedWithCombiner(AccessController.java:782)
 at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1463)
 at com.sun.deploy.net.HttpUtils.followRedirects(Unknown Source)
 at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source)
 at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source)
 at com.sun.deploy.net.BasicHttpRequest.doGetRequest(Unknown Source)
 at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
 at com.sun.deploy.net.DownloadEngine.downloadResource(Unknown Source)
 at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
 at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
 at com.sun.javaws.LaunchDownload$DownloadTask.call(Unknown Source)
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 at java.lang.Thread.run(Thread.java:745)

`

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Swift
  • 271
  • 3
  • 13
  • There are already a few posts which might cover your problem. Try downloading the jlnp file http://jenkins-ci.361315.n4.nabble.com/UnknownHost-Exception-with-Linux-master-and-window-slave-td4633451.html or https://stackoverflow.com/questions/14277512/problems-launching-the-slave-agent-via-java-web-start-on-jenkins – getjackx May 26 '17 at 06:31

1 Answers1

1

enter image description hereTry this: manage-jenkins -> manage-nodes -> configure -> Host :

put ip of slave here

Setup ssh between master and slave. And if you are using any user credential as shown in image then update ssh key inside user credential.

Avinash
  • 2,093
  • 4
  • 28
  • 41
  • under ManageNodes-> configure no option such as Host. Are you talking about particular node configure still no Host option seen. – Swift May 26 '17 at 06:42
  • Launch method is ssh – Avinash May 26 '17 at 06:43
  • you have to setup ssh connection between two machines. – Avinash May 26 '17 at 06:46
  • okay configured Do i have to now launch agent from mac m/c only ? Because cordova using as project and ios platform build to generate it using mac m/c. – Swift May 26 '17 at 06:47
  • @Avi- getting an following an error [05/26/17 07:57:52] [SSH] Opening SSH connection to 10.5.0.165:22. Cannot find SSH User credentials with id: null [05/26/17 07:57:52] Launch failed - cleaning up connection [05/26/17 07:57:52] [SSH] Connection closed. – Swift May 26 '17 at 06:58
  • @Avi-After adding Credentials using Git and generated access token which is used as password while creating credentials now selected credential under Host- ip address. Failed due to say, [05/26/17 08:03:10] [SSH] Opening SSH connection to 10.5.0.165:22. ERROR: Failed to authenticate as *******. Wrong password. (credentialId: 4bbb0ed1f5b6c8967BT-2a2d-402d-b9e3-4bbb0ed1f5b6/method:password) [05/26/17 08:03:12] [SSH] Authentication failed. Authentication failed. – Swift May 26 '17 at 07:05
  • I have done something like this you can try. Jenkins->credentials->click on your username -> update --> and you will know what to do. I tried add ssh key directly. – Avinash May 26 '17 at 08:27
  • https://stackoverflow.com/questions/44196712/failed-to-authenticate-for-linux-machine-using-ssh-connection trying to do the same. I am getting following an error stiil, thanks. Also had look at this https://linuxacademy.com/community/posts/show/topic/2885-jenkins-this-node-is-offline-because-jenkins-failed-to-launch-the-slave-agent-on-it-see-log-for-more-details but not getting solution where to check. – Swift May 26 '17 at 08:48
  • Thanks but still getting same problem didn't get solution – Swift May 26 '17 at 08:51