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

JNLP not considering plain hostnames when evaluating NO_PROXY

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: remoting
    • Labels:
      None
    • Environment:
      Jenkins 2.89.2
      Jenkins remoting 3.1.4
      Jenkins swarm 3.7
    • Similar Issues:
    • Released As:
      Remoting 3.28

      Description

      Encountering a 502 Bad Gateway error when fetching the slave-agent.jnlp file through the swarm client. I have traced this down to being an issue with the way the no_proxy settings are evaluated in Jenkins remoting (swarm is currently evaluating the proxy settings correctly but remoting is not). It currently will ignore any no_proxy settings that consist of hostnames without a domain suffix, i.e. "localhost" or "jenkinsmaster".

      The use case for this is that I am running a docker swarm on a corporate proxy and need to be able to exclude my Jenkins master from the proxy in order for the slaves to be able to communicate.

      I believe this is a simple fix here: https://github.com/jenkinsci/remoting/blob/master/src/main/java/hudson/remoting/Util.java#L132-L140

      The regex should be changed such that the '.' is optional and that the hostname/domain can have underscores '_'.

        Attachments

          Issue Links

            Activity

            Hide
            hdevos Hervé Devos added a comment -

            I wasn't aware of this, thanks Adam! In fact I declared a dedicated network to my compose stack, therefore my container "complete" address is <container_name>.<directory_name>_<network_name> 

            Show
            hdevos Hervé Devos added a comment - I wasn't aware of this, thanks Adam! In fact I declared a dedicated network to my compose stack, therefore my container "complete" address is <container_name>.<directory_name>_<network_name> 
            Hide
            hdevos Hervé Devos added a comment - - edited

            Looks like there is another issue with this Util class:

            when using docker compose network dns adress : <container_name>.<directory_name>_<network_name>  (e.g: jenkins.test_mycomposenetwork), host does not match specified regexp in https://github.com/jenkinsci/remoting/blob/master/src/main/java/hudson/remoting/Util.java#L132 

            Show
            hdevos Hervé Devos added a comment - - edited Looks like there is another issue with this Util class: when using docker compose network dns adress : <container_name>.<directory_name>_<network_name>  (e.g: jenkins.test_mycomposenetwork), host does not match specified regexp in  https://github.com/jenkinsci/remoting/blob/master/src/main/java/hudson/remoting/Util.java#L132  
            Hide
            ajhodges Adam Hodges added a comment -

            Hervé Devos maybe try this to set a name without the directory name in there? https://docs.docker.com/compose/compose-file/compose-file-v2/#name-1

             

            I'll add the '_' to this issue.

            Show
            ajhodges Adam Hodges added a comment - Hervé Devos maybe try this to set a name without the directory name in there? https://docs.docker.com/compose/compose-file/compose-file-v2/#name-1   I'll add the '_' to this issue.
            Hide
            jthompson Jeff Thompson added a comment -

            Here's a PR to re-work the no_proxy implementation: https://github.com/jenkinsci/remoting/pull/293

            It should deal with this report and provide additional, new capabilities.

            Show
            jthompson Jeff Thompson added a comment - Here's a PR to re-work the no_proxy implementation: https://github.com/jenkinsci/remoting/pull/293 It should deal with this report and provide additional, new capabilities.
            Hide
            jthompson Jeff Thompson added a comment -

            This will be picked up by a Jenkins weekly build soon.

            Show
            jthompson Jeff Thompson added a comment - This will be picked up by a Jenkins weekly build soon.

              People

              • Assignee:
                Unassigned
                Reporter:
                ajhodges Adam Hodges
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: