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

Cannot use yet-another-docker-plugin JNLP agents in 2.248+

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Blocker
    • Resolution: Unresolved
    • Component/s: core
    • Labels:
    • Environment:
      Jenkins 2.248
    • Similar Issues:

      Description

      The fix for https://issues.jenkins-ci.org/browse/JENKINS-63014 introduced a regression bug. This fix was released in Jenkins version 2.248 and broke a feature used in e.g. yet-another-docker plugin.

      Our Jenkins master is exposed via multiple URLs:

      • primary URL: this is the publicly used URL for the Jenkins server, our users and some of the slave agents  only capable of reaching Jenkins master through this address
      • secondary URL: this is an internal URL (only reachable from the host machine that runs the Jenkins master), some of the slave agents are only capable of reaching Jenkins master through this address

      We're using yet-another-docker plugin with JNLP launcher to launch Docker slaves. It has an option called "Different Jenkins master URL". This option can be used to overwrite the primary URL (the one set in Jenkins global config). Since version 2.248 Jenkins doesn't respect this secondary URL and the slaves fail to connect to Jenkins master.

      Log from previous versions:

      su - jenkins -c java -jar slave.jar -jnlpUrl SECONDARY_URL:8080/computer/docker_cloud-22c714f1d0ba//slave-agent.jnlp -secret "some secret id"
      Jul 27, 2020 11:03:06 AM hudson.remoting.jnlp.Main createEngine
      INFO: Setting up agent: docker_cloud-22c714f1d0ba
      Jul 27, 2020 11:03:06 AM hudson.remoting.jnlp.Main$CuiListener <init>
      INFO: Jenkins agent is running in headless mode.
      Jul 27, 2020 11:03:06 AM hudson.remoting.Engine startEngine
      INFO: Using Remoting version: 4.3
      Jul 27, 2020 11:03:06 AM hudson.remoting.Engine startEngine
      WARNING: No Working Directory. Using the legacy JAR Cache location: /home/jenkins/.jenkins/cache/jars
      Jul 27, 2020 11:03:06 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Locating server among [PRIMARY_URL, SECONDARY_URL]
      Jul 27, 2020 11:03:07 AM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolve
      INFO: Remoting server accepts the following protocols: [JNLP4-connect, Ping]
      Jul 27, 2020 11:03:07 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Agent discovery successful Agent address: SECONDARY_URL Agent port: 39633 Identity: 58:af:30:c6:91:24:f0:ab:ba:3f:ba:a6:d9:41:85:6f
      Jul 27, 2020 11:03:07 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Handshaking Jul 27, 2020 11:03:07 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Connecting to SECONDARY_URL:39633
      Jul 27, 2020 11:03:07 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Trying protocol: JNLP4-connect
      Jul 27, 2020 11:03:07 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Remote identity confirmed: 58:af:30:c6:91:24:f0:ab:ba:3f:ba:a6:d9:41:85:6f
      Jul 27, 2020 11:03:09 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Connected
      
      

      Log from 2.248 version:

      su - jenkins -c java -jar slave.jar -jnlpUrl http://SECONDARY_URL:8080/computer/docker_cloud-13120c5169f2//slave-agent.jnlp -secret "some secret id"
      Jul 27, 2020 10:49:06 AM hudson.remoting.jnlp.Main createEngine
      INFO: Setting up agent: docker_cloud-13120c5169f2
      Jul 27, 2020 10:49:06 AM hudson.remoting.jnlp.Main$CuiListener <init>
      INFO: Jenkins agent is running in headless mode.
      Jul 27, 2020 10:49:06 AM hudson.remoting.Engine startEngine
      INFO: Using Remoting version: 4.5
      Jul 27, 2020 10:49:06 AM hudson.remoting.Engine startEngine
      WARNING: No Working Directory. Using the legacy JAR Cache location: /home/jenkins/.jenkins/cache/jars
      Jul 27, 2020 10:49:06 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Locating server among [PRIMARY_URL]
      Jul 27, 2020 10:49:06 AM hudson.remoting.jnlp.Main$CuiListener error
      SEVERE: Failed to connect to PRIMARY_URL/tcpSlaveAgentListener/: PRIMARY_URL
      

        Attachments

          Issue Links

            Activity

            Hide
            multani Jonathan Ballet added a comment -

            Jesse Glick OK thanks, I'll be able to try that this evening (UTC+2) for my use-case (reported in JENKINS-63014).
            (That won't solve the this very issue though.)

            Show
            multani Jonathan Ballet added a comment - Jesse Glick OK thanks, I'll be able to try that this evening (UTC+2) for my use-case (reported in JENKINS-63014 ). (That won't solve the this very issue though.)
            Hide
            orsoly Orsolya Kiss added a comment -

            Thank you all for the quick responses! Based on this conversation I think JENKINS-63014 should not be reverted.

            I created an issue in the yad plugin's repo, hoping the problem will be solved soon: https://github.com/KostyaSha/yet-another-docker-plugin/issues/288

            Show
            orsoly Orsolya Kiss added a comment - Thank you all for the quick responses! Based on this conversation I think JENKINS-63014  should not be reverted. I created an issue in the yad plugin's repo, hoping the problem will be solved soon:  https://github.com/KostyaSha/yet-another-docker-plugin/issues/288
            Hide
            multani Jonathan Ballet added a comment -

            Sorry for the delay, but we implemented the fix suggested by Jesse Glick in https://issues.jenkins-ci.org/browse/JENKINS-63222#comment-394889 and it seems to work better.
            We are running 2.250 now.

            Show
            multani Jonathan Ballet added a comment - Sorry for the delay, but we implemented the fix suggested by Jesse Glick in https://issues.jenkins-ci.org/browse/JENKINS-63222#comment-394889 and it seems to work better. We are running 2.250 now.
            Hide
            courtneylake2206 Courtney Lake added a comment -

            Jesse Glick we applied your solution but we are getting unknown client name when trying to connect. Do you know what the client name should be. We are using AWS Instances and our client name was i-********** and it used to work before this update.

            Show
            courtneylake2206 Courtney Lake added a comment - Jesse Glick we applied your solution but we are getting unknown client name when trying to connect. Do you know what the client name should be. We are using AWS Instances and our client name was i-********** and it used to work before this update.
            Hide
            jglick Jesse Glick added a comment -

            I am afraid I know little about this plugin and cannot help you with details.

            Show
            jglick Jesse Glick added a comment - I am afraid I know little about this plugin and cannot help you with details.

              People

              • Assignee:
                Unassigned
                Reporter:
                orsoly Orsolya Kiss
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated: