question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[influxdb] FieldTypeConflictException: "..." is type integer, already exists as type float

See original GitHub issue

As part of migrating to OH3 I’ve added my influxdb persistence. For some reason, I’m now getting this error. I get this across multiple items, not just the one below. I could just purge these values from the database and let it create new as a workaround, but I’d rather not lose the historical data. Not sure why it’s writing as an integer now and not a float as before.

2020-11-14 20:32:37.956 [ERROR] [org.influxdb.impl.BatchProcessor    ] - Batch could not be sent. Data will be lost
org.influxdb.InfluxDBException$FieldTypeConflictException: partial write: field type conflict: input field "value" on measurement "ZWave_DownstairsHallwayMotionSensor_BinarySensor" is type integer, already exists as type float dropped=1
        at org.influxdb.InfluxDBException.buildExceptionFromErrorMessage(InfluxDBException.java:144) ~[bundleFile:?]
        at org.influxdb.InfluxDBException.buildExceptionForErrorState(InfluxDBException.java:173) ~[bundleFile:?]
        at org.influxdb.impl.InfluxDBImpl.execute(InfluxDBImpl.java:827) ~[bundleFile:?]
        at org.influxdb.impl.InfluxDBImpl.write(InfluxDBImpl.java:460) ~[bundleFile:?]
        at org.influxdb.impl.OneShotBatchWriter.write(OneShotBatchWriter.java:22) ~[bundleFile:?]
        at org.influxdb.impl.BatchProcessor.write(BatchProcessor.java:340) [bundleFile:?]
        at org.influxdb.impl.BatchProcessor$1.run(BatchProcessor.java:287) [bundleFile:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:834) [?:?]

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:28 (12 by maintainers)

github_iconTop GitHub Comments

14reactions
wborncommented, Dec 22, 2020

On one of my OH instances I also ran into this issue with some Switch items. So I wrote a little Bash script to fix it for several items to prevent errors and tedious work 😉 :

#!/bin/bash

MEASUREMENTS=$(cat << EOF
Room1_Motion
Room2_Motion
Room3_Motion
EOF
)

command="SELECT value::integer INTO temp FROM measurement; DROP MEASUREMENT measurement; SELECT value::integer INTO measurement FROM temp; DROP MEASUREMENT temp;"

for m in $MEASUREMENTS; do
	echo "Updating $m..."
	influx -database 'openhab' -execute "$(sed "s#measurement#$m#g" <<< $command)"
done

Just replace Room1_Motion etc. with your own items that have this issue. Make sure you have a backup in case something goes wrong. 💾

3reactions
fwoltercommented, Nov 15, 2020

I must admit, I encountered the same problem and worked around it, instead of raising an issue. I changed the type of my historic data to integer by storing it to a temporary measurement:

select value::integer into Flur_Bell_Lock2 from Flur_Bell_Lock
drop measurement Flur_Bell_Lock
select value::integer into Flur_Bell_Lock from Flur_Bell_Lock2
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to solve type conflicts - InfluxDB 2
Hi, I'm using the influxdb-php lib to read from and write to influx. ... on measurement "temp" is type integer, already exists as...
Read more >
InfluxDB Error "field type conflict: input field value on ...
InfluxDB Error "field type conflict: input field value on measurement is type integer, already exists as type float dropped=1".
Read more >
influxdb insert error: type float, already exists as type integer ...
As described in the influxdb 1.8 docs, changing a field type is complicated. A ridiculously simple solution is to just change its name...
Read more >
When ThingWorx Platform is using InfluxDB ... - PTC
InfluxDBException$FieldTypeConflictException: partial write: field ... Pump1" is type integer, already exists as type float dropped=1 at ...
Read more >
Influxdb 2.0 Error Data Type - General - Node-RED Forum
... to database: partial write: field type conflict: input field "ITE06_H" on measurement "ITE06" is type integer, already exists as type float dropped=1"}....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found