tkurki / signalk-to-influxdb2

Apache License 2.0
6 stars 4 forks source link

No data is written in case a path changes type #18

Open htool opened 1 year ago

htool commented 1 year ago

This is coming from someone usng the VHFinfo plugin. In the plugin I changed a type at some point. Not he gets:

Jun 02 22:59:27 ERROR: Write to InfluxDB failed. m [HttpError]: failure writing points to database: partial write: field type conflict: input field "value" on measurement "vhfdata.nearest.vts.channel" is type string, already exists as type float dropped=10 at IncomingMessage.<anonymous> (/home/pi/.signalk/node_modules/@influxdata/influxdb-client/dist/index.js:5:5671) at IncomingMessage.emit (node:events:525:35) at endReadableNT (node:internal/streams/readable:1358:12) at processTicksAndRejections (node:internal/process/task_queues:83:21) { statusCode: 422, statusMessage: 'Unprocessable Entity', body: '{"code":"unprocessable entity","message":"failure writing points to database: partial write: field type conflict: input field \\"value\\" on measurement \\"vhfdata.nearest.vts.channel\\" is type string, already exists as type float dropped=10"}', contentType: 'application/json; charset=utf-8', json: { code: 'unprocessable entity', message: 'failure writing points to database: partial write: field type conflict: input field "value" on measurement "vhfdata.nearest.vts.channel" is type string, already exists as type float dropped=10' }, code: 'unprocessable entity', _retryAfter: 0 }

He'd be happy to ignore this path, but the plugin doesn't support that. Another option could be to drop the previously stored data?

tkurki commented 1 year ago

I have yet to address this issue. Haven't bumped into it myself, but people have reported it.

I see a few options:

As i haven't dug into this deeper I can't offer advice on how to get rid of the offending data already in the db.

htool commented 1 year ago

That would be the simplest and serves as a workaround for now.