mblackstock / node-red-contrib-influxdb

Node-RED nodes to save and query data from an influxdb time series database
Other
64 stars 46 forks source link

Missing payload properties caused "unable to parse" error #89

Closed 877dev closed 3 years ago

877dev commented 3 years ago

Influxdb 1.8.4 Docker image running on Pi 4 node-red-contrib-influxdb node version 0.5.4 Node Red v1.2.6

When deploying, I'm getting influxdb "unable to parse" errors in debug. Only happens after the initial deploy, I believe this is due to the retained mqtt message not containing the full payload. In this case msg.payload.linkquality is missing from the mqtt payload, not sure why this is the case.

image image

Sample flow attached showing how the missing msg.payload.linkquality causes the output to be "undefined". image flow.txt

mblackstock commented 3 years ago

I'm not sure I understand what the bug is that you are reporting. Is it a bug in your flow, or the influxdb node?

At first glance I can see that in some cases, the field is called linkQuality and in the debug flow it looks like it is linkquality (lower case Q). If linkQuality is a boolean in influxdb then indeed, setting it to undefined will throw an error.

Anyway, I don't see a problem with the influxdb node.