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

余生长醉 提交于 2020-04-12 11:04:52

问题


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

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)?


回答1:


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.




回答2:


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




回答3:


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




回答4:


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.




回答5:


I faced the same issue and adding to the above answers, I disabled firewall in Jenkins master and everything went fine. Also, this is strictly not recommended for production environments. Newbie didn't know how to configure firewall and this was done at home lab, so I found it useful.




回答6:


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)




回答7:


i faced similar issue

had to run the slave-agent.jar from cmd ( run as Administrator )

> javaws "location of slave-agent.jar"  


来源:https://stackoverflow.com/questions/35309316/the-server-rejected-the-connection-none-of-the-protocols-were-accepted

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!