Jenkins Windows从站无法连接

Jenkins Windows从站无法连接

尝试使用 Java Web start 在 Windows 上启动 Jenkins 从属时出现以下情况:

>java -jar agent.jar -jnlpUrl https://jenkins.example.com/computer/slave-office/slave-agent.jnlp -secret 74aebde5a38c4f19b0b6c64ee9d3d75571d6cd666e67ebae7d39d8b259d39a0f -workDir C:\Jenkins\
ш■э 26, 2018 5:15:49 PM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
INFO: Using C:\Jenkins\remoting as a remoting work directory
Both error and output logs will be printed to C:\Jenkins\remoting
ш■э 26, 2018 5:15:50 PM hudson.remoting.jnlp.Main createEngine
INFO: Setting up agent: slave-office
ш■э 26, 2018 5:15:50 PM hudson.remoting.jnlp.Main$CuiListener <init>
INFO: Jenkins agent is running in headless mode.
ш■э 26, 2018 5:15:50 PM hudson.remoting.Engine startEngine
INFO: Using Remoting version: 3.22
ш■э 26, 2018 5:15:50 PM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
INFO: Using C:\Jenkins\remoting as a remoting work directory
ш■э 26, 2018 5:15:50 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Locating server among [https://jenkins.example.com/]
ш■э 26, 2018 5:15:50 PM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolve
INFO: Remoting server accepts the following protocols: [JNLP4-connect, Ping]
ш■э 26, 2018 5:15:50 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Agent discovery successful
  Agent address: jenkins.example.com
  Agent port:    50000
  Identity:      62:e9:82:de:8b:ae:cf:6d:ea:9e:0b:cf:5c:ad:bb:10
ш■э 26, 2018 5:15:50 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Handshaking
ш■э 26, 2018 5:15:50 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connecting to jenkins.example.com:50000
ш■э 26, 2018 5:15:50 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Trying protocol: JNLP4-connect
ш■э 26, 2018 5:15:50 PM org.jenkinsci.remoting.protocol.impl.AckFilterLayer abort
WARNING: [JNLP4-connect connection to jenkins.example.com/11.22.33.44:50000] Incorrect acknowledgement sequence, expected 0x000341434b got 0x485454502f
ш■э 26, 2018 5:15:50 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:609)
        at hudson.remoting.Engine.run(Engine.java:469)
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)
        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)

ш■э 26, 2018 5:15:50 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connecting to jenkins.example.com:50000
ш■э 26, 2018 5:15:50 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Server reports protocol JNLP4-plaintext not supported, skipping
ш■э 26, 2018 5:15:50 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Server reports protocol JNLP3-connect not supported, skipping
ш■э 26, 2018 5:15:50 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Server reports protocol JNLP2-connect not supported, skipping
ш■э 26, 2018 5:15:50 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Server reports protocol JNLP-connect not supported, skipping
ш■э 26, 2018 5:15:50 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:670)
        at hudson.remoting.Engine.innerRun(Engine.java:634)
        at hudson.remoting.Engine.run(Engine.java:469)

JNLP 代理的 TCP 端口似乎正确配置为 50000

已启用 Java Web Start Agent Protocol/4(TLS 加密)

https证书正确&curl确认服务器可用

curl https://jenkins.example.com:50000
Jenkins-Agent-Protocols: JNLP4-connect, Ping
Jenkins-Version: 2.129
Jenkins-Session: 9ab0885c
Client: 10.42.24.96
Server: 10.42.7.42
Remoting-Minimum-Version: 3.4

答案1

我也遇到了同样的问题。就我而言,通过专用网络直接连接到主机可以正常工作,但通过负载平衡器连接会导致同样的异常。

我运行了 Wireshark,发现我们的负载均衡器不允许部分 TCP 流量通过。我能够在负载均衡器上禁用特定于 HTTP 的配置,并将其设置为原始 TCP 直通。这就是我修复连接问题所需的全部操作。

答案2

就我而言,我需要将 Jenkins URL 更新为用于连接的相同 IP(私有 IP),而当前它是受 nginx 身份验证保护的公共 IP。

<jenkins url>/configure 

更新詹金斯网址与代理尝试连接的是同一个。

相关内容