java.lang.NullPointerException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • [JIRA] (JENKINS-38196) NPE during node provision
    via by pjan...@redhat.com (JIRA),
  • 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:{code}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) {code}. The sourcecode of canProvision:{code} @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; } {code} line 155:{code}boolean match = label.matches(Label.parse(hostsMap.get(host)));{code} * in the Foreman there are defined three compatible nodes currently, each with some label assigned. * click on Test connection works
    via by Pavel Janoušek,
    • 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)
    No Bugmate found.