Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-29616

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

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Critical
    • Resolution: Unresolved
    • remoting

    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.

      Attachments

        1. Capture.PNG
          14 kB
          Benjamin Wagner
        2. image-2018-06-18-16-38-58-573.png
          75 kB
          Yuva Kumar
        3. image-2018-06-18-16-39-37-521.png
          21 kB
          Yuva Kumar
        4. image-2018-06-19-10-52-45-189.png
          393 kB
          PRAVEEN GUPTA
        5. image-2019-02-25-18-24-04-505.png
          58 kB
          Vaibhav Mani Tripathi
        6. image-2021-12-01-12-58-10-781.png
          41 kB
          bingchuan sun
        7. image-2021-12-03-14-49-26-792.png
          31 kB
          bingchuan sun
        8. javaws_4448_7882245671431844762.log
          13 kB
          Tapio Reijonen
        9. jenkins_error_mac.png
          21 kB
          Siddhesh Jaiswal

        Activity

          pausaca pau sabats added a comment -

          I reproduced this error on win10 removing the slave-agent.jnlp or having more than 1 of this files.

          The problem is that the slaves loses somehow the connection configuration to the master so this error is shown.

          My solution was to create a new agent slave, so a new .jnlp can be downloaded, and this one will be well configured so it will work.

          If the .jnlp doesn't show you in jenkins to download, you can try with the command : 

           
           

          pausaca pau sabats added a comment - I reproduced this error on win10 removing the slave-agent.jnlp or having more than 1 of this files. The problem is that the slaves loses somehow the connection configuration to the master so this error is shown. My solution was to create a new agent slave, so a new .jnlp can be downloaded, and this one will be well configured so it will work. If the .jnlp doesn't show you in jenkins to download, you can try with the command :  java -jar agent.jar -jnlpUrl http://jenkinsurl:port/computer/windows-agent/slave-agent.jnlp -secret xxxxxxxx -workDir "C:\JenkinsSlave"    
          jthompson Jeff Thompson added a comment -

          It looks like people are seeing a number of different issues, generally involving the same error message. Some people report success by tracking down a different machine running the same agent. Some find that some cleanup corrects the problem, though it's not clear just what cleanup is required. In some cases it probably involves a connection timeout and the server thinks an old instance of the agent is still connected.

          As Oleg said earlier, to get anywhere with this will require clear reproduction documentation and both agent and master logs. Information on whether it is specific to a certain type of platform or environment would also be important. I see some mention of different versions of Windows OSes but it's not clear if it's just a Windows issue and if it only occurs in some Windows environments or versions.

          jthompson Jeff Thompson added a comment - It looks like people are seeing a number of different issues, generally involving the same error message. Some people report success by tracking down a different machine running the same agent. Some find that some cleanup corrects the problem, though it's not clear just what cleanup is required. In some cases it probably involves a connection timeout and the server thinks an old instance of the agent is still connected. As Oleg said earlier, to get anywhere with this will require clear reproduction documentation and both agent and master logs. Information on whether it is specific to a certain type of platform or environment would also be important. I see some mention of different versions of Windows OSes but it's not clear if it's just a Windows issue and if it only occurs in some Windows environments or versions.

          FYI in case it helps any – I just had to go through a big diag effort on my site with a bunch of windows JNLP agents that stopped working sometime in past few days with the same above failures/errors. 

          After a long set of rabbit trails - what I found in my case – the problem wound up being reverse DNS resolution stopped working (unrelated local problem – "It's always DNS", right?) - but that inability to reverse resolve the connecting client (windows box) was causing the JNLP server side to drop the connection.

          Just wanted to add this here in case it helps anyone else with future similar issues if it happens to be related.

          nneul Nathan Neulinger added a comment - FYI in case it helps any – I just had to go through a big diag effort on my site with a bunch of windows JNLP agents that stopped working sometime in past few days with the same above failures/errors.  After a long set of rabbit trails - what I found in my case – the problem wound up being reverse DNS resolution stopped working (unrelated local problem – "It's always DNS", right?) - but that inability to reverse resolve the connecting client (windows box) was causing the JNLP server side to drop the connection. Just wanted to add this here in case it helps anyone else with future similar issues if it happens to be related.
          ssedhain S Sushil added a comment -

          Not sure if same issue, but the service is dying on a server 2012 node. It is set to restart and eventually it will connect but again die very frequently. Below is the slave error and slave-wrapper error logs:

          ********************************************** -slave error log - ***********************
          
          INFO: ConnectedJan 09, 2020 11:24:17 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: TerminatedJan 09, 2020 11:24:27 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Performing onReconnect operation.Jan 09, 2020 11:24:27 AM jenkins.slaves.restarter.JnlpSlaveRestarterInstaller$FindEffectiveRestarters$1 onReconnectINFO: Restarting agent via jenkins.slaves.restarter.WinswSlaveRestarter@50c19504Jan 09, 2020 11:24:32 AM hudson.remoting.jnlp.Main createEngineINFO: Setting up agent: AutomationEdgeServerJan 09, 2020 11:24:32 AM hudson.remoting.jnlp.Main$CuiListener <init>INFO: Jenkins agent is running in headless mode.Jan 09, 2020 11:24:32 AM hudson.remoting.Engine startEngineINFO: Using Remoting version: 3.36Jan 09, 2020 11:24:32 AM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDirINFO: Using c:\jenkins\remoting as a remoting work directoryJan 09, 2020 11:24:32 AM org.jenkinsci.remoting.engine.WorkDirManager setupLoggingINFO: Both error and output logs will be printed to c:\jenkins\remotingJan 09, 2020 11:24:33 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Locating server among [https://real-cicd.moonwalk.io/]Jan 09, 2020 11:24:33 AM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolveINFO: Remoting server accepts the following protocols: [JNLP4-connect, Ping]Jan 09, 2020 11:24:33 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Agent discovery successful  Agent address: real-cicd.moonwalk.io  Agent port:    70000  Identity:      31:49:15:6a:df:3b:70:76:81:cc:db:f2:c3:bc:57:68Jan 09, 2020 11:24:33 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: HandshakingJan 09, 2020 11:24:33 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Connecting to real-cicd.moonwalk.io:70000Jan 09, 2020 11:24:33 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Trying protocol: JNLP4-connectJan 09, 2020 11:24:33 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Remote identity confirmed: 31:49:15:6a:df:3b:70:76:81:cc:db:f2:c3:bc:57:68Jan 09, 2020 11:24:33 AM org.jenkinsci.remoting.protocol.impl.ConnectionHeadersFilterLayer onRecvINFO: [JNLP4-connect connection to real-cicd.moonwalk.io/11.11.111.111:70000] Local headers refused by remote: AutomationEdgeServer is already connected to this master. Rejecting this connection.Jan 09, 2020 11:24:33 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Protocol JNLP4-connect encountered an unexpected exceptionjava.util.concurrent.ExecutionException: org.jenkinsci.remoting.protocol.impl.ConnectionRefusalException: AutomationEdgeServer is already connected to this master. Rejecting this connection. at org.jenkinsci.remoting.util.SettableFuture.get(SettableFuture.java:223) at hudson.remoting.Engine.innerRun(Engine.java:577) at hudson.remoting.Engine.run(Engine.java:488)Caused by: org.jenkinsci.remoting.protocol.impl.ConnectionRefusalException: AutomationEdgeServer is already connected to this master. Rejecting this connection. at org.jenkinsci.remoting.protocol.impl.ConnectionHeadersFilterLayer.newAbortCause(ConnectionHeadersFilterLayer.java:378) at org.jenkinsci.remoting.protocol.impl.ConnectionHeadersFilterLayer.onRecvClosed(ConnectionHeadersFilterLayer.java:433) at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.onRecvClosed(ProtocolStack.java:816) at org.jenkinsci.remoting.protocol.FilterLayer.onRecvClosed(FilterLayer.java:287) at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.onRecvClosed(SSLEngineFilterLayer.java:172) at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.onRecvClosed(ProtocolStack.java:816) at org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154) at org.jenkinsci.remoting.protocol.impl.BIONetworkLayer.access$1500(BIONetworkLayer.java:48) at org.jenkinsci.remoting.protocol.impl.BIONetworkLayer$Reader.run(BIONetworkLayer.java:247) 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:97) at java.lang.Thread.run(Unknown Source) Suppressed: java.nio.channels.ClosedChannelException ... 7 more
          Jan 09, 2020 11:24:33 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Connecting to real-cicd.moonwalk.io:70000Jan 09, 2020 11:24:33 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Server reports protocol JNLP4-plaintext not supported, skippingJan 09, 2020 11:24:33 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Server reports protocol JNLP3-connect not supported, skippingJan 09, 2020 11:24:33 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Server reports protocol JNLP2-connect not supported, skippingJan 09, 2020 11:24:33 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Server reports protocol JNLP-connect not supported, skippingJan 09, 2020 11:24:33 AM hudson.remoting.jnlp.Main$CuiListener errorSEVERE: The server rejected the connection: None of the protocols were acceptedjava.lang.Exception: The server rejected the connection: None of the protocols were accepted at hudson.remoting.Engine.onConnectionRejected(Engine.java:662) at hudson.remoting.Engine.innerRun(Engine.java:602) at hudson.remoting.Engine.run(Engine.java:488)
          Jan 09, 2020 11:25:36 AM hudson.remoting.jnlp.Main createEngineINFO: Setting up agent: AutomationEdgeServerJan 09, 2020 11:25:36 AM hudson.remoting.jnlp.Main$CuiListener <init>INFO: Jenkins agent is running in headless mode.Jan 09, 2020 11:25:36 AM hudson.remoting.Engine startEngineINFO: Using Remoting version: 3.36Jan 09, 2020 11:25:36 AM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDirINFO: Using c:\jenkins\remoting as a remoting work directoryJan 09, 2020 11:25:36 AM org.jenkinsci.remoting.engine.WorkDirManager setupLoggingINFO: Both error and output logs will be printed to c:\jenkins\remotingJan 09, 2020 11:25:36 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Locating server among [https://real-cicd.moonwalk.io/]Jan 09, 2020 11:25:37 AM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolveINFO: Remoting server accepts the following protocols: [JNLP4-connect, Ping]Jan 09, 2020 11:25:37 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Agent discovery successful  Agent address: real-cicd.moonwalk.io  Agent port:    70000  Identity:      31:49:15:6a:df:3b:70:76:81:cc:db:f2:c3:bc:57:68Jan 09, 2020 11:25:37 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: HandshakingJan 09, 2020 11:25:37 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Connecting to real-cicd.moonwalk.io:70000Jan 09, 2020 11:25:37 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Trying protocol: JNLP4-connectJan 09, 2020 11:25:37 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Remote identity confirmed: 31:49:15:6a:df:3b:70:76:81:cc:db:f2:c3:bc:57:68Jan 09, 2020 11:25:37 AM org.jenkinsci.remoting.protocol.impl.ConnectionHeadersFilterLayer onRecvINFO: [JNLP4-connect connection to real-cicd.moonwalk.io/11.11.111.111:70000] Local headers refused by remote: AutomationEdgeServer is already connected to this master. Rejecting this connection.Jan 09, 2020 11:25:37 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Protocol JNLP4-connect encountered an unexpected exceptionjava.util.concurrent.ExecutionException: org.jenkinsci.remoting.protocol.impl.ConnectionRefusalException: AutomationEdgeServer is already connected to this master. Rejecting this connection. at org.jenkinsci.remoting.util.SettableFuture.get(SettableFuture.java:223) at hudson.remoting.Engine.innerRun(Engine.java:577) at hudson.remoting.Engine.run(Engine.java:488)Caused by: org.jenkinsci.remoting.protocol.impl.ConnectionRefusalException: AutomationEdgeServer is already connected to this master. Rejecting this connection. at org.jenkinsci.remoting.protocol.impl.ConnectionHeadersFilterLayer.newAbortCause(ConnectionHeadersFilterLayer.java:378) at org.jenkinsci.remoting.protocol.impl.ConnectionHeadersFilterLayer.onRecvClosed(ConnectionHeadersFilterLayer.java:433) at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.onRecvClosed(ProtocolStack.java:816) at org.jenkinsci.remoting.protocol.FilterLayer.onRecvClosed(FilterLayer.java:287) at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.onRecvClosed(SSLEngineFilterLayer.java:172) at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.onRecvClosed(ProtocolStack.java:816) at org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154) at org.jenkinsci.remoting.protocol.impl.BIONetworkLayer.access$1500(BIONetworkLayer.java:48) at org.jenkinsci.remoting.protocol.impl.BIONetworkLayer$Reader.run(BIONetworkLayer.java:247) 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:97) at java.lang.Thread.run(Unknown Source) Suppressed: java.nio.channels.ClosedChannelException ... 7 more
          Jan 09, 2020 11:25:37 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Connecting to real-cicd.moonwalk.io:70000Jan 09, 2020 11:25:37 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Server reports protocol JNLP4-plaintext not supported, skippingJan 09, 2020 11:25:37 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Server reports protocol JNLP3-connect not supported, skippingJan 09, 2020 11:25:37 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Server reports protocol JNLP2-connect not supported, skippingJan 09, 2020 11:25:37 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Server reports protocol JNLP-connect not supported, skippingJan 09, 2020 11:25:37 AM hudson.remoting.jnlp.Main$CuiListener errorSEVERE: The server rejected the connection: None of the protocols were acceptedjava.lang.Exception: The server rejected the connection: None of the protocols were accepted at hudson.remoting.Engine.onConnectionRejected(Engine.java:662) at hudson.remoting.Engine.innerRun(Engine.java:602) at hudson.remoting.Engine.run(Engine.java:488)
          
          
          ***********************Wrapper logs*******************
          020-01-09 10:49:05,867 DEBUG - User requested the status of the process with id 'jenkinsslave-c__jenkins'2020-01-09 10:49:05,872 DEBUG - Completed. Exit code is 02020-01-09 11:24:28,242 DEBUG - Starting ServiceWrapper in the CLI mode2020-01-09 11:24:28,523 INFO  - Restarting the service with id 'jenkinsslave-c__jenkins'2020-01-09 11:24:28,539 DEBUG - Completed. Exit code is 02020-01-09 11:24:28,836 DEBUG - Starting ServiceWrapper in the CLI mode2020-01-09 11:24:29,071 INFO  - Restarting the service with id 'jenkinsslave-c__jenkins'2020-01-09 11:24:29,101 INFO  - Stopping jenkinsslave-c__jenkins2020-01-09 11:24:29,101 DEBUG - ProcessKill 48482020-01-09 11:24:29,226 INFO  - Found child process: 3564 Name: conhost.exe2020-01-09 11:24:29,273 INFO  - Stopping process 35642020-01-09 11:24:29,273 INFO  - Send SIGINT 35642020-01-09 11:24:29,273 WARN  - SIGINT to 3564 failed - Killing as fallback2020-01-09 11:24:29,273 INFO  - Stopping process 48482020-01-09 11:24:29,273 INFO  - Send SIGINT 48482020-01-09 11:24:29,273 WARN  - SIGINT to 4848 failed - Killing as fallback2020-01-09 11:24:29,289 INFO  - Finished jenkinsslave-c__jenkins2020-01-09 11:24:29,289 DEBUG - Completed. Exit code is 02020-01-09 11:24:30,476 INFO  - Starting ServiceWrapper in the service mode2020-01-09 11:24:30,523 DEBUG - Completed. Exit code is 02020-01-09 11:24:30,554 INFO  - Downloading: https://real-cicd.moonwalk.io/jnlpJars/slave.jar to C:\jenkins\slave.jar. failOnError=False2020-01-09 11:24:31,211 INFO  - Starting C:\Program Files\Java\jre1.8.0_231\bin\java.exe -Xrs  -jar "C:\jenkins\slave.jar" -jnlpUrl https://real-cicd.moonwalk.io/computer/AutomationEdgeServer/slave-agent.jnlp -secret 65e13a6191d47de3754d8f57cb56ba4f9ab199daeac2ccd161cd74050fd2e1cb2020-01-09 11:24:31,226 INFO  - Extension loaded: killOnStartup2020-01-09 11:24:31,242 DEBUG - Checking the potentially runaway process with PID=48482020-01-09 11:24:31,242 DEBUG - No runaway process with PID=4848. The process has been already stopped.2020-01-09 11:24:31,273 INFO  - Started process 44122020-01-09 11:24:31,289 DEBUG - Forwarding logs of the process System.Diagnostics.Process (java) to winsw.SizeBasedRollingLogAppender2020-01-09 11:24:31,320 INFO  - Recording PID of the started process:4412. PID file destination is C:\jenkins\jenkins_agent.pid2020-01-09 11:25:34,657 INFO  - Starting ServiceWrapper in the service mode2020-01-09 11:25:34,688 INFO  - Downloading: https://real-cicd.moonwalk.io/jnlpJars/slave.jar to C:\jenkins\slave.jar. failOnError=False2020-01-09 11:25:35,422 INFO  - Starting C:\Program Files\Java\jre1.8.0_231\bin\java.exe -Xrs  -jar "C:\jenkins\slave.jar" -jnlpUrl https://real-cicd.moonwalk.io/computer/AutomationEdgeServer/slave-agent.jnlp -secret 65e13a6191d47de3754d8f57cb56ba4f9ab199daeac2ccd161cd74050fd2e1cb2020-01-09 11:25:35,438 INFO  - Extension loaded: killOnStartup2020-01-09 11:25:35,438 DEBUG - Checking the potentially runaway process with PID=44122020-01-09 11:25:35,453 DEBUG - No runaway process with PID=4412. The process has been already stopped.2020-01-09 11:25:35,485 INFO  - Started process 32042020-01-09 11:25:35,485 DEBUG - Forwarding logs of the process System.Diagnostics.Process (java) to winsw.SizeBasedRollingLogAppender2020-01-09 11:25:35,516 INFO  - Recording PID of the started process:3204. PID file destination is C:\jenkins\jenkins_agent.pid2020-01-09 11:26:38,647 INFO  - Starting ServiceWrapper in the service mode2020-01-09 11:26:38,710 INFO  - Downloading: https://real-cicd.moonwalk.io/jnlpJars/slave.jar to C:\jenkins\slave.jar. failOnError=False2020-01-09 11:26:39,475 INFO  - Starting C:\Program Files\Java\jre1.8.0_231\bin\java.exe -Xrs  -jar "C:\jenkins\slave.jar" -jnlpUrl https://real-cicd.moonwalk.io/computer/AutomationEdgeServer/slave-agent.jnlp -secret 65e13a6191d47de3754d8f57cb56ba4f9ab199daeac2ccd161cd74050fd2e1cb2020-01-09 11:26:39,491 INFO  - Extension loaded: killOnStartup2020-01-09 11:26:39,491 DEBUG - Checking the potentially runaway process with PID=32042020-01-09 11:26:39,506 DEBUG - No runaway process with PID=3204. The process has been already stopped.2020-01-09 11:26:39,538 INFO  - Started process 26042020-01-09 11:26:39,538 DEBUG - Forwarding logs of the process System.Diagnostics.Process (java) to winsw.SizeBasedRollingLogAppender2020-01-09 11:26:39,569 INFO  - Recording PID of the started process:2604. PID file destination is C:\jenkins\jenkins_agent.pid
          
          ssedhain S Sushil added a comment - Not sure if same issue, but the service is dying on a server 2012 node. It is set to restart and eventually it will connect but again die very frequently. Below is the slave error and slave-wrapper error logs: ********************************************** -slave error log - *********************** INFO: ConnectedJan 09, 2020 11:24:17 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: TerminatedJan 09, 2020 11:24:27 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Performing onReconnect operation.Jan 09, 2020 11:24:27 AM jenkins.slaves.restarter.JnlpSlaveRestarterInstaller$FindEffectiveRestarters$1 onReconnectINFO: Restarting agent via jenkins.slaves.restarter.WinswSlaveRestarter@50c19504Jan 09, 2020 11:24:32 AM hudson.remoting.jnlp.Main createEngineINFO: Setting up agent: AutomationEdgeServerJan 09, 2020 11:24:32 AM hudson.remoting.jnlp.Main$CuiListener <init>INFO: Jenkins agent is running in headless mode.Jan 09, 2020 11:24:32 AM hudson.remoting.Engine startEngineINFO: Using Remoting version: 3.36Jan 09, 2020 11:24:32 AM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDirINFO: Using c:\jenkins\remoting as a remoting work directoryJan 09, 2020 11:24:32 AM org.jenkinsci.remoting.engine.WorkDirManager setupLoggingINFO: Both error and output logs will be printed to c:\jenkins\remotingJan 09, 2020 11:24:33 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Locating server among [https: //real-cicd.moonwalk.io/]Jan 09, 2020 11:24:33 AM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolveINFO: Remoting server accepts the following protocols: [JNLP4-connect, Ping]Jan 09, 2020 11:24:33 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Agent discovery successful  Agent address: real-cicd.moonwalk.io  Agent port:    70000  Identity:      31:49:15:6a:df:3b:70:76:81:cc:db:f2:c3:bc:57:68Jan 09, 2020 11:24:33 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: HandshakingJan 09, 2020 11:24:33 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Connecting to real-cicd.moonwalk.io:70000Jan 09, 2020 11:24:33 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Trying protocol: JNLP4-connectJan 09, 2020 11:24:33 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Remote identity confirmed: 31:49:15:6a:df:3b:70:76:81:cc:db:f2:c3:bc:57:68Jan 09, 2020 11:24:33 AM org.jenkinsci.remoting.protocol.impl.ConnectionHeadersFilterLayer onRecvINFO: [JNLP4-connect connection to real-cicd.moonwalk.io/11.11.111.111:70000] Local headers refused by remote: AutomationEdgeServer is already connected to this master. Rejecting this connection.Jan 09, 2020 11:24:33 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Protocol JNLP4-connect encountered an unexpected exceptionjava.util.concurrent.ExecutionException: org.jenkinsci.remoting.protocol.impl.ConnectionRefusalException: AutomationEdgeServer is already connected to this master. Rejecting this connection. at org.jenkinsci.remoting.util.SettableFuture.get(SettableFuture.java:223) at hudson.remoting.Engine.innerRun(Engine.java:577) at hudson.remoting.Engine.run(Engine.java:488)Caused by: org.jenkinsci.remoting.protocol.impl.ConnectionRefusalException: AutomationEdgeServer is already connected to this master. Rejecting this connection. at org.jenkinsci.remoting.protocol.impl.ConnectionHeadersFilterLayer.newAbortCause(ConnectionHeadersFilterLayer.java:378) at org.jenkinsci.remoting.protocol.impl.ConnectionHeadersFilterLayer.onRecvClosed(ConnectionHeadersFilterLayer.java:433) at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.onRecvClosed(ProtocolStack.java:816) at org.jenkinsci.remoting.protocol.FilterLayer.onRecvClosed(FilterLayer.java:287) at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.onRecvClosed(SSLEngineFilterLayer.java:172) at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.onRecvClosed(ProtocolStack.java:816) at org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154) at org.jenkinsci.remoting.protocol.impl.BIONetworkLayer.access$1500(BIONetworkLayer.java:48) at org.jenkinsci.remoting.protocol.impl.BIONetworkLayer$Reader.run(BIONetworkLayer.java:247) 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:97) at java.lang. Thread .run(Unknown Source) Suppressed: java.nio.channels.ClosedChannelException ... 7 more Jan 09, 2020 11:24:33 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Connecting to real-cicd.moonwalk.io:70000Jan 09, 2020 11:24:33 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Server reports protocol JNLP4-plaintext not supported, skippingJan 09, 2020 11:24:33 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Server reports protocol JNLP3-connect not supported, skippingJan 09, 2020 11:24:33 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Server reports protocol JNLP2-connect not supported, skippingJan 09, 2020 11:24:33 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Server reports protocol JNLP-connect not supported, skippingJan 09, 2020 11:24:33 AM hudson.remoting.jnlp.Main$CuiListener errorSEVERE: The server rejected the connection: None of the protocols were acceptedjava.lang.Exception: The server rejected the connection: None of the protocols were accepted at hudson.remoting.Engine.onConnectionRejected(Engine.java:662) at hudson.remoting.Engine.innerRun(Engine.java:602) at hudson.remoting.Engine.run(Engine.java:488) Jan 09, 2020 11:25:36 AM hudson.remoting.jnlp.Main createEngineINFO: Setting up agent: AutomationEdgeServerJan 09, 2020 11:25:36 AM hudson.remoting.jnlp.Main$CuiListener <init>INFO: Jenkins agent is running in headless mode.Jan 09, 2020 11:25:36 AM hudson.remoting.Engine startEngineINFO: Using Remoting version: 3.36Jan 09, 2020 11:25:36 AM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDirINFO: Using c:\jenkins\remoting as a remoting work directoryJan 09, 2020 11:25:36 AM org.jenkinsci.remoting.engine.WorkDirManager setupLoggingINFO: Both error and output logs will be printed to c:\jenkins\remotingJan 09, 2020 11:25:36 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Locating server among [https: //real-cicd.moonwalk.io/]Jan 09, 2020 11:25:37 AM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolveINFO: Remoting server accepts the following protocols: [JNLP4-connect, Ping]Jan 09, 2020 11:25:37 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Agent discovery successful  Agent address: real-cicd.moonwalk.io  Agent port:    70000  Identity:      31:49:15:6a:df:3b:70:76:81:cc:db:f2:c3:bc:57:68Jan 09, 2020 11:25:37 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: HandshakingJan 09, 2020 11:25:37 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Connecting to real-cicd.moonwalk.io:70000Jan 09, 2020 11:25:37 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Trying protocol: JNLP4-connectJan 09, 2020 11:25:37 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Remote identity confirmed: 31:49:15:6a:df:3b:70:76:81:cc:db:f2:c3:bc:57:68Jan 09, 2020 11:25:37 AM org.jenkinsci.remoting.protocol.impl.ConnectionHeadersFilterLayer onRecvINFO: [JNLP4-connect connection to real-cicd.moonwalk.io/11.11.111.111:70000] Local headers refused by remote: AutomationEdgeServer is already connected to this master. Rejecting this connection.Jan 09, 2020 11:25:37 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Protocol JNLP4-connect encountered an unexpected exceptionjava.util.concurrent.ExecutionException: org.jenkinsci.remoting.protocol.impl.ConnectionRefusalException: AutomationEdgeServer is already connected to this master. Rejecting this connection. at org.jenkinsci.remoting.util.SettableFuture.get(SettableFuture.java:223) at hudson.remoting.Engine.innerRun(Engine.java:577) at hudson.remoting.Engine.run(Engine.java:488)Caused by: org.jenkinsci.remoting.protocol.impl.ConnectionRefusalException: AutomationEdgeServer is already connected to this master. Rejecting this connection. at org.jenkinsci.remoting.protocol.impl.ConnectionHeadersFilterLayer.newAbortCause(ConnectionHeadersFilterLayer.java:378) at org.jenkinsci.remoting.protocol.impl.ConnectionHeadersFilterLayer.onRecvClosed(ConnectionHeadersFilterLayer.java:433) at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.onRecvClosed(ProtocolStack.java:816) at org.jenkinsci.remoting.protocol.FilterLayer.onRecvClosed(FilterLayer.java:287) at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.onRecvClosed(SSLEngineFilterLayer.java:172) at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.onRecvClosed(ProtocolStack.java:816) at org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154) at org.jenkinsci.remoting.protocol.impl.BIONetworkLayer.access$1500(BIONetworkLayer.java:48) at org.jenkinsci.remoting.protocol.impl.BIONetworkLayer$Reader.run(BIONetworkLayer.java:247) 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:97) at java.lang. Thread .run(Unknown Source) Suppressed: java.nio.channels.ClosedChannelException ... 7 more Jan 09, 2020 11:25:37 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Connecting to real-cicd.moonwalk.io:70000Jan 09, 2020 11:25:37 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Server reports protocol JNLP4-plaintext not supported, skippingJan 09, 2020 11:25:37 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Server reports protocol JNLP3-connect not supported, skippingJan 09, 2020 11:25:37 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Server reports protocol JNLP2-connect not supported, skippingJan 09, 2020 11:25:37 AM hudson.remoting.jnlp.Main$CuiListener statusINFO: Server reports protocol JNLP-connect not supported, skippingJan 09, 2020 11:25:37 AM hudson.remoting.jnlp.Main$CuiListener errorSEVERE: The server rejected the connection: None of the protocols were acceptedjava.lang.Exception: The server rejected the connection: None of the protocols were accepted at hudson.remoting.Engine.onConnectionRejected(Engine.java:662) at hudson.remoting.Engine.innerRun(Engine.java:602) at hudson.remoting.Engine.run(Engine.java:488) ***********************Wrapper logs******************* 020-01-09 10:49:05,867 DEBUG - User requested the status of the process with id 'jenkinsslave-c__jenkins' 2020-01-09 10:49:05,872 DEBUG - Completed. Exit code is 02020-01-09 11:24:28,242 DEBUG - Starting ServiceWrapper in the CLI mode2020-01-09 11:24:28,523 INFO  - Restarting the service with id 'jenkinsslave-c__jenkins' 2020-01-09 11:24:28,539 DEBUG - Completed. Exit code is 02020-01-09 11:24:28,836 DEBUG - Starting ServiceWrapper in the CLI mode2020-01-09 11:24:29,071 INFO  - Restarting the service with id 'jenkinsslave-c__jenkins' 2020-01-09 11:24:29,101 INFO  - Stopping jenkinsslave-c__jenkins2020-01-09 11:24:29,101 DEBUG - ProcessKill 48482020-01-09 11:24:29,226 INFO  - Found child process: 3564 Name: conhost.exe2020-01-09 11:24:29,273 INFO  - Stopping process 35642020-01-09 11:24:29,273 INFO  - Send SIGINT 35642020-01-09 11:24:29,273 WARN  - SIGINT to 3564 failed - Killing as fallback2020-01-09 11:24:29,273 INFO  - Stopping process 48482020-01-09 11:24:29,273 INFO  - Send SIGINT 48482020-01-09 11:24:29,273 WARN  - SIGINT to 4848 failed - Killing as fallback2020-01-09 11:24:29,289 INFO  - Finished jenkinsslave-c__jenkins2020-01-09 11:24:29,289 DEBUG - Completed. Exit code is 02020-01-09 11:24:30,476 INFO  - Starting ServiceWrapper in the service mode2020-01-09 11:24:30,523 DEBUG - Completed. Exit code is 02020-01-09 11:24:30,554 INFO  - Downloading: https: //real-cicd.moonwalk.io/jnlpJars/slave.jar to C:\jenkins\slave.jar. failOnError=False2020-01-09 11:24:31,211 INFO  - Starting C:\Program Files\Java\jre1.8.0_231\bin\java.exe -Xrs  -jar "C:\jenkins\slave.jar" -jnlpUrl https://real-cicd.moonwalk.io/computer/AutomationEdgeServer/slave-agent.jnlp -secret 65e13a6191d47de3754d8f57cb56ba4f9ab199daeac2ccd161cd74050fd2e1cb2020-01-09 11:24:31,226 INFO  - Extension loaded: killOnStartup2020-01-09 11:24:31,242 DEBUG - Checking the potentially runaway process with PID=48482020-01-09 11:24:31,242 DEBUG - No runaway process with PID=4848. The process has been already stopped.2020-01-09 11:24:31,273 INFO  - Started process 44122020-01-09 11:24:31,289 DEBUG - Forwarding logs of the process System .Diagnostics. Process (java) to winsw.SizeBasedRollingLogAppender2020-01-09 11:24:31,320 INFO  - Recording PID of the started process:4412. PID file destination is C:\jenkins\jenkins_agent.pid2020-01-09 11:25:34,657 INFO  - Starting ServiceWrapper in the service mode2020-01-09 11:25:34,688 INFO  - Downloading: https://real-cicd.moonwalk.io/jnlpJars/slave.jar to C:\jenkins\slave.jar. failOnError=False2020-01-09 11:25:35,422 INFO  - Starting C:\Program Files\Java\jre1.8.0_231\bin\java.exe -Xrs  -jar "C:\jenkins\slave.jar" -jnlpUrl https://real-cicd.moonwalk.io/computer/AutomationEdgeServer/slave-agent.jnlp -secret 65e13a6191d47de3754d8f57cb56ba4f9ab199daeac2ccd161cd74050fd2e1cb2020-01-09 11:25:35,438 INFO  - Extension loaded: killOnStartup2020-01-09 11:25:35,438 DEBUG - Checking the potentially runaway process with PID=44122020-01-09 11:25:35,453 DEBUG - No runaway process with PID=4412. The process has been already stopped.2020-01-09 11:25:35,485 INFO  - Started process 32042020-01-09 11:25:35,485 DEBUG - Forwarding logs of the process System .Diagnostics. Process (java) to winsw.SizeBasedRollingLogAppender2020-01-09 11:25:35,516 INFO  - Recording PID of the started process:3204. PID file destination is C:\jenkins\jenkins_agent.pid2020-01-09 11:26:38,647 INFO  - Starting ServiceWrapper in the service mode2020-01-09 11:26:38,710 INFO  - Downloading: https://real-cicd.moonwalk.io/jnlpJars/slave.jar to C:\jenkins\slave.jar. failOnError=False2020-01-09 11:26:39,475 INFO  - Starting C:\Program Files\Java\jre1.8.0_231\bin\java.exe -Xrs  -jar "C:\jenkins\slave.jar" -jnlpUrl https://real-cicd.moonwalk.io/computer/AutomationEdgeServer/slave-agent.jnlp -secret 65e13a6191d47de3754d8f57cb56ba4f9ab199daeac2ccd161cd74050fd2e1cb2020-01-09 11:26:39,491 INFO  - Extension loaded: killOnStartup2020-01-09 11:26:39,491 DEBUG - Checking the potentially runaway process with PID=32042020-01-09 11:26:39,506 DEBUG - No runaway process with PID=3204. The process has been already stopped.2020-01-09 11:26:39,538 INFO  - Started process 26042020-01-09 11:26:39,538 DEBUG - Forwarding logs of the process System .Diagnostics. Process (java) to winsw.SizeBasedRollingLogAppender2020-01-09 11:26:39,569 INFO  - Recording PID of the started process:2604. PID file destination is C:\jenkins\jenkins_agent.pid
          bingchuan bingchuan sun added a comment - - edited

           I have the same problem. After change org.jenkinsci.remoting.protocol.ProtocolStack#handshakingTimeout to more then 20s,then it connected. My conclusion is that the connect will take more then 10s sometimes based on the network driver,but the default 'final ' value is 10s , so it will timeout and closed.

           

          The final reason is java.net.InetSocketAddress#getHostName invoked by org.jenkinsci.remoting.engine.JnlpProtocol4Handler#createSSLEngine blocked so much time.

          bingchuan bingchuan sun added a comment - - edited  I have the same problem. After change org.jenkinsci.remoting.protocol.ProtocolStack#handshakingTimeout to more then 20s,then it connected. My conclusion is that the connect will take more then 10s sometimes based on the network driver,but the default 'final ' value is 10s , so it will timeout and closed.   The final reason is java.net.InetSocketAddress#getHostName invoked by org.jenkinsci.remoting.engine.JnlpProtocol4Handler#createSSLEngine blocked so much time.

          People

            Unassigned Unassigned
            shortcipher Benjamin Wagner
            Votes:
            32 Vote for this issue
            Watchers:
            48 Start watching this issue

            Dates

              Created:
              Updated: