Jenkins slave无法与master连接:确认序列不正确

时间:2017-06-22 11:57:05

标签: jenkins jenkins-slave

将我们的Jenkins主安装更新到最新的LTS版本2.46.3后,其中一个从属设备(Windows 7计算机,32位)无法与主设备连接。

我们得到的错误是:

java -jar slave.jar -jnlpUrl https://<jenkins-name>/computer/<node-name>/slave-agent.jnlp -secret <secret-value>
Jun 22, 2017 1:19:05 PM hudson.remoting.jnlp.Main createEngine
INFO: Setting up slave: node-name
Jun 22, 2017 1:19:05 PM hudson.remoting.jnlp.Main$CuiListener <init>
INFO: Jenkins agent is running in headless mode.
Jun 22, 2017 1:19:05 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Locating server among [https://<jenkins-name>/]
Jun 22, 2017 1:19:05 PM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolve
INFO: Remoting server accepts the following protocols: [JNLP3-connect, JNLP-connect, CLI2-connect, Ping, CLI-connect, JNLP4-connect, JNLP2-c
onnect]
Jun 22, 2017 1:19:05 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Agent discovery successful
  Agent address: <jenkins-name>
  Agent port:    <jenkins-port>
  Identity:      <id:en:ti:ty>
Jun 22, 2017 1:19:05 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Handshaking
Jun 22, 2017 1:19:05 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connecting to <jenkins-name>:9150
Jun 22, 2017 1:19:05 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Trying protocol: JNLP4-connect
Jun 22, 2017 1:19:05 PM org.jenkinsci.remoting.protocol.impl.AckFilterLayer abort
WARNING: [JNLP4-connect connection to <our-proxy>/10.253.0.11:81] Incorrect acknowledgement sequence, expected 0x0003414333 got 0x4854545044
Jun 22, 2017 1:19:05 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Protocol JNLP4-connect encountered an unexpected exception
java.util.concurrent.ExecutionException: org.jenkinsci.remoting.protocol.impl.ConnectionRefusalException: Connection closed before acknowled
gement sent
        at org.jenkinsci.remoting.util.SettableFuture.get(SettableFuture.java:223)
        at hudson.remoting.Engine.innerRun(Engine.java:385)
        at hudson.remoting.Engine.run(Engine.java:287)
Caused by: org.jenkinsci.remoting.protocol.impl.ConnectionRefusalException: Connection closed before acknowledgement sent
        at org.jenkinsci.remoting.protocol.impl.AckFilterLayer.onRecvClosed(AckFilterLayer.java:280)
        at org.jenkinsci.remoting.protocol.FilterLayer.abort(FilterLayer.java:164)
        at org.jenkinsci.remoting.protocol.impl.AckFilterLayer.abort(AckFilterLayer.java:130)
        at org.jenkinsci.remoting.protocol.impl.AckFilterLayer.onRecv(AckFilterLayer.java:258)
        at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.onRecv(ProtocolStack.java:669)
        at org.jenkinsci.remoting.protocol.NetworkLayer.onRead(NetworkLayer.java:136)
        at org.jenkinsci.remoting.protocol.impl.BIONetworkLayer.access$2200(BIONetworkLayer.java:48)

我们花了很多时间来解决这个问题。不幸的是没有成功。

您是否知道可能导致问题的原因以及如何解决?

6 个答案:

答案 0 :(得分:1)

我们最近使用基于AWS的Jenkins使用JNLP进行远程集成测试。远程从站将回调Jenkins主机,该主机因类似错误而失败。该问题最终成为动态生成的HTTP类型的AWS ELB(因为Kubernetes ELB配置器目前不支持多协议ELB)用于Jenkins Master。我们必须手动将ELB的JNLP入口端口类型更改为HRESULT GetPath(wstring &outDomainPath) { CComBSTR bstrDomainPath; AnotherGetPath(&bstrDomainPath); outDomainPath = bstrDomainPath;//removed detach } ,而Web界面入口“实例端口”为协议* Box-Cox transformation for all 31 values of lambda between -2 to 1 (increments of .1). * Raynald Levesque 2003/11/08. * http://www.spsstools.net/en/syntax/syntax-index/compute/box-cox-transformation/ GET FILE="C:\{SPSS user folder}\Employee data.sav". COMPUTE var1=salary./* salary is a skewed test variable. VECTOR lam(31) /xl(31). LOOP idx=1 TO 31. COMPUTE lam(idx)=-2.1 + idx * .1. DO IF lam(idx)=0. COMPUTE xl(idx)=LN(var1). ELSE. COMPUTE xl(idx)=(var1**lam(idx) - 1)/lam(idx). END IF. END LOOP. * visual examination of results. EXAMINE VARIABLES= salary xl1 to xl31 /PLOT=NPPLOT /stat descrip. * numerical examination of results. FREQUENCIES /VARIABLES= salary, xl1 to xl31 /FORMAT= NOTABLE /STATISTICS=SKEWNESS KURTOSIS. ,“负载均衡器”为协议TCP

答案 1 :(得分:0)

您需要检查节点的密钥是否完整。如果不正确,则必须下载slave.jar并使用新的jar文件从命令行运行代理。

java -jar slave.jar -jnlpUrl http://<ipaddress>:8080/computer/<computername>/slave-agent.jnlp -secret 340d54sdrgtjj334kelkahsdjkf83f1c5120dc2fb74939fcdb7f05e1926049f8d7991

另外要检查安装的java版本是&gt; 7

答案 2 :(得分:0)

当Windows Update或其他一些静默后台更新与从站的环境变量混淆时,这发生在我们身上。 HTTPS_PROXYHTTP_PROXY必须重新添加,一旦完成,我们就恢复了业务。

答案 3 :(得分:0)

消息:

Incorrect acknowledgement sequence ...

当我错误地将Java属性hudson.TcpSlaveAgentListener.port的值配置为与Jenkins使用的HTTP端口相同的端口号时,发生了我的情况。 TcpSlaveAgentListener javadoc表示错误配置:

  

除HTTP端点外,Jenkins运行TcpSlaveAgentListener,该监听器侦听TCP套接字。从历史上讲,它用于代理的入站连接(因此得名),但是随着时间的流逝,它被扩展并变得通用,因此,具有不同目的的多个协议可以在同一套接字上共存。 (强调)

如果HTTP端口是8080,而hudson.TcpSlaveAgentListener.port也是8080,则我的JNLP代理无法连接。一旦我为hudson.TcpSlaveAgentListener.port分配了另一个值(如50000)并重新启动Jenkins,我的JNLP代理便能够连接。

失败的JNLP代理上的堆栈跟踪为:

INFO: Trying protocol: JNLP4-connect
Mar 02, 2019 3:49:29 PM org.jenkinsci.remoting.protocol.impl.AckFilterLayer abort
WARNING: [JNLP4-connect connection to agent.example.com/172.16.16.113:8080] Incorrect acknowledgement sequence, expected 0x000341434b got 0x485454502f
Mar 02, 2019 3:49:29 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Protocol JNLP4-connect encountered an unexpected exception
java.util.concurrent.ExecutionException: org.jenkinsci.remoting.protocol.impl.ConnectionRefusalException: Connection closed before acknowledgement sent
        at org.jenkinsci.remoting.util.SettableFuture.get(SettableFuture.java:223)
        at hudson.remoting.Engine.innerRun(Engine.java:614)
        at hudson.remoting.Engine.run(Engine.java:474)
Caused by: org.jenkinsci.remoting.protocol.impl.ConnectionRefusalException: Connection closed before acknowledgement sent
        at org.jenkinsci.remoting.protocol.impl.AckFilterLayer.onRecvClosed(AckFilterLayer.java:280)
        at org.jenkinsci.remoting.protocol.FilterLayer.abort(FilterLayer.java:164)
        at org.jenkinsci.remoting.protocol.impl.AckFilterLayer.abort(AckFilterLayer.java:130)
        at org.jenkinsci.remoting.protocol.impl.AckFilterLayer.onRecv(AckFilterLayer.java:258)
        at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.onRecv(ProtocolStack.java:668)
        at org.jenkinsci.remoting.protocol.NetworkLayer.onRead(NetworkLayer.java:136)
        at org.jenkinsci.remoting.protocol.impl.BIONetworkLayer.access$2200(BIONetworkLayer.java:48)
        at org.jenkinsci.remoting.protocol.impl.BIONetworkLayer$Reader.run(BIONetworkLayer.java:283)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:93)
        at java.lang.Thread.run(Unknown Source)

Mar 02, 2019 3:49:29 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connecting to testing-a.markwaite.net:8080
Mar 02, 2019 3:49:29 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Server reports protocol JNLP4-plaintext not supported, skipping
Mar 02, 2019 3:49:29 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Server reports protocol JNLP3-connect not supported, skipping
Mar 02, 2019 3:49:29 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Server reports protocol JNLP2-connect not supported, skipping
Mar 02, 2019 3:49:29 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Server reports protocol JNLP-connect not supported, skipping
Mar 02, 2019 3:49:29 PM hudson.remoting.jnlp.Main$CuiListener error
SEVERE: The server rejected the connection: None of the protocols were accepted
java.lang.Exception: The server rejected the connection: None of the protocols were accepted
        at hudson.remoting.Engine.onConnectionRejected(Engine.java:682)
        at hudson.remoting.Engine.innerRun(Engine.java:639)
        at hudson.remoting.Engine.run(Engine.java:474)

答案 4 :(得分:0)

Jenkins主实例是否在负载均衡器后面运行?当我的实例在AWS的Application Load Balancer后面运行时,我遇到了同样的问题。

如果是这样,则由于负载均衡器中的协议不同,可以修改确认序列。默认情况下,JNLP要求在端口50000上进行TCP连接。

如果您的设置是在AWS上进行的,则可以尝试在Route53中创建一个带有Jenkins实例的私有IP地址的别名记录的私有托管区域。

例如:jenkins.example.com->您的Jenkins实例的私有IP

然后,在 Jenkins UI->管理Jenkins->配置系统->管理节点和云->配置云-> (在高级设置下)

隧道连接:jenkins.example.com:50000

这避免了您的从属代理必须通过负载平衡器才能连接到Jenkins主服务器。

答案 5 :(得分:0)

我在gcp上遇到过这种问题,jenkins master 负载均衡,和Sidharth Ramesh的回复差不多。

在配置->管理jenkins->配置全局安全,在'agent'部分,你必须配置一个特定的端口,永远不要随意选择。我选择50222作为例子,

下面是代理协议:有一个“入站TCP代理协议/4(TLS加密)”复选框,我们必须启用。如果没有,则出现错误信息:“服务器报告协议 jnlp4-connect not supported skipping”

打开jenkins slave到jenkins master vm内部ip的端口防火墙。

享受