git 服务器拒绝连接:没有接受任何协议

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/35309316/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 11:46:56  来源:igfitidea点击:

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

javagitjenkinsmaster-slave

提问by Sid

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

当我在客户端 VM中将 Jenkins 作为 Windows 服务启动时,我遇到了一个奇怪的问题。

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

1)我在客户端主机(Windows VM)中将Jenkins作为Windows服务启动 并将我的本地机器配置为从,但我无法在主从机之间建立连接。我收到以下错误:

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

“java.lang.Exception:服务器拒绝了连接:没有接受任何协议”

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

主站和从站都在同一个网络中(客户端的网络,使用 VPN 连接的从站)。

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

客户端 主机域名 ABC
本地机域名 xyz

console output

控制台输出

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

2)我已经停止了 Jenkins 作为 Windows 服务,并通过命令提示符使用

"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 masterand one of the local machine as slave, and successfully established the connection between master and slave.

3)现在我已经在我的**本地机器上启动了Jenkins作为Windows服务作为主机,其中一台本地机器作为从机,并成功建立了主从之间的连接。

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

没有使用点(1)在主从之间建立连接的确切原因是什么?

回答by LuFFy

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

问题是JENKINS侧面的。这个Bug已经上调JENKINS论坛和状态仍是关键-未解决

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

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.

计划批处理正在尝试使用以下脚本启动从代理:

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

当从代理打开时,除了包含的错误之外,它什么也做不了。重新启动后,此问题无法重现,但当从站过夜时,这似乎更为常见。

回答by junior1024

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.

从 Jenkins 1.x 升级到 2.x 后,我从未清除过奴隶的远程根目录(在我的情况下是 c:\jenkins)。每次我将奴隶安装为服务时,我都会得到完全相同的错误。经过无数次白发后,我终于找到了我的问题:一旦我从该目录中删除了内容,并将 jenkins 从站安装为 Windows 服务,内容就会重新填充,从站按预期连接。

Hope this helps

希望这可以帮助

回答by Max

In my case that was linked to disabled protocol.

在我的情况下,这与禁用的协议有关。

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

检查下一步:如果您的 Jenkins 支持 JNLPv4,请在使用前启用它。

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

Jenkins -> 全局安全配置 -> 代理 -> 代理协议 -> 入站 TCP 代理协议/4(TLS 加密)

enter image description here

在此处输入图片说明

回答by Abhishek D K

i faced similar issue

我遇到了类似的问题

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

必须从 cmd运行slave-agent.jar(以管理员身份运行)

> javaws "location of slave-agent.jar"  

回答by Danni Popova

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

我通过安装早期版本的 Java 修复了它。我使用了 1.8.0_131 JDK。

回答by FredM

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.

我也遇到了这个问题并且能够解决它,也许吧?碰巧的是,同一个代理正在不同的 VM 上运行。我关闭了它,重新连接成功,没有错误信息了。

回答by Manoj

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.

我遇到了同样的问题并添加了上述答案,我在 Jenkins master 中禁用了防火墙,一切正常。此外,这在生产环境中是绝对不推荐的。新手不知道如何配置防火墙,这是在家庭实验室完成的,所以我发现它很有用。