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

JNLP slave connection does not consider java non-proxy settings (http.nonProxyHosts)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • core, remoting
    • None
    • Main-Class: hudson.remoting.Launcher
      Version: 2.50

      Our JNLP connection shall work directly and not via Proxy.

      Because our Linux environment per default sets "http_proxy" environment variable and java detects this per default before the java net.properties (jre/lib/net.properties), we started the JNLP Connection with JAVA_OPTS:

      "-Dhttp.proxyHost=... -Dhttp.proxyPort=... -Dhttp.nonProxyHosts=..."

      Until slave version 2.49 this worked fine. Beginning with Version 2.50 we got an error:

      Apr 24, 2015 3:11:04 PM hudson.remoting.jnlp.Main createEngine
      INFO: Setting up slave: xxxx
      Apr 24, 2015 3:11:04 PM hudson.remoting.jnlp.Main$CuiListener <init>
      INFO: Jenkins agent is running in headless mode.
      Apr 24, 2015 3:11:04 PM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Locating server among http://xxx/ci/
      Apr 24, 2015 3:11:05 PM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Handshaking
      Apr 24, 2015 3:11:05 PM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Connecting to xxx:25000
      Apr 24, 2015 3:11:15 PM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Connecting to xxx:25000 (retrying:2)
      java.io.IOException: Got a bad response from proxy: HTTP/1.0 403 Forbidden
      at hudson.remoting.Engine.connect(Engine.java:357)
      at hudson.remoting.Engine.run(Engine.java:241)

      Seems the http.nonProxyHosts is not considered and boolean "isProxy" is the to true:
      (see Line 357, src/main/java/hudson/remoting/Engine.java, https://github.com/jenkinsci/remoting/commit/08b910c7df9a1356b6c53f885c63ea6523e22943)

      We could unset the environment http_proxy variable and start the agent without additional JAVA_OPTS, but in this case the needed environment variable is not exported to the agent shell build tasks.

      Main-Class: hudson.remoting.Launcher
      Version: 2.50

            Unassigned Unassigned
            h_hermanns Horst Hermanns
            Votes:
            7 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated: