-
Bug
-
Resolution: Fixed
-
Major
-
None
My testing environment went to the state when it is unable to provision any Foreman node. In the server.log, I've found this exception:
2016-09-14 04:59:50,035 SEVERE [hudson.triggers.SafeTimerTask] (jenkins.util.Timer [#8]) Timer task hudson.slaves.NodeProvisioner$NodeProvisionerInvoker@77be2155 failed java.lang.NullPointerException at com.redhat.foreman.ForemanSharedNodeCloud.canProvision(ForemanSharedNodeCloud.java:155) at hudson.slaves.NodeProvisioner$StandardStrategyImpl.apply(NodeProvisioner.java:661) at hudson.slaves.NodeProvisioner.update(NodeProvisioner.java:286) at hudson.slaves.NodeProvisioner.access$000(NodeProvisioner.java:57) at hudson.slaves.NodeProvisioner$NodeProvisionerInvoker.doRun(NodeProvisioner.java:775) at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:51) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439) at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:682)
.
The sourcecode of canProvision:
@Override public boolean canProvision(Label label) { Map<String, String> hostsMap = getForemanAPI().getCompatibleHosts(); Set<String> hosts = hostsMap.keySet(); for (String host: hosts) { boolean match = label.matches(Label.parse(hostsMap.get(host))); if (match) { return true; } } return false; }
line 155:
boolean match = label.matches(Label.parse(hostsMap.get(host)));
- in the Foreman there are defined three compatible nodes currently, each with some label assigned.
- click on Test connection works