What does this query error mean ? and Why?

Hey Bob,

I use Node Red to run a query against one of my IOTAWatts - as such

http://172.16.101.200/query?select=[Solar,Consumption,Grid]&begin=s-300s&end=s&group=all&format=json&header=no

I run this query every minute - using an inject node on Node Red

This runs fine 99.99 of the time - i note sometimes that i will be returned an error - and this gets interpreted by Node Red as

image

image

The system then recovers and continues on as can be seen below when the next query is done 1 minute later

image

Is this to be expected that sometimes a query will fail - or should i start digging through the logs on IOTAWATT ?

Craig

I doubt you will find anything in the message log, but easy enough to check. You have a timestamp from nodered.

It looks as if the message is generated by nodered because it can’t parse the response as json. That probably means something went wrong with the query transaction, but it’s not obvious that it’s the IoTaWatt per-se, could be a communication issue. I don’t know enough about nodered to say.

What would be helpful is the response that is causing the parse error. I suspect it’s not Json as it says it’s at column 0, which would be a ‘[’ in this case. If it happened more frequently, I’d recommend using wireshark, but it sounds like it only happens every few hours, so that’s a lot to capture with the shark.

That’s not the typical private IP range, so is there any kind of routing going on that could be introducing erroneous responses like 300’s or 400’s?

Thanks for the quick response Bob,

Yes that is my home network range (i do networking for living) - the IOTAWATT, Wireless Router and Node-Red all exist on that subnet (which is a VLAN) - so no there is nothing else in the middle - it is only for IOT devices so is not heavily used.

I have put a debug node before the JSON conversion on the HTTP node in NR - when i get the next error i will grab the output and let you know.

I was sitting here and watching it this morning and the error actually happens about once every 20 minutes or so

WIll monitor and advise back

Craig

1 Like

Bob,

Here we go - here is one now

image

This is essentailly the raw output that is received back by the HTTP node after the request is sent

Craig

Doesn’t look at all familiar. The URL part appears valid, but the "Error: Parse Error : … is nothing I recognize. The only way that could be coming from the IoTaWatt is if it is being generated by the webserver code, but I’ve never seen it over years working with that webserver component. Sorry, I can’t help here.

Hmm,

OK guess i will live with it and just put some error check to redo the query if i do not code a response code of 200 back

Craig