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

Connecting to master on HTTPS fails after few minutes

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • swarm-plugin
    • None
    • ## Master
      Jenkins Version : 2.51
      OS: Alpine OS 3.5
      Swarm Plugin 3.3

      ## Slave
      Jenkins Swarm: 3.3 and 3.4
      OS: Amazon Linux

      When I connect to my Jenkins Master on HTTP, swarm works fine but it fails when I try to connect thru HTTPS (after few minutes).

      nohup java -jar /opt/swarm-client-3.4.jar  -disableSslVerification -master https://<Jenkins_URL> -username <username> -password <password> -fsroot /var/jenkins_home &
      

      Here is the detailed log.

      [root@ip-10-61-66-11 ~]# java -jar /opt/swarm-client.jar -disableSslVerification -master https://jenkins-master.mydomain.com -username admin -password jenkinspassword -labels slave -executors 10 -description "Jenkins Slave" -fsroot /var/jenkins_home
      Apr 12, 2017 2:11:12 AM hudson.plugins.swarm.Client main
      INFO: Client.main invoked with: [-disableSslVerification -master https://jenkins-master.mydomain.com -username admin -password jenkinspassword -labels slave -executors 10 -description Jenkins Slave -fsroot /var/jenkins_home]
      Apr 12, 2017 2:11:13 AM hudson.plugins.swarm.Client run
      INFO: Discovering Jenkins master
      SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
      SLF4J: Defaulting to no-operation (NOP) logger implementation
      SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
      Apr 12, 2017 2:11:14 AM hudson.plugins.swarm.Client run
      INFO: Attempting to connect to https://jenkins-master.mydomain.com/ 692eef4e-08aa-4462-9bd3-573a8a977a48 with ID 7fa6f27f
      Apr 12, 2017 2:11:14 AM hudson.plugins.swarm.SwarmClient getCsrfCrumb
      SEVERE: Could not obtain CSRF crumb. Response code: 404
      Apr 12, 2017 2:11:15 AM hudson.remoting.jnlp.Main createEngine
      INFO: Setting up slave: ip-10-61-66-11.ap-southeast-2.compute.internal-7fa6f27f
      Apr 12, 2017 2:11:15 AM hudson.remoting.jnlp.Main$CuiListener <init>
      INFO: Jenkins agent is running in headless mode.
      Apr 12, 2017 2:11:15 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Locating server among [https://jenkins-master.mydomain.com/]
      Apr 12, 2017 2:11:16 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Agent discovery successful
        Agent address: jenkins-master.mydomain.com
        Agent port:    50000
        Identity:      34:fc:02:5a:85:94:6f:24:18:8d:7f:99:36:d7:e1:f6
      Apr 12, 2017 2:11:16 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Handshaking
      Apr 12, 2017 2:11:16 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Connecting to jenkins-master.mydomain.com:50000
      Apr 12, 2017 2:11:16 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Trying protocol: JNLP4-connect
      Apr 12, 2017 2:11:16 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Remote identity confirmed: 34:fc:02:5a:85:94:6f:24:18:8d:7f:99:36:d7:e1:f6
      Apr 12, 2017 2:11:17 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Connected
      
      Apr 12, 2017 2:49:02 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Terminated
      Apr 12, 2017 2:49:02 AM hudson.plugins.swarm.Client run
      INFO: Retrying in 10 seconds
      Apr 12, 2017 2:49:13 AM hudson.plugins.swarm.Client run
      INFO: Attempting to connect to https://jenkins-master.mydomain.com/ 692eef4e-08aa-4462-9bd3-573a8a977a48 with ID 7fa6f27f
      Apr 12, 2017 2:49:13 AM hudson.plugins.swarm.SwarmClient getCsrfCrumb
      SEVERE: Could not obtain CSRF crumb. Response code: 404
      Apr 12, 2017 2:49:14 AM hudson.remoting.jnlp.Main createEngine
      INFO: Setting up slave: ip-10-61-66-11.ap-southeast-2.compute.internal-7fa6f27f
      Apr 12, 2017 2:49:14 AM hudson.remoting.jnlp.Main$CuiListener <init>
      INFO: Jenkins agent is running in headless mode.
      Apr 12, 2017 2:49:14 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Locating server among [https://jenkins-master.mydomain.com/]
      Apr 12, 2017 2:49:14 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Agent discovery successful
        Agent address: jenkins-master.mydomain.com
        Agent port:    50000
        Identity:      34:fc:02:5a:85:94:6f:24:18:8d:7f:99:36:d7:e1:f6
      Apr 12, 2017 2:49:14 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Handshaking
      Apr 12, 2017 2:49:14 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Connecting to jenkins-master.mydomain.com:50000
      Apr 12, 2017 2:49:14 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Trying protocol: JNLP4-connect
      Apr 12, 2017 2:49:15 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Remote identity confirmed: 34:fc:02:5a:85:94:6f:24:18:8d:7f:99:36:d7:e1:f6
      Apr 12, 2017 2:49:15 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Connected
      
      Apr 12, 2017 2:51:02 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Terminated
      Apr 12, 2017 2:51:02 AM hudson.plugins.swarm.Client run
      INFO: Retrying in 10 seconds
      Apr 12, 2017 2:51:13 AM hudson.plugins.swarm.Client run
      INFO: Attempting to connect to https://jenkins-master.mydomain.com/ 692eef4e-08aa-4462-9bd3-573a8a977a48 with ID 7fa6f27f
      Apr 12, 2017 2:51:13 AM hudson.plugins.swarm.SwarmClient getCsrfCrumb
      SEVERE: Could not obtain CSRF crumb. Response code: 404
      Apr 12, 2017 2:51:14 AM hudson.remoting.jnlp.Main createEngine
      INFO: Setting up slave: ip-10-61-66-11.ap-southeast-2.compute.internal-7fa6f27f
      Apr 12, 2017 2:51:14 AM hudson.remoting.jnlp.Main$CuiListener <init>
      INFO: Jenkins agent is running in headless mode.
      Apr 12, 2017 2:51:14 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Locating server among [https://jenkins-master.mydomain.com/]
      Apr 12, 2017 2:51:14 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Agent discovery successful
        Agent address: jenkins-master.mydomain.com
        Agent port:    50000
        Identity:      34:fc:02:5a:85:94:6f:24:18:8d:7f:99:36:d7:e1:f6
      Apr 12, 2017 2:51:14 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Handshaking
      Apr 12, 2017 2:51:14 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Connecting to jenkins-master.mydomain.com:50000
      Apr 12, 2017 2:51:14 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Trying protocol: JNLP4-connect
      Apr 12, 2017 2:51:15 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Remote identity confirmed: 34:fc:02:5a:85:94:6f:24:18:8d:7f:99:36:d7:e1:f6
      Apr 12, 2017 2:51:15 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Connected
      
      Apr 12, 2017 2:53:16 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Terminated
      Apr 12, 2017 2:53:16 AM hudson.plugins.swarm.Client run
      INFO: Retrying in 10 seconds
      Apr 12, 2017 2:53:26 AM hudson.plugins.swarm.Client run
      INFO: Attempting to connect to https://jenkins-master.mydomain.com/ 692eef4e-08aa-4462-9bd3-573a8a977a48 with ID 7fa6f27f
      Apr 12, 2017 2:53:27 AM hudson.plugins.swarm.SwarmClient getCsrfCrumb
      SEVERE: Could not obtain CSRF crumb. Response code: 404
      javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative DNS name matching jenkins-master.mydomain.com found.
      	at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
      	at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1914)
      	at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:279)
      	at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:273)
      	at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1477)
      	at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:213)
      	at sun.security.ssl.Handshaker.processLoop(Handshaker.java:961)
      	at sun.security.ssl.Handshaker.process_record(Handshaker.java:897)
      	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1033)
      	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1342)
      	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1369)
      	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1353)
      	at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
      	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
      	at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:153)
      	at hudson.remoting.Launcher.parseJnlpArguments(Launcher.java:393)
      	at hudson.plugins.swarm.SwarmClient.connect(SwarmClient.java:284)
      	at hudson.plugins.swarm.Client.run(Client.java:135)
      	at hudson.plugins.swarm.Client.main(Client.java:87)
      Caused by: java.security.cert.CertificateException: No subject alternative DNS name matching jenkins-master.mydomain.com found.
      	at sun.security.util.HostnameChecker.matchDNS(HostnameChecker.java:204)
      	at sun.security.util.HostnameChecker.match(HostnameChecker.java:95)
      	at sun.security.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:347)
      	at sun.security.ssl.AbstractTrustManagerWrapper.checkAdditionalTrust(SSLContextImpl.java:940)
      	at sun.security.ssl.AbstractTrustManagerWrapper.checkServerTrusted(SSLContextImpl.java:907)
      	at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1459)
      	... 14 more
      Apr 12, 2017 2:53:27 AM hudson.plugins.swarm.SwarmClient connect
      SEVERE: Failed to establish JNLP connection to https://jenkins-master.mydomain.com/
      javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative DNS name matching jenkins-master.mydomain.com found.
      	at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
      	at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1914)
      	at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:279)
      	at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:273)
      	at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1477)
      	at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:213)
      	at sun.security.ssl.Handshaker.processLoop(Handshaker.java:961)
      	at sun.security.ssl.Handshaker.process_record(Handshaker.java:897)
      	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1033)
      	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1342)
      	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1369)
      	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1353)
      	at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
      	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
      	at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:153)
      	at hudson.remoting.Launcher.parseJnlpArguments(Launcher.java:393)
      	at hudson.plugins.swarm.SwarmClient.connect(SwarmClient.java:284)
      	at hudson.plugins.swarm.Client.run(Client.java:135)
      	at hudson.plugins.swarm.Client.main(Client.java:87)
      Caused by: java.security.cert.CertificateException: No subject alternative DNS name matching jenkins-master.mydomain.com found.
      	at sun.security.util.HostnameChecker.matchDNS(HostnameChecker.java:204)
      	at sun.security.util.HostnameChecker.match(HostnameChecker.java:95)
      	at sun.security.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:347)
      	at sun.security.ssl.AbstractTrustManagerWrapper.checkAdditionalTrust(SSLContextImpl.java:940)
      	at sun.security.ssl.AbstractTrustManagerWrapper.checkServerTrusted(SSLContextImpl.java:907)
      	at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1459)
      	... 14 more
      
      Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0
      	at java.util.Collections$EmptyList.get(Collections.java:3212)
      	at hudson.plugins.swarm.SwarmClient.connect(SwarmClient.java:292)
      	at hudson.plugins.swarm.Client.run(Client.java:135)
      	at hudson.plugins.swarm.Client.main(Client.java:87)
      

      Thanks in advance for looking into this.

      Regards,
      Vikas

          [JENKINS-43527] Connecting to master on HTTPS fails after few minutes

          Guiomar Tuñón added a comment - - edited

          I can't launch the jar. The message I see is this other, but as far I know it its related. 

          java -jar swarm-client-3.4.jar -name "hostname-a_01" -master [https://my.jenkins/jenkins] -username *****jenkins -password ******* -executors 1 -labels "test" --showHostName -disableClientsUniqueId -deleteExistingClients -t maven=/usr/share/apache-maven-3.3.3 
          Apr 12, 2017 3:41:38 AM hudson.plugins.swarm.Client main
          INFO: Client.main invoked with: [-name hostname-a_01 -master [https://my.jenkins/jenkins] -username *****jenkins -password ******* -executors 1 -labels "test" --showHostName -disableClientsUniqueId -deleteExistingClients -t maven=/usr/share/apache-maven-3.3.3
          Apr 12, 2017 3:41:38 AM hudson.plugins.swarm.Client run
          INFO: Discovering Jenkins master
          Exception in thread "main" java.lang.NullPointerException
                at hudson.plugins.swarm.SwarmClient.createHttpClient(SwarmClient.java:333)
                at hudson.plugins.swarm.SwarmClient.discoverFromMasterUrl(SwarmClient.java:213)
                at hudson.plugins.swarm.Client.run(Client.java:114)
                at hudson.plugins.swarm.Client.main(Client.java:87)
          

          But launching swarm-client-3.3.jar with the same parameters on the same machine I'm able to start the slave successfully.

          Edited: - Jenkins ver: 2.46.1

          Guiomar Tuñón added a comment - - edited I can't launch the jar. The message I see is this other, but as far I know it its related.  java -jar swarm-client-3.4.jar -name "hostname-a_01" -master [https://my.jenkins/jenkins] -username *****jenkins -password ******* -executors 1 -labels "test" --showHostName -disableClientsUniqueId -deleteExistingClients -t maven=/usr/share/apache-maven-3.3.3  Apr 12, 2017 3:41:38 AM hudson.plugins.swarm.Client main INFO: Client.main invoked with: [-name hostname-a_01 -master [https://my.jenkins/jenkins] -username *****jenkins -password ******* -executors 1 -labels "test" --showHostName -disableClientsUniqueId -deleteExistingClients -t maven=/usr/share/apache-maven-3.3.3 Apr 12, 2017 3:41:38 AM hudson.plugins.swarm.Client run INFO: Discovering Jenkins master Exception in thread "main" java.lang.NullPointerException at hudson.plugins.swarm.SwarmClient.createHttpClient(SwarmClient.java:333) at hudson.plugins.swarm.SwarmClient.discoverFromMasterUrl(SwarmClient.java:213) at hudson.plugins.swarm.Client.run(Client.java:114) at hudson.plugins.swarm.Client.main(Client.java:87) But launching swarm-client-3.3.jar with the same parameters on the same machine I'm able to start the slave successfully. Edited: - Jenkins ver: 2.46.1

          Chris Z added a comment - - edited

          As gtunon  wrote I also get null pointer exception but on http protocol. On Jenkins side I have information that agent/node is created but no connection possible. 

          jenkins ver: Jenkins ver. 2.54   swarm plugin: 3.4

           

          When I use swarm plugin 3.4  with swarm client 3.3, swarm process exists but on Jenkins side node is created and terminated after few seconds.

           

           Apr 12, 2017 3:21:48 PM INFO hudson.TcpSlaveAgentListener$ConnectionHandler run
          Accepted connection #7,607 from 10.10.1.111/10.10.1.111:48794
          Apr 12, 2017 3:21:49 PM WARNING jenkins.slaves.DefaultJnlpSlaveReceiver channelClosed
          Computer.threadPoolForRemoting 174 for test-instance terminated
           java.nio.channels.ClosedChannelException
           at org.jenkinsci.remoting.protocol.impl.ChannelApplicationLayer.onReadClosed(ChannelApplicationLayer.java:208)
           at org.jenkinsci.remoting.protocol.ApplicationLayer.onRecvClosed(ApplicationLayer.java:222)
           at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.onRecvClosed(ProtocolStack.java:832)
           at org.jenkinsci.remoting.protocol.FilterLayer.onRecvClosed(FilterLayer.java:287)
           at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.onRecvClosed(SSLEngineFilterLayer.java:181)
           at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.switchToNoSecure(SSLEngineFilterLayer.java:283)
           at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.processWrite(SSLEngineFilterLayer.java:503)
           at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.processQueuedWrites(SSLEngineFilterLayer.java:248)
           at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.doSend(SSLEngineFilterLayer.java:200)
           at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.doCloseSend(SSLEngineFilterLayer.java:213)
           at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.doCloseSend(ProtocolStack.java:800)
           at org.jenkinsci.remoting.protocol.ApplicationLayer.doCloseWrite(ApplicationLayer.java:173)
           at org.jenkinsci.remoting.protocol.impl.ChannelApplicationLayer$ByteBufferCommandTransport.closeWrite(ChannelApplicationLayer.java:311)
           at hudson.remoting.Channel.close(Channel.java:1295)
           at hudson.remoting.Channel.close(Channel.java:1263)
           at jenkins.slaves.DefaultJnlpSlaveReceiver.afterChannel(DefaultJnlpSlaveReceiver.java:173)
           at org.jenkinsci.remoting.engine.JnlpConnectionState$4.invoke(JnlpConnectionState.java:421)
           at org.jenkinsci.remoting.engine.JnlpConnectionState.fire(JnlpConnectionState.java:312)
           at org.jenkinsci.remoting.engine.JnlpConnectionState.fireAfterChannel(JnlpConnectionState.java:418)
           at org.jenkinsci.remoting.engine.JnlpProtocol4Handler$Handler$1.run(JnlpProtocol4Handler.java:334)
           at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
           at java.lang.Thread.run(Thread.java:745)
          

           

          on swarm client side:

          {code:java}
           Apr 12, 2017 4:24:03 PM hudson.plugins.swarm.Client run
          INFO: Attempting to connect to http://jenkins_adress:8080/ 08a74b37-b3a7-4fbf-861f-38d39caef4b3 with ID f5fc98e1
          Apr 12, 2017 4:24:07 PM hudson.remoting.jnlp.Main createEngine
          INFO: Setting up slave: test_instance
          Apr 12, 2017 4:24:07 PM hudson.remoting.jnlp.Main$CuiListener <init>
          INFO: Jenkins agent is running in headless mode.
          Apr 12, 2017 4:24:07 PM hudson.remoting.jnlp.Main$CuiListener status
          INFO: Locating server among [http://jenkins_adress:8080/]
          Apr 12, 2017 4:24:07 PM hudson.remoting.jnlp.Main$CuiListener status
          INFO: Agent discovery successful
            Agent address: jenkins_adress
            Agent port:    3141
            Identity:      6d:d5:ec:66:03:4a:52:42:18:f7:8d:0e:fb:24:ea:96
          Apr 12, 2017 4:24:07 PM hudson.remoting.jnlp.Main$CuiListener status
          INFO: Handshaking
          Apr 12, 2017 4:24:07 PM hudson.remoting.jnlp.Main$CuiListener status
          INFO: Connecting to jenkins_adress:3141
          Apr 12, 2017 4:24:07 PM hudson.remoting.jnlp.Main$CuiListener status
          INFO: Trying protocol: JNLP4-connect
          Apr 12, 2017 4:24:08 PM hudson.remoting.jnlp.Main$CuiListener status
          INFO: Remote identity confirmed: 6d:d5:ec:66:03:4a:52:42:18:f7:8d:0e:fb:24:ea:96
          Apr 12, 2017 4:24:08 PM hudson.remoting.jnlp.Main$CuiListener status
          INFO: Connected
          Apr 12, 2017 4:24:08 PM hudson.remoting.jnlp.Main$CuiListener status
          INFO: Terminated
          Apr 12, 2017 4:24:08 PM hudson.plugins.swarm.Client run
          INFO: Retrying in 10 seconds
          {code}
          
          

           

          Chris Z added a comment - - edited As gtunon   wrote I also get null pointer exception but on http protocol. On Jenkins side I have information that agent/node is created but no connection possible.  jenkins ver: Jenkins ver. 2.54    swarm plugin: 3.4   When I use swarm plugin 3.4  with swarm client 3.3, swarm process exists but on Jenkins side node is created and terminated after few seconds.    Apr 12, 2017 3:21:48 PM INFO hudson.TcpSlaveAgentListener$ConnectionHandler run Accepted connection #7,607 from 10.10.1.111/10.10.1.111:48794 Apr 12, 2017 3:21:49 PM WARNING jenkins.slaves.DefaultJnlpSlaveReceiver channelClosed Computer.threadPoolForRemoting 174 for test-instance terminated java.nio.channels.ClosedChannelException at org.jenkinsci.remoting.protocol.impl.ChannelApplicationLayer.onReadClosed(ChannelApplicationLayer.java:208) at org.jenkinsci.remoting.protocol.ApplicationLayer.onRecvClosed(ApplicationLayer.java:222) at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.onRecvClosed(ProtocolStack.java:832) at org.jenkinsci.remoting.protocol.FilterLayer.onRecvClosed(FilterLayer.java:287) at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.onRecvClosed(SSLEngineFilterLayer.java:181) at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.switchToNoSecure(SSLEngineFilterLayer.java:283) at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.processWrite(SSLEngineFilterLayer.java:503) at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.processQueuedWrites(SSLEngineFilterLayer.java:248) at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.doSend(SSLEngineFilterLayer.java:200) at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.doCloseSend(SSLEngineFilterLayer.java:213) at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.doCloseSend(ProtocolStack.java:800) at org.jenkinsci.remoting.protocol.ApplicationLayer.doCloseWrite(ApplicationLayer.java:173) at org.jenkinsci.remoting.protocol.impl.ChannelApplicationLayer$ByteBufferCommandTransport.closeWrite(ChannelApplicationLayer.java:311) at hudson.remoting.Channel.close(Channel.java:1295) at hudson.remoting.Channel.close(Channel.java:1263) at jenkins.slaves.DefaultJnlpSlaveReceiver.afterChannel(DefaultJnlpSlaveReceiver.java:173) at org.jenkinsci.remoting.engine.JnlpConnectionState$4.invoke(JnlpConnectionState.java:421) at org.jenkinsci.remoting.engine.JnlpConnectionState.fire(JnlpConnectionState.java:312) at org.jenkinsci.remoting.engine.JnlpConnectionState.fireAfterChannel(JnlpConnectionState.java:418) at org.jenkinsci.remoting.engine.JnlpProtocol4Handler$Handler$1.run(JnlpProtocol4Handler.java:334) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang. Thread .run( Thread .java:745)   on swarm client side: {code:java} Apr 12, 2017 4:24:03 PM hudson.plugins.swarm.Client run INFO: Attempting to connect to http://jenkins_adress:8080/ 08a74b37-b3a7-4fbf-861f-38d39caef4b3 with ID f5fc98e1 Apr 12, 2017 4:24:07 PM hudson.remoting.jnlp.Main createEngine INFO: Setting up slave: test_instance Apr 12, 2017 4:24:07 PM hudson.remoting.jnlp.Main$CuiListener <init> INFO: Jenkins agent is running in headless mode. Apr 12, 2017 4:24:07 PM hudson.remoting.jnlp.Main$CuiListener status INFO: Locating server among [http://jenkins_adress:8080/] Apr 12, 2017 4:24:07 PM hudson.remoting.jnlp.Main$CuiListener status INFO: Agent discovery successful Agent address: jenkins_adress Agent port: 3141 Identity: 6d:d5:ec:66:03:4a:52:42:18:f7:8d:0e:fb:24:ea:96 Apr 12, 2017 4:24:07 PM hudson.remoting.jnlp.Main$CuiListener status INFO: Handshaking Apr 12, 2017 4:24:07 PM hudson.remoting.jnlp.Main$CuiListener status INFO: Connecting to jenkins_adress:3141 Apr 12, 2017 4:24:07 PM hudson.remoting.jnlp.Main$CuiListener status INFO: Trying protocol: JNLP4-connect Apr 12, 2017 4:24:08 PM hudson.remoting.jnlp.Main$CuiListener status INFO: Remote identity confirmed: 6d:d5:ec:66:03:4a:52:42:18:f7:8d:0e:fb:24:ea:96 Apr 12, 2017 4:24:08 PM hudson.remoting.jnlp.Main$CuiListener status INFO: Connected Apr 12, 2017 4:24:08 PM hudson.remoting.jnlp.Main$CuiListener status INFO: Terminated Apr 12, 2017 4:24:08 PM hudson.plugins.swarm.Client run INFO: Retrying in 10 seconds {code}  

          Mike Delaney added a comment -

          I'm seeing the same thing, though my environment is slightly different. I'm seeing this on Ubuntu 14.04 and Ubuntu 16.04 machines. I have yet to find a work around. I'm in the process of downgrading to see if that helps.

          Mike Delaney added a comment - I'm seeing the same thing, though my environment is slightly different. I'm seeing this on Ubuntu 14.04 and Ubuntu 16.04 machines. I have yet to find a work around. I'm in the process of downgrading to see if that helps.

          mdelaney I have the slaves running with the swarm-client-3.3.jar with no major incidences. I haven't made an extensive use of the slave yet.

          Guiomar Tuñón added a comment - mdelaney I have the slaves running with the swarm-client-3.3.jar with no major incidences. I haven't made an extensive use of the slave yet.

          Chris Z added a comment - - edited

          I had to update java on my instance with swarm client. To 1.8 openjdk and it started to work. Before that I had 1.7 version. The same version of java which Jenkins works (that is 1.8). But only swarm client 3.3 version.

           

          It seems that change:

           https://github.com/jenkinsci/swarm-plugin/commit/401ca9a73219f03def4c6c314da4f2e10e16b0d7#diff-83706231caf70d649ef817cd96216bf6R333

          is mostly the reason of those failures.

          INFO: Discovering Jenkins master
          Exception in thread "main" java.lang.NullPointerException
                  at hudson.plugins.swarm.SwarmClient.createHttpClient(SwarmClient.java:333)
                  at hudson.plugins.swarm.SwarmClient.discoverFromMasterUrl(SwarmClient.java:213)
                  at hudson.plugins.swarm.Client.run(Client.java:114)
          if (options.disableSslVerification || !options.sslFingerprints.isEmpty()) {        try {
           try {
          

           

          This Options class, String option is by default null !

             @Option(name = "-sslFingerprints", usage = "Whitespace-separated list of accepted certificate fingerprints (SHA-256/Hex), "+       "otherwise system truststore will be used. " +       "No revocation, expiration or not yet valid check will be performed " +       "for custom fingerprints! Multiple options are allowed.")
          public String sslFingerprints;
          

          Chris Z added a comment - - edited I had to update java on my instance with swarm client. To 1.8 openjdk and it started to work. Before that I had 1.7 version. The same version of java which Jenkins works (that is 1.8). But only swarm client 3.3 version.   It seems that change:   https://github.com/jenkinsci/swarm-plugin/commit/401ca9a73219f03def4c6c314da4f2e10e16b0d7#diff-83706231caf70d649ef817cd96216bf6R333 is mostly the reason of those failures. INFO: Discovering Jenkins master Exception in thread "main" java.lang.NullPointerException         at hudson.plugins.swarm.SwarmClient.createHttpClient(SwarmClient.java:333)         at hudson.plugins.swarm.SwarmClient.discoverFromMasterUrl(SwarmClient.java:213)         at hudson.plugins.swarm.Client.run(Client.java:114) if (options.disableSslVerification || !options.sslFingerprints.isEmpty()) { try { try {   This Options class, String option is by default null ! @Option(name = "-sslFingerprints" , usage = "Whitespace-separated list of accepted certificate fingerprints (SHA-256/Hex), " + "otherwise system truststore will be used. " + "No revocation, expiration or not yet valid check will be performed " + " for custom fingerprints! Multiple options are allowed." ) public String sslFingerprints;

          Mike Delaney added a comment -

          gtunon, are you using jdk 8? For me, like winotu, if I upgrade my java from 7 to 8, the issue goes away; using the swarm client v3.3

          Mike Delaney added a comment - gtunon , are you using jdk 8? For me, like winotu , if I upgrade my java from 7 to 8, the issue goes away; using the swarm client v3.3

          I used jdk8 I suppose that's why I could launch the swarm-client-3.3.jar.

          Any news for the 3.4 client?

           

          Guiomar Tuñón added a comment - I used jdk8 I suppose that's why I could launch the swarm-client-3.3.jar. Any news for the 3.4 client?  

          Vikas Kumar added a comment -

          Thanks mdelaney winotu, upgrading the java version to 1.8 worked for me too.

          Vikas Kumar added a comment - Thanks  mdelaney winotu , upgrading the java version to 1.8 worked for me too.

          Chris Z added a comment - - edited

          Hi,

          gtunon  probably for 3.4 client dirty workaround would be passing -sslFingerprints " "  to client run. I haven't test it. Also quick fix in swarm client code would be changing code to:
          public String sslFingerprints="";
          I must create PR. But it's good to start creating changes with tests for them.

          https://github.com/jenkinsci/swarm-plugin/pull/52/commits

          Chris Z added a comment - - edited Hi, gtunon   probably for 3.4 client dirty workaround would be passing -sslFingerprints " "  to client run. I haven't test it. Also quick fix in swarm client code would be changing code to: public String sslFingerprints=""; I must create PR. But it's good to start creating changes with tests for them. https://github.com/jenkinsci/swarm-plugin/pull/52/commits

          Vikas Kumar added a comment -

          Closing the issue since upgrading to Java 1.8 worked for me. Thanks kohsuke

          Vikas Kumar added a comment - Closing the issue since upgrading to Java 1.8 worked for me. Thanks kohsuke

            winotu Chris Z
            vikas027 Vikas Kumar
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: