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

NPE in logs after using groovy script to add slave template

XMLWordPrintable

      We've written a groovy script (sample attached) that we're hoping to use to add slave templates to our EC2 cloud. At the moment, we're only executing via the script console but we have plans to eventually automate the process and run it as part of a build. 

      The script executes successfully and when we check under the EC2 cloud settings, we can see our new template there. 

      However, when we try to run a build with a label matching that of the new slave template, we see the following node provisioning error in the logs:

      hudson.plugins.ec2.EC2Cloud provision
      INFO: SlaveTemplate{ami='', labels='oracle-dbupgrade-f30e32f
      '}. Attempting to provision slave needed by excess workload of 1 units
      hudson.triggers.SafeTimerTask run
      SEVERE: Timer task hudson.slaves.NodeProvisioner$NodeProvisionerInvoker@67ae766e failed
      java.lang.NullPointerException
      at hudson.plugins.ec2.SlaveTemplate.provisionSpot(SlaveTemplate.java:798)
      at hudson.plugins.ec2.SlaveTemplate.provision(SlaveTemplate.java:460)
      at hudson.plugins.ec2.EC2Cloud.getNewOrExistingAvailableSlave(EC2Cloud.java:587)
      at hudson.plugins.ec2.EC2Cloud.provision(EC2Cloud.java:602)
      at hudson.slaves.NodeProvisioner$StandardStrategyImpl.apply(NodeProvisioner.java:715)
      at hudson.slaves.NodeProvisioner.update(NodeProvisioner.java:320)
      at hudson.slaves.NodeProvisioner.access$000(NodeProvisioner.java:61)
      at hudson.slaves.NodeProvisioner$NodeProvisionerInvoker.doRun(NodeProvisioner.java:809)
      at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:72)
      at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:58)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)
      

      If we then go back into the 'Manage Jenkins' settings and click apply without making any changes, things burst into life and the new slaves begin to launch. 

            thoulen FABRIZIO MANFREDI
            cpenhaligon Chris Penhaligon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: