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

cloudbees-disk-usage-simple showing "java.lang.Long.longValue()" because the return value of "com.cloudbees.simplediskusage.DiskItem.getCount()" is null

XMLWordPrintable

      I am getting below error when using jenkins 2.426.2-lts-jdk17 with cloudbees-disk-usage-simple 187.v6378d330d1d4

      2023-12-21 06:17:55.950+0000 [id=34]    WARNING o.j.p.p.DiskUsageCollector#collect: Failed to get disk usage data due to an unexpected error.
      java.lang.NullPointerException: Cannot invoke "java.lang.Long.longValue()" because the return value of "com.cloudbees.simplediskusage.DiskItem.getCount()" is null
              at org.jenkinsci.plugins.prometheus.collectors.disk.DiskUsageFileCountGauge.calculateMetric(DiskUsageFileCountGauge.java:35)
              at org.jenkinsci.plugins.prometheus.collectors.disk.DiskUsageFileCountGauge.calculateMetric(DiskUsageFileCountGauge.java:9)
              at org.jenkinsci.plugins.prometheus.DiskUsageCollector.lambda$collectDiskUsage$0(DiskUsageCollector.java:64)
              at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
              at org.jenkinsci.plugins.prometheus.DiskUsageCollector.lambda$collectDiskUsage$1(DiskUsageCollector.java:64)
              at java.base/java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:807)
              at org.jenkinsci.plugins.prometheus.DiskUsageCollector.collectDiskUsage(DiskUsageCollector.java:61)
              at org.jenkinsci.plugins.prometheus.DiskUsageCollector.collect(DiskUsageCollector.java:36)
              at io.prometheus.client.CollectorRegistry.collectorNames(CollectorRegistry.java:113)
              at io.prometheus.client.CollectorRegistry.register(CollectorRegistry.java:50)
              at org.jenkinsci.plugins.prometheus.service.DefaultPrometheusMetrics.<init>(DefaultPrometheusMetrics.java:32)
              at org.jenkinsci.plugins.prometheus.service.DefaultPrometheusMetrics$$FastClassByGuice$$ffffffffae01473e.GUICE$TRAMPOLINE(<generated>)
              at org.jenkinsci.plugins.prometheus.service.DefaultPrometheusMetrics$$FastClassByGuice$$ffffffffae01473e.apply(<generated>)
              at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:82)
              at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:114)
              at com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:33)
              at com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:98)
              at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:109)
              at hudson.ExtensionFinder$GuiceFinder$SezpozModule.onProvision(ExtensionFinder.java:610)
              at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:117)
              at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:66)
              at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:93)
              at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:300)
              at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:60)
              at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
              at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:169)
              at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45)
              at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:40)
              at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:60)
              at com.google.inject.internal.SingleMethodInjector.inject(SingleMethodInjector.java:84)
              at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:146)
              at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:124)
              at com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:33)
              at com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:98)
              at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:109)
              at hudson.ExtensionFinder$GuiceFinder$SezpozModule.onProvision(ExtensionFinder.java:610)
              at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:117)
              at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:66)
              at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:93)
              at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:300)
              at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
              at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:169)
              at hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1.get(ExtensionFinder.java:445)
              at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45)
              at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1148)
              at hudson.ExtensionFinder$GuiceFinder._find(ExtensionFinder.java:403)
              at hudson.ExtensionFinder$GuiceFinder.find(ExtensionFinder.java:394)
              at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:344)
              at hudson.ExtensionList.load(ExtensionList.java:384)
              at hudson.ExtensionList.ensureLoaded(ExtensionList.java:320)
              at hudson.ExtensionList.iterator(ExtensionList.java:172)
              at hudson.ExtensionList.get(ExtensionList.java:149)
              at jenkins.metrics.api.Metrics$HealthCheckMetricsProvider.getMetricSet(Metrics.java:360)
              at jenkins.metrics.api.MetricProviderListener.onChange(MetricProviderListener.java:91)
              at jenkins.metrics.api.MetricProviderListener.attach(MetricProviderListener.java:77)
              at jenkins.metrics.api.Metrics.afterExtensionsAugmented(Metrics.java:314)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.base/java.lang.reflect.Method.invoke(Method.java:568)
              at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:109)
              at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:185)
              at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:305)
              at jenkins.model.Jenkins$5.runTask(Jenkins.java:1170)
              at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:221)
              at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:120)
              at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
              at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
              at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
              at java.base/java.lang.Thread.run(Thread.java:840)
       

       

      2023-12-21 06:19:38.756+0000 [id=595]   WARNING o.j.p.p.DiskUsageCollector#collect: Failed to get disk usage data due to an unexpected error.
      java.lang.NullPointerException: Cannot invoke "java.lang.Long.longValue()" because the return value of "com.cloudbees.simplediskusage.DiskItem.getCount()" is null
              at org.jenkinsci.plugins.prometheus.collectors.disk.DiskUsageFileCountGauge.calculateMetric(DiskUsageFileCountGauge.java:35)
              at org.jenkinsci.plugins.prometheus.collectors.disk.DiskUsageFileCountGauge.calculateMetric(DiskUsageFileCountGauge.java:9)
              at org.jenkinsci.plugins.prometheus.DiskUsageCollector.lambda$collectDiskUsage$0(DiskUsageCollector.java:64)
              at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
              at org.jenkinsci.plugins.prometheus.DiskUsageCollector.lambda$collectDiskUsage$1(DiskUsageCollector.java:64)
              at java.base/java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:807)
              at org.jenkinsci.plugins.prometheus.DiskUsageCollector.collectDiskUsage(DiskUsageCollector.java:61)
              at org.jenkinsci.plugins.prometheus.DiskUsageCollector.collect(DiskUsageCollector.java:36)
              at io.prometheus.client.Collector.collect(Collector.java:45)
              at io.prometheus.client.CollectorRegistry$MetricFamilySamplesEnumeration.findNextElement(CollectorRegistry.java:204)
              at io.prometheus.client.CollectorRegistry$MetricFamilySamplesEnumeration.nextElement(CollectorRegistry.java:219)
              at io.prometheus.client.CollectorRegistry$MetricFamilySamplesEnumeration.nextElement(CollectorRegistry.java:152)
              at java.base/java.util.Enumeration$1.next(Enumeration.java:123)
              at org.jenkinsci.plugins.prometheus.config.disabledmetrics.FilteredMetricEnumeration.filterList(FilteredMetricEnumeration.java:18)
              at org.jenkinsci.plugins.prometheus.config.disabledmetrics.FilteredMetricEnumeration.<init>(FilteredMetricEnumeration.java:12)
              at org.jenkinsci.plugins.prometheus.service.DefaultPrometheusMetrics.collectMetrics(DefaultPrometheusMetrics.java:53)
              at org.jenkinsci.plugins.prometheus.service.PrometheusAsyncWorker.execute(PrometheusAsyncWorker.java:41)
              at hudson.model.AsyncPeriodicWork.lambda$doRun$0(AsyncPeriodicWork.java:102)
              at java.base/java.lang.Thread.run(Thread.java:840)
       

            Unassigned Unassigned
            swapnil_bharshankar swapnil
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: