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

NullPointerException for HTTPS swarm client connection

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Minor
    • Resolution: Fixed
    • swarm-plugin
    • None
    • swarm-plugin 3.4
      java 1.8.0_111

    Description

      When running swarm-client version 3.4 and trying to connect to a Jenkins master using HTTPS the client will crash with NullPointerException if not using either of options -disableSslVerification or -sslFingerprints

       

      > java -jar swarm-client-3.4.jar
      Apr 19, 2017 10:48:29 AM hudson.plugins.swarm.Client main
      INFO: Client.main invoked with: []
      Apr 19, 2017 10:48:29 AM hudson.plugins.swarm.Client run
      INFO: Discovering Jenkins master
      Apr 19, 2017 10:48:29 AM hudson.plugins.swarm.Client run
      INFO: No Jenkins master supplied on command line, performing auto-discovery
      Apr 19, 2017 10:48:35 AM hudson.plugins.swarm.Client run

      INFO: Attempting to connect to https://URL 7a...6b with ID 7d...ca
      Exception in thread "main" java.lang.NullPointerException
      {{ at hudson.plugins.swarm.SwarmClient.createHttpClient(SwarmClient.java:333)}}
      at hudson.plugins.swarm.SwarmClient.createSwarmSlave(SwarmClient.java:398)
      {{ at hudson.plugins.swarm.Client.run(Client.java:134)}}
      {{ at hudson.plugins.swarm.Client.main(Client.java:87)}}

      Attachments

        Issue Links

          Activity

            oleg_nenashev Oleg Nenashev added a comment -

            The fix has been released in Swarm Plugin/Client 3.6. Please reopen if you still see any issue.

            oleg_nenashev Oleg Nenashev added a comment - The fix has been released in Swarm Plugin/Client 3.6. Please reopen if you still see any issue.
            winotu Chris Z added a comment -

            https://github.com/jenkinsci/swarm-plugin/commit/e4ba66fe9f5ea6f7a917fad3963a9aeefb9b4f24

            Fix is already merged. But no new plugin release was done since that time.

            winotu Chris Z added a comment - https://github.com/jenkinsci/swarm-plugin/commit/e4ba66fe9f5ea6f7a917fad3963a9aeefb9b4f24 Fix is already merged. But no new plugin release was done since that time.

            I've got the same error with 3.4:

            [root@jenkins-master jenkins-slave]# /usr/bin/java -jar /home/jenkins-slave/swarm-client-3.4.jar -mode exclusive -executors 8 -username jhoblitt -passwordEnvVariable JENKINS_PASSWORD -name jenkins-master -master http://jenkins-master:8080 -labels jenkins-master -fsroot /home/jenkins-slave -disableClientsUniqueId -deleteExistingClients
            Aug 15, 2017 7:11:55 PM hudson.plugins.swarm.Client main
            INFO: Client.main invoked with: [-mode exclusive -executors 8 -username jhoblitt -passwordEnvVariable JENKINS_PASSWORD -name jenkins-master -master http://jenkins-master:8080 -labels jenkins-master -fsroot /home/jenkins-slave -disableClientsUniqueId -deleteExistingClients]
            Aug 15, 2017 7:11:55 PM 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)
            
            
            jhoblitt Joshua Hoblitt added a comment - I've got the same error with 3.4: [root@jenkins-master jenkins-slave]# /usr/bin/java -jar /home/jenkins-slave/swarm-client-3.4.jar -mode exclusive -executors 8 -username jhoblitt -passwordEnvVariable JENKINS_PASSWORD -name jenkins-master -master http: //jenkins-master:8080 -labels jenkins-master -fsroot /home/jenkins-slave -disableClientsUniqueId -deleteExistingClients Aug 15, 2017 7:11:55 PM hudson.plugins.swarm.Client main INFO: Client.main invoked with: [-mode exclusive -executors 8 -username jhoblitt -passwordEnvVariable JENKINS_PASSWORD -name jenkins-master -master http: //jenkins-master:8080 -labels jenkins-master -fsroot /home/jenkins-slave -disableClientsUniqueId -deleteExistingClients] Aug 15, 2017 7:11:55 PM 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)
            oleg_nenashev Oleg Nenashev added a comment -

            The PR has been integrated, but it has not been released by the maintainer

            oleg_nenashev Oleg Nenashev added a comment - The PR has been integrated, but it has not been released by the maintainer
            jekeller Jacob Keller added a comment -

            I also had this problem, and had to downgrade the client to 3.3 to work around the issue for now.

            jekeller Jacob Keller added a comment - I also had this problem, and had to downgrade the client to 3.3 to work around the issue for now.
            winotu Chris Z added a comment - https://github.com/jenkinsci/swarm-plugin/pull/52/commits

            People

              winotu Chris Z
              jlehtnie Jukka Lehtniemi
              Votes:
              6 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: