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

The server rejected the connection: *** is already connected to this master. Rejecting this connection.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Component/s: core, remoting
    • Labels:
      None
    • Environment:
      Windows 7, Jenkins 1.613
    • Similar Issues:

      Description

      I am running Jenkins 1.613.

      i see the slaves log:
      四月 15, 2015 10:15:02 上午 com.youdevise.hudson.slavestatus.SlaveListener call
      信息: Slave-status listener starting
      四月 15, 2015 10:15:02 上午 com.youdevise.hudson.slavestatus.SocketHTTPListener waitForConnection
      信息: Slave-status listener ready on port 3141
      四月 15, 2015 1:41:01 下午 hudson.remoting.jnlp.Main createEngine
      信息: Setting up slave: 192.168.161.8
      四月 15, 2015 1:41:01 下午 hudson.remoting.jnlp.Main$CuiListener <init>
      信息: Jenkins agent is running in headless mode.
      四月 15, 2015 1:41:01 下午 hudson.remoting.jnlp.Main$CuiListener status
      信息: Locating server among http://192.168.95.37:8080/jenkins/
      四月 15, 2015 1:41:01 下午 hudson.remoting.jnlp.Main$CuiListener status
      信息: Connecting to 192.168.95.37:19994
      四月 15, 2015 1:41:01 下午 hudson.remoting.jnlp.Main$CuiListener status
      信息: Handshaking
      四月 15, 2015 1:41:01 下午 hudson.remoting.jnlp.Main$CuiListener error
      严重: The server rejected the connection: 192.168.161.8 is already connected to this master. Rejecting this connection.
      java.lang.Exception: The server rejected the connection: 192.168.161.8 is already connected to this master. Rejecting this connection.
      at hudson.remoting.Engine.onConnectionRejected(Engine.java:306)
      at hudson.remoting.Engine.run(Engine.java:276)

        Attachments

        1. channelclosedstack.txt
          1.30 MB
        2. jenkins-slave.err.log
          293 kB
        3. Slave errors
          2 kB

          Issue Links

            Activity

            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Maybe. I think we firstly need to implement correct handling of Errors and RuntimeExceptions in the core in order to avoid the case when the channel object leaks after the failure. It should help with some cases

            Show
            oleg_nenashev Oleg Nenashev added a comment - Maybe. I think we firstly need to implement correct handling of Errors and RuntimeExceptions in the core in order to avoid the case when the channel object leaks after the failure. It should help with some cases
            Hide
            mmitche Matthew Mitchell added a comment -

            Right, for sure. I think there are a few cases:

            1) Cases where plugins/core usae computer.getChannel(). These work fine since if the listeners run properly, the channel is set to null and the code can do the right thing at that point depending on what its function is.
            2) Cases where the channel object is held on an object (Ping thread, etc.) but there is error handling. These appear okay (ping thread exits).
            3) Cases where the channel object is held on an object but no error handling - These need fixing.

            I don't know of any real cases of #3. #2 appears okay. #1 is a problem because the listeners which should null out the channel on the computer object don't actually run. That is why we see the "already connected" issue.

            Show
            mmitche Matthew Mitchell added a comment - Right, for sure. I think there are a few cases: 1) Cases where plugins/core usae computer.getChannel(). These work fine since if the listeners run properly, the channel is set to null and the code can do the right thing at that point depending on what its function is. 2) Cases where the channel object is held on an object (Ping thread, etc.) but there is error handling. These appear okay (ping thread exits). 3) Cases where the channel object is held on an object but no error handling - These need fixing. I don't know of any real cases of #3. #2 appears okay. #1 is a problem because the listeners which should null out the channel on the computer object don't actually run. That is why we see the "already connected" issue.
            Hide
            mmitche Matthew Mitchell added a comment -

            This also appears to perhaps happen "near" a failure

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

            Show
            mmitche Matthew Mitchell added a comment - This also appears to perhaps happen "near" a failure https://issues.jenkins-ci.org/browse/JENKINS-33358
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Some bits have been addressed in JENKINS-39835

            Show
            oleg_nenashev Oleg Nenashev added a comment - Some bits have been addressed in JENKINS-39835
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Fixed in 2.50

            Show
            oleg_nenashev Oleg Nenashev added a comment - Fixed in 2.50

              People

              • Assignee:
                oleg_nenashev Oleg Nenashev
                Reporter:
                gaffey gaffey he
              • Votes:
                9 Vote for this issue
                Watchers:
                18 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: