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

UnresolvedAddressException in JNLP client running in Docker container

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • docker-swarm-plugin
    • None

      Hi there,

      I've set up a Docker swarm with three worker-nodes and connected it via the docker-swarm-plugin to my Jenkins Buildserver. 

      After a few days (or sometimes just a few hours) the created services which are executing the build process are exiting with an UnresolvedAddressException error. This will have the created Docker-Swarm Nodes in Jenkins to be offline as a result.

      The error will occur every time until I restart Jenkins and my Docker-Swarm Nodes.

      The only working workaround I've found to solve this issue is to define the Jenkins tunnel via IP-Address and not via hostname. You can see it in the configuration.

       

      To see more about the error please have a look into the JNLP client logs:

       
      curl --connect-timeout 20 --max-time 60 -o agent.jar https://jenkins.dummyhost.com/jenkins/jnlpJars/agent.jar,
        % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current,
                                       Dload  Upload   Total   Spent    Left  Speed,
       
        0     0    0     0    0     0      0      0 -::- -::- -::-     0
        0     0    0     0    0     0      0      0 -::- -::- -::-     0
      100  856k  100  856k    0     0  2022k      0 -::- -::- -::- 2023k,
      + export '_JAVA_OPTIONS=-Dhttp.proxyHost=10.0.0.5 -Dhttp.proxyPort=8888 -Dhttps.proxyHost=10.0.0.5 -Dhttps.proxyPort=8888 -Dhttp.nonProxyHosts=localhost|127.0.0.1|10.0.12.|10.0.13.|10.0.14.|.dummyhost.com|10.1.17.*',
      + _JAVA_OPTIONS='-Dhttp.proxyHost=10.0.0.5 -Dhttp.proxyPort=8888 -Dhttps.proxyHost=10.0.0.5 -Dhttps.proxyPort=8888 -Dhttp.nonProxyHosts=localhost|127.0.0.1|10.0.12.|10.0.13.|10.0.14.|.dummyhost.com|10.1.17.*',
      + java -jar agent.jar -jnlpUrl https://jenkins.dummyhost.com/jenkins/computer/agt-ashen_bringen_3-22/slave-agent.jnlp -secret 7cc72d8ac89d9189011a4cbaf60984eeaafeb17dc70c9b4aa891e864390a71f5 -workDir /home/jenkins,
      Picked up _JAVA_OPTIONS: -Dhttp.proxyHost=10.0.0.5 -Dhttp.proxyPort=8888 -Dhttps.proxyHost=10.0.0.5 -Dhttps.proxyPort=8888 -Dhttp.nonProxyHosts=localhost|127.0.0.1|10.0.12.|10.0.13.|10.0.14.|.dummyhost.com|10.1.17.*,
      Jan 15, 2020 6:06:08 AM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir,
      INFO: Using /home/jenkins/remoting as a remoting work directory,
      Jan 15, 2020 6:06:08 AM org.jenkinsci.remoting.engine.WorkDirManager setupLogging,
      INFO: Both error and output logs will be printed to /home/jenkins/remoting,
      Jan 15, 2020 6:06:09 AM hudson.remoting.jnlp.Main createEngine,
      INFO: Setting up agent: agt-ashen_bringen_3-22,
      Jan 15, 2020 6:06:09 AM hudson.remoting.jnlp.Main$CuiListener <init>,
      INFO: Jenkins agent is running in headless mode.,
      Jan 15, 2020 6:06:09 AM hudson.remoting.Engine startEngine,
      INFO: Using Remoting version: 3.36,
      Jan 15, 2020 6:06:09 AM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir,
      INFO: Using /home/jenkins/remoting as a remoting work directory,
      Jan 15, 2020 6:06:09 AM hudson.remoting.jnlp.Main$CuiListener status,
      INFO: Locating server among https://jenkins.dummyhost.com/jenkins/,
      Jan 15, 2020 6:06:09 AM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolve,
      INFO: Remoting server accepts the following protocols: [JNLP4-connect, Ping],
      Jan 15, 2020 6:06:09 AM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolve,
      INFO: Remoting TCP connection tunneling is enabled. Skipping the TCP Agent Listener Port availability check,
      Jan 15, 2020 6:06:09 AM hudson.remoting.jnlp.Main$CuiListener status,
      INFO: Agent discovery successful,
        Agent address: server-hostname.dummyhost.com,
        Agent port:    34119,
        Identity:      71:01:9b:12:d7:3a:23:20:95:15:60:53:1d:3a:a4:5a,
      Jan 15, 2020 6:06:09 AM hudson.remoting.jnlp.Main$CuiListener status,
      INFO: Handshaking,
      Jan 15, 2020 6:06:09 AM hudson.remoting.jnlp.Main$CuiListener status,
      INFO: Connecting to server-hostname.dummyhost.com:34119,
      Jan 15, 2020 6:06:09 AM hudson.remoting.jnlp.Main$CuiListener error,
      SEVERE: null,
      java.nio.channels.UnresolvedAddressException,
      at java.base/sun.nio.ch.Net.checkAddress(Net.java:130),
      at java.base/sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:675),
      at java.base/java.nio.channels.SocketChannel.open(SocketChannel.java:194),
      at org.jenkinsci.remoting.engine.JnlpAgentEndpoint.open(JnlpAgentEndpoint.java:204),
      at hudson.remoting.Engine.connectTcp(Engine.java:678),
      at hudson.remoting.Engine.innerRun(Engine.java:556),
      at hudson.remoting.Engine.run(Engine.java:488),
       
       
      Please note, that I've censored or manipulated the IP-Addresses and hostnames in the log and the screenshots to avoid passing out internal data of my company.

        1. Docker-Swarm-Config01.png
          42 kB
          Julian Breitung
        2. Docker-Swarm-Config02.png
          80 kB
          Julian Breitung

            Unassigned Unassigned
            jbreitung Julian Breitung
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: