SignalK / signalk-derived-data

Generates deltas for values derived from signalk values
Apache License 2.0
18 stars 31 forks source link

`navigation.courseGreatCircle.nextPoint.bearingMagnetic` is occasionally output as a stringified number #137

Open mairas opened 3 months ago

mairas commented 3 months ago

Earlier today, I enabled some additional outputs in derived-data. I was now checking the SK server logs, and found the following:

ERROR: Write to InfluxDB failed. m [HttpError]: failure writing points to database: partial write: field type conflict: input field "value" on measurement "navigation.courseGreatCircle.nextPoint.bearingMagnetic" is type float, already exists as type string dropped=16
    at IncomingMessage.<anonymous> (/home/pi/.signalk/node_modules/@influxdata/influxdb-client/dist/index.js:5:5671)
    at IncomingMessage.emit (node:events:526:35)
    at endReadableNT (node:internal/streams/readable:1359:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82: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 \\"navigation.courseGreatCircle.nextPoint.bearingMagnetic\\" is type float, already exists as type string dropped=16"}',
  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 "navigation.courseGreatCircle.nextPoint.bearingMagnetic" is type float, already exists as type string dropped=16'
  },
  code: 'unprocessable entity',
  _retryAfter: 0
}

I checked the existing data in InfluxDB2 for that path and found the following:

Screenshot 2024-07-23 at 20 12 09

So, it seems the path is occasionally written as a float number cast to string.

mairas commented 3 months ago

I have one data source providing navigation.magneticVariation with a null value. I'm about to deprioritize it, but maybe that is the cause?