NPE in chk_disk_free
Status: Abandoned
Brought to you by:
chrisgilbert
OS is Windows
There is no difference between using "ALL" and "D:"
[chk_disk_free_2029532] 17:27:06,608 ERROR [Check] run(): Exception occurred whilst running chk_disk_free check: java.lang.NullPointerException: Cannot invoke method toFloat() on null object
[chk_disk_free_2029532] 17:27:06,623 ERROR [Check] run(): STACK:java.lang.NullPointerException: Cannot invoke method toFloat() on null object
[chk_disk_free_2029532] 17:27:06,623 ERROR [Check] run(): A SERIOUS ERROR OCCURRED IN CHECK!
jvm 1 | java.lang.NullPointerException: Cannot invoke method toFloat() on nul
l object
jvm 1 | at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObjec
t.java:77)
jvm 1 | at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(P
ogoMetaClassSite.java:45)
jvm 1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCal
l(CallSiteArray.java:40)
jvm 1 | at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCa
llSite.java:32)
jvm 1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCal
l(CallSiteArray.java:40)
jvm 1 | at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(P
ogoMetaClassSite.java:54)
jvm 1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(Ab
stractCallSite.java:120)
jvm 1 | at uk.co.corelogic.npa.gatherers.OSGatherer.getDiskSpace(OSGathe
rer.groovy:310)
jvm 1 | at uk.co.corelogic.npa.gatherers.OSGatherer.this$3$getDiskSpace(
OSGatherer.groovy)
jvm 1 | at uk.co.corelogic.npa.gatherers.OSGatherer$this$3$getDiskSpace.
callCurrent(Unknown Source)
jvm 1 | at uk.co.corelogic.npa.gatherers.OSGatherer.OS_DISK_MB_FREE(OSGa
therer.groovy:547)
jvm 1 | at uk.co.corelogic.npa.gatherers.OSGatherer.this$3$OS_DISK_MB_FR
EE(OSGatherer.groovy)
jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Sourc
e)
jvm 1 | at java.lang.reflect.Method.invoke(Unknown Source)
jvm 1 | at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMeth
od.java:90)
jvm 1 | at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
jvm 1 | at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:105
8)
jvm 1 | at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886
)
jvm 1 | at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:708
)
jvm 1 | at uk.co.corelogic.npa.common.Gatherer.invokeMethod(Gatherer.gro
ovy)
jvm 1 | at uk.co.corelogic.npa.common.Gatherer$invokeMethod.callCurrent(
Unknown Source)
jvm 1 | at uk.co.corelogic.npa.common.Gatherer.sample(Gatherer.groovy:82
)
jvm 1 | at uk.co.corelogic.npa.common.Gatherer$sample.call(Unknown Sourc
e)
jvm 1 | at uk.co.corelogic.npa.checks.OSCheck.chkDiskFree(OSCheck.groovy
:165)
jvm 1 | at uk.co.corelogic.npa.checks.OSCheck$chkDiskFree.callCurrent(Un
known Source)
jvm 1 | at uk.co.corelogic.npa.checks.OSCheck.chk_disk_free(OSCheck.groo
vy:36)
jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Sourc
e)
jvm 1 | at java.lang.reflect.Method.invoke(Unknown Source)
jvm 1 | at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMeth
od.java:90)
jvm 1 | at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
jvm 1 | at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:105
8)
jvm 1 | at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886
)
jvm 1 | at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:699
)
jvm 1 | at uk.co.corelogic.npa.common.Check.invokeMethod(Check.groovy)
jvm 1 | at uk.co.corelogic.npa.common.Check$invokeMethod.callCurrent(Unk
nown Source)
jvm 1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCal
Just found the stacktrace:
lCurrent(CallSiteArray.java:44)
jvm 1 | at uk.co.corelogic.npa.common.Check$invokeMethod.callCurrent(Unk
nown Source)
jvm 1 | at uk.co.corelogic.npa.common.Check.run(Check.groovy:99)
jvm 1 | at java.util.TimerThread.mainLoop(Unknown Source)
jvm 1 | at java.util.TimerThread.run(Unknown Source)
Debug output is:
[chk_disk_free_5200629] 17:52:55,988 DEBUG [OSGatherer] OS_DISK_MB_FREE(): [:]
[chk_disk_free_5200629] 17:52:56,004 DEBUG [OSGatherer] OS_DISK_MB_FREE(): Running disk check on OS - D:
[chk_disk_free_5200629] 17:52:56,004 DEBUG [OSGatherer] getDiskSpace(): Detected OS type: Windows 2003
[chk_disk_free_5200629] 17:52:56,004 DEBUG [OSGatherer] getDiskSpace(): Running windows disk check.
[chk_disk_free_5200629] 17:52:56,020 DEBUG [OSGatherer] runCmd(): Running command: [cmd, /c, fsutil volume diskfree D:]
[chk_disk_free_5200629] 17:52:56,035 DEBUG [OSGatherer] runCmd(): Waiting for command to return...
[chk_disk_free_5200629] 17:52:56,051 DEBUG [OSGatherer] runCmd(): Stream: Gesamtanzahl an freien Bytes : 27177152512
Gesamtanzahl Bytes : 147819851776
Gesamtanz. verf?gbarer Bytes : 27177152512
[chk_disk_free_5200629] 17:52:56,051 DEBUG [OSGatherer] getDiskSpace(): [Gesamtanzahl an freien Bytes : 27177152512, Gesamtanzahl Bytes : 147819851776, Gesamtanz. verf?gbarer Bytes : 27177152512]
[chk_disk_free_5200629] 17:52:56,066 DEBUG [OSGatherer] getDiskSpace(): Windows disk avail output:[]
[chk_disk_free_5200629] 17:52:56,066 DEBUG [OSGatherer] getDiskSpace(): Windows disk total output:[]
[chk_disk_free_5200629] 17:52:56,066 ERROR [Check] run(): Exception occurred whilst running chk_disk_free check: java.lang.NullPointerException: Cannot invoke method toFloat() on null object
[chk_disk_free_5200629] 17:52:56,082 ERROR [Check] run(): STACK:java.lang.NullPointerException: Cannot invoke method toFloat() on null object
[chk_disk_free_5200629] 17:52:56,145 ERROR [Check] run(): A SERIOUS ERROR OCCURRED IN CHECK!
Yeah, it it this line:
def free = output.find{ it =~ /avail free bytes/ }
This only works on English installations. A German installation will print
C:\npa\bin>fsutil volume diskfree d:
Gesamtanzahl an freien Bytes : 27177152512
Gesamtanzahl Bytes : 147819851776
Gesamtanz. verfügbarer Bytes : 27177152512
Thanks for your feedback Kurt. I'll see what I can do about making it work properly on other languages. Do you have issues with any of the other checks too, or just the disk space one - i.e. do cpu, memory and so on run correctly?
It is just the disk check; the rest works fine, besides the HD temperature, but this might have other reasons.
is there a solution for this problem?