4
votes

Looking for some help here!

I am running Jenkins(v2.134) as a docker container managed by Rancher(v1.6.16); and i am using haproxy(HA-Proxy version 1.6.3 2015/12/25) as my loadbalancer. Jenkins JNLP port is configured as 50000. haproxy got the rule for TCP port forwarding(8081 > 50000)

My slave (macmini) is in different network and behind firewall (This network can make reach my Jenkins Infra). I am using "Tunnel connection through" property and specified port ":8081". The port 8081 is already opened in the firewall.

My Jenkins Java version is -

openjdk version "1.8.0_151"
OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-1~deb9u1-b12)

My Slave Java version is -

Sun JDK "1.8.0_151"

Here are the agent logs -

*INFO: Setting up agent: my-slave-01*
    Sep 26, 2018 2:48:50 PM hudson.remoting.jnlp.Main$CuiListener <init>
    INFO: Jenkins agent is running in headless mode.
    Sep 26, 2018 2:48:50 PM hudson.remoting.Engine startEngine
    INFO: Using Remoting version: 3.23
    Sep 26, 2018 2:48:50 PM hudson.remoting.Engine startEngine
    WARNING: No Working Directory. Using the legacy JAR Cache location: /Users/jenkins/.jenkins/cache/jars
    Sep 26, 2018 2:48:51 PM hudson.remoting.jnlp.Main$CuiListener status
    INFO: Locating server among [http://<My Jenkins URL>/]
    Sep 26, 2018 2:48:51 PM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolve
    INFO: Remoting server accepts the following protocols: [JNLP4-connect, Ping]
    Sep 26, 2018 2:48:51 PM hudson.remoting.jnlp.Main$CuiListener status
    *INFO: Agent discovery successful*
     *Agent address: <My Jenkins DNS Name>*
     *Agent port:    8081*
     Identity:      b5:c7:33:8d:9c:97:41:3f:e1:b1:b5:31:25:ea:b5:2e
    Sep 26, 2018 2:48:51 PM hudson.remoting.jnlp.Main$CuiListener status
    INFO: Handshaking
    Sep 26, 2018 2:48:51 PM hudson.remoting.jnlp.Main$CuiListener status
    INFO: Connecting to <My Jenkins DNS>:8081
    Sep 26, 2018 2:48:51 PM hudson.remoting.jnlp.Main$CuiListener status
    INFO: Trying protocol: JNLP4-connect
    Sep 26, 2018 2:48:51 PM hudson.remoting.jnlp.Main$CuiListener status
    INFO: Remote identity confirmed: b5:c7:33:8d:9c:97:41:3f:e1:b1:b5:31:25:ea:b5:2e
    Sep 26, 2018 2:48:52 PM hudson.remoting.jnlp.Main$CuiListener status
    *INFO: Connected*
    Sep 26, 2018 2:48:54 PM org.jenkinsci.remoting.util.AnonymousClassWarnings warn
    WARNING: Attempt to (de-)serialize anonymous class org.jenkinsci.plugins.envinject.EnvInjectComputerListener$2; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
    Sep 26, 2018 2:49:49 PM hudson.remoting.jnlp.Main$CuiListener status
    *INFO: Terminated*

Any help will be appreciated.

Is there is a way to get more verbose logs?

1

1 Answers

5
votes

I found the problem; it was with my load balancer(haproxy) default timeout for TCP connections (if no traffic) which was 50000ms. https://cbonte.github.io/haproxy-dconv/configuration-1.5.html

However the Jenkins ping interval to slave i.e.hudson.slaves.ChannelPinger.pingInterval was 5 minutes (dafault). https://wiki.jenkins.io/display/JENKINS/Features+controlled+by+system+properties

Increasing the load balancer timeout i.e. > 5 minutes solved the issue.