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

            jlehtnie Jukka Lehtniemi created issue -
            jlehtnie Jukka Lehtniemi made changes -
            Field Original Value New Value
            Summary NullPointerException for HTTPS client connection NullPointerException for HTTPS swarm client connection
            jlehtnie Jukka Lehtniemi made changes -
            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*

             

            {{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)}}
            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|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)}}
            jlehtnie Jukka Lehtniemi made changes -
            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|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)}}
            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|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)}}
            winotu Chris Z added a comment - https://github.com/jenkinsci/swarm-plugin/pull/52/commits
            winotu Chris Z made changes -
            Link This issue duplicates JENKINS-44210 [ JENKINS-44210 ]
            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.
            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
            oleg_nenashev Oleg Nenashev made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            oleg_nenashev Oleg Nenashev made changes -
            Assignee Kohsuke Kawaguchi [ kohsuke ]
            oleg_nenashev Oleg Nenashev made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]

            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)
            winotu Chris Z made changes -
            Assignee Chris Z [ winotu ]
            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.
            winotu Chris Z made changes -
            Status In Review [ 10005 ] In Progress [ 3 ]
            winotu Chris Z made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            mindrunner Lukas Elsner made changes -
            Link This issue is duplicated by JENKINS-47407 [ JENKINS-47407 ]
            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.
            oleg_nenashev Oleg Nenashev made changes -
            Resolution Fixed [ 1 ]
            Status In Review [ 10005 ] Resolved [ 5 ]

            People

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

              Dates

                Created:
                Updated:
                Resolved: