问题:
在macOS上起了jenkins,将另外一台win10作为slave,通过启动agent的方式连接master,但是一启动agent就报错,如下:
信息: 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:744) at hudson.remoting.Engine.run(Engine.java:519) Caused by: org.jenkinsci.remoting.protocol.impl.ConnectionRefusalException: Connection closed before acknowledgement sent at org.jenkinsci.remoting.protocol.impl.AckFilterLayer.onRecvClosed(AckFilterLayer.java:283) at org.jenkinsci.remoting.protocol.FilterLayer.abort(FilterLayer.java:164) at org.jenkinsci.remoting.protocol.impl.AckFilterLayer.access$000(AckFilterLayer.java:45) at org.jenkinsci.remoting.protocol.impl.AckFilterLayer$1.run(AckFilterLayer.java:179) at org.jenkinsci.remoting.protocol.IOHub$DelayedRunnable.run(IOHub.java:964) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:118) at java.lang.Thread.run(Thread.java:748) 四月 25, 2021 11:13:37 上午 hudson.remoting.jnlp.Main$CuiListener error 严重: 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:829) at hudson.remoting.Engine.innerRun(Engine.java:769) at hudson.remoting.Engine.run(Engine.java:519)
解决办法:
尝试了很多方式,不管是baidu还是jenkins官方,感觉都没能解决我遇到的这个问题,再次尝试,最终在win10的node上勾选“Use WebSocket”后,再次启动agent,问题解决:
slave的agent启动成功后,连接上master的日志如下:
四月 25, 2021 11:14:18 上午 org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir 信息: Using D:jenkins_workdirremoting as a remoting work directory 四月 25, 2021 11:14:19 上午 org.jenkinsci.remoting.engine.WorkDirManager setupLogging 信息: Both error and output logs will be printed to D:jenkins_workdirremoting 四月 25, 2021 11:14:19 上午 hudson.remoting.jnlp.Main createEngine 信息: Setting up agent: laptop-zhaosheng 四月 25, 2021 11:14:19 上午 hudson.remoting.jnlp.Main$CuiListener <init> 信息: Jenkins agent is running in headless mode. 四月 25, 2021 11:14:19 上午 hudson.remoting.Engine startEngine 信息: Using Remoting version: 4.5 四月 25, 2021 11:14:19 上午 org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir 信息: Using D:jenkins_workdirremoting as a remoting work directory 四月 25, 2021 11:14:20 上午 hudson.remoting.jnlp.Main$CuiListener status 信息: WebSocket connection open 四月 25, 2021 11:14:21 上午 hudson.remoting.jnlp.Main$CuiListener status 信息: Connected