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

NPE when attempting to connect docker agent to docker master

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: swarm-plugin
    • Labels:
      None
    • Environment:
      AWS. Docker master. Docker agent.
    • Similar Issues:

      Description

      $ docker run --network="dockerjenkinssuite_default"  csanchez/jenkins-swarm-slave -username admin -password admin -executors 1 -master http://172.18.0.2:8080
      Running java -jar /usr/share/jenkins/swarm-client-3.4.jar -fsroot /home/jenkins-slave -username admin -password admin -executors 1 -master http://172.18.0.2:8080
      May 10, 2017 8:23:43 PM hudson.plugins.swarm.Client main
      INFO: Client.main invoked with: [-fsroot /home/jenkins-slave -username admin -password admin -executors 1 -master http://172.18.0.2:8080]
      May 10, 2017 8:23:46 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)

      Which happens across the board.  The username and password are correct and work:

      $ docker run -it --network="dockerjenkinssuite_default" --rm nicolaka/netshoot
      / # curl http://admin:admin@172.18.0.2:8080/api/xml
      <hudson _class='hudson.model.Hudson'><assignedLabel></assignedLabel><mode>NORMAL</mode><nodeDescription>the master Jenkins node</nodeDescription><nodeName></nodeName><numExecutors>2</numExecutors><job _class='org.jenkinsci.plugins.workflow.job.WorkflowJob'><name>Monthly Statistics Ingest</name><url>http://10.30.0.152/job/Monthly%20Statistics%20Ingest/</url><color>notbuilt</color></job><overallLoad></overallLoad><primaryView _class='hudson.model.AllView'><name>all</name><url>http://10.30.0.152/</url></primaryView><quietingDown>false</quietingDown><slaveAgentPort>50000</slaveAgentPort><unlabeledLoad _class='jenkins.model.UnlabeledLoadStatistics'></unlabeledLoad><useCrumbs>true</useCrumbs><useSecurity>true</useSecurity><view _class='hudson.model.AllView'><name>all</name><url>http://10.30.0.152/</url></view></hudson>

      I don't think I should get a null pointer even if my connection is incorrect. 

      I would like to be able to connect the swarm agent via the docker internal network while the jenkins master still serves via the non-docker IP address. (being proxied by traefik.)

      Is there any way I can further debug this? The docs don't mention any debug logging or anything.

      Using

        Attachments

          Issue Links

            Activity

            Hide
            winotu Chris Z added a comment -

            add empty option -sslFingerprints " " to fix issue

            Show
            winotu Chris Z added a comment - add empty option -sslFingerprints " " to fix issue
            Hide
            sean_abbott Sean Abbott added a comment -

            Ok, that worked.  The NPE is still a bug, IMO, and also, if someone wants to tell me where they want work-around documentation, I can do that. Wiki? Do I need special perms?

            Show
            sean_abbott Sean Abbott added a comment - Ok, that worked.  The NPE is still a bug, IMO, and also, if someone wants to tell me where they want work-around documentation, I can do that. Wiki? Do I need special perms?

              People

              • Assignee:
                winotu Chris Z
                Reporter:
                sean_abbott Sean Abbott
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: