[JIRA] (JENKINS-54771) NPE in logs after using groovy script to add slave template

5 views
Skip to first unread message

cpenhaligon@gresham-computing.com (JIRA)

unread,
Nov 22, 2018, 7:07:02 AM11/22/18
to jenkinsc...@googlegroups.com
Chris Penhaligon created an issue
 
Jenkins / Bug JENKINS-54771
NPE in logs after using groovy script to add slave template
Issue Type: Bug Bug
Assignee: FABRIZIO MANFREDI
Attachments: AddNewEC2Slave.groovy
Components: ec2-plugin
Created: 2018-11-22 12:06
Environment: jenkins = 2.138.3
ec2-plugin = 1.41
Labels: groovy ec2 ec2-plugin aws npe
Priority: Minor Minor
Reporter: Chris Penhaligon

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. 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

fabrizio.manfredi@gmail.com (JIRA)

unread,
Feb 11, 2019, 12:04:02 PM2/11/19
to jenkinsc...@googlegroups.com
FABRIZIO MANFREDI commented on Bug JENKINS-54771
 
Re: NPE in logs after using groovy script to add slave template

For some reason seems the ami is not used when the node is raised, that will probably force to count all instances running in the account and exceed the cap for this conf
INFO: SlaveTemplate

{ami='', labels='oracle-dbupgrade-f30e32f '}

.

fabrizio.manfredi@gmail.com (JIRA)

unread,
Jun 26, 2019, 11:41:02 AM6/26/19
to jenkinsc...@googlegroups.com

From 1.42 has been redefine the tags for the identification of the nodes, that should avoids this problem.

fabrizio.manfredi@gmail.com (JIRA)

unread,
Jun 26, 2019, 11:41:02 AM6/26/19
to jenkinsc...@googlegroups.com
FABRIZIO MANFREDI closed an issue as Fixed
 
Change By: FABRIZIO MANFREDI
Status: In Progress Closed
Resolution: Fixed

fabrizio.manfredi@gmail.com (JIRA)

unread,
Jun 26, 2019, 11:41:02 AM6/26/19
to jenkinsc...@googlegroups.com
FABRIZIO MANFREDI started work on Bug JENKINS-54771
 
Change By: FABRIZIO MANFREDI
Status: Open In Progress
Reply all
Reply to author
Forward
0 new messages