Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The server rejected the connection: None of the protocols were accepted

I'm facing a weird issue when I launch Jenkins as Windows service in my client VM.

1) I have launched Jenkins as Windows service in my client side master machine (a Windows VM) and configured my local machine as a slave and I'm unable to establish the connection between master and slave. I'm getting the following error:

"java.lang.Exception: The server rejected the connection: None of the protocols were accepted"

Both master and slave are in same network (client's network, connected slave using VPN).

Client Master machine's domain name ABC
Local machine domain name xyz

console output

2) I have stopped the Jenkins as Windows service and launched again through command prompt using

"java -jar jenkins.war"

now I'm able to establish connection between master and slave without any issues.

3) Now I have launched Jenkins as Windows service in my **local machine as master and one of the local machine as slave, and successfully established the connection between master and slave.

What exactly is the reason for not establishing the connection between master and slave using point (1)?

like image 267
Sid Avatar asked Feb 10 '16 07:02

Sid


5 Answers

I fixed it by installing an earlier version of Java. I used the 1.8.0_131 JDK.

like image 157
Danni Popova Avatar answered Oct 20 '22 03:10

Danni Popova


In my case that was linked to disabled protocol.

Check next: If your Jenkins is supporting JNLPv4, enable it before use.

Jenkins -> Global Security Configuration -> Agents -> Agent protocols -> Inbound TCP Agent Protocol/4 (TLS encryption)

enter image description here

like image 23
Max Avatar answered Oct 20 '22 05:10

Max


The issue is from JENKINS side. The Bug is already raised on JENKINS Forum & Status is still Critical & Unresolved :

https://issues.jenkins-ci.org/browse/JENKINS-29616

As Per the Description :

A scheduled batch is attempting to start the slave agent with the following script:

taskkill /f /im "EXCEL.exe"
taskkill /f /im "ipy.exe"
taskkill /f /im "jp2launcher.exe"

javaws http://172.16.8.57:8080/computer/SSW73210/slave-agent.jnlp

When the slave agent opens, it fails to do anything but the enclosed error. After rebooting, this issue fails to reproduce, but this seems dramatically more common when the slave is left on overnight.

like image 23
LuFFy Avatar answered Oct 20 '22 03:10

LuFFy


I had a similar issue, here is what I did to resolve mine:

After upgrading from Jenkins 1.x to 2.x I never cleared the remote root directory of the slaves (in my case c:\jenkins). Everytime I installed the slave as a service I would get the exact same error. I finally figured out my problem after numerous grey hair: Once I removed the contents from that directory, and installed the jenkins slave as a windows service, the contents were repopulated and the slave connected as expected.

Hope this helps

like image 23
junior1024 Avatar answered Oct 20 '22 03:10

junior1024


I also faced this issue and was able to fix it, maybe? It happened that a same agent was running on a different VM. I closed it, reconnected successfully and no error message anymore.

like image 35
FredM Avatar answered Oct 20 '22 03:10

FredM