Influxdb error

Hello everyone,

I’ve changed one of my switch to a dimmer. Because of that, one of the value switched from integer to float and now, influxdb is throwing error

[] - The error occurred during writing of data
com.influxdb.exceptions.UnprocessableEntityException: failure writing points to database: partial write: field type conflict: input field “value” on measurement “Lumiere_Atelier” is type float, already exists as type integer dropped=6

How do I fix this?

THank you

Drop the data in InfluxDB :slight_smile: (how to achieve this depends highly on the version of InfluxDB)

I’m in v2. Got no clue how to do this without losing all other data.

well, v2 is a tough one :slight_smile: but it’s not THAT hard, if you know what to do…

First step: You’ll need a token to login, best practice is to create one for the job (you’ve done it once before for openHAB… InfluxDB-Web UI…)

second step: As I have to delete some errors in some specific Items on a regular basis :wink: I’ve written a very basic shell script:

#! /bin/bash

TOKEN="<insert the complete token here>"
ORG="<your company>"
BUCKET="<bucket name>"

influx delete --bucket $BUCKET --predicate '_measurement="<name of the Item>"' --start $START --stop $STOP --org $ORG --token $TOKEN

with the given START and STOP only the values from Nov 27th, 2023 will be erased.
If you want to delete a measurement completely, omit --start and --stop parameter.

Please be aware that <> are only to indicate that text inbetween is a variable.

Thank you!