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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Component/s: core
    • Labels:
    • Environment:
      Jenkins 2.248
    • Similar Issues:
    • Released As:
      2.276 and 2.277.1

      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

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              orsoly Orsolya Kiss
              Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: