Quantcast
Channel: THWACK: All Content - Orion SDK
Viewing all articles
Browse latest Browse all 2677

Please accept and fix this bug: API accepts null values when it should not

$
0
0

I have code that sets node and interface properties like stat collection and polling intervals.

 

When the script was run last Friday, everything seemed fine, but today I noticed our polling engine percent utilization went from 86% to 13%, so I started investigating.

 

Once I found the correct log, collector.Service.log, I was seeing PolllingPlan process failed Solarwind.Intefaces.SNMP Data is null and the stack trace.

 

I stated looking at the polling tables and other various tables to see what might be null and I couldn't find anything. After a few hours I decided to take the DLL's with similar names and reverse engineer what the SQL query was. I could have also used SQL profiler, but there is so much activity, I think it would have been harder.

 

I finally found in the SolarWinds.Interfaces.Collector DLL, the method for GetStatusPollingDescriptions and the data reader for the InterfacesDAL.

 

I believe these lines in the code are throwing the exception:

@interface.PollInterval = reader.IsDBNull(ordinal4) ? 120 : reader.GetInt32(ordinal4);

@interface.PollInterval = reader.IsDBNull(ordinal4) ? 120 : reader.GetInt32(ordinal4);

 

A check for null is performed on the result, but the schema doesn't allow it to be null; when the reader.GetInt32(ordinal4) is called an exception is thrown.

 

IMO, I think the API should have returned a bad request or some other error if the value isn't supported in the schema.

 

Regards,

 

Daniel


Viewing all articles
Browse latest Browse all 2677

Trending Articles