openhab-addons: [influxdb] FieldTypeConflictException: "..." is type integer, already exists as type float
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) [?:?]
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 29 (13 by maintainers)
On one of my OH instances I also ran into this issue with some
Switchitems. So I wrote a little Bash script to fix it for several items to prevent errors and tedious work ๐ :Just replace
Room1_Motionetc. with your own items that have this issue. Make sure you have a backup in case something goes wrong. ๐พ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:
have somebody wrote a script to do this automatic for all items?
I used this command for every thing that showed errors. there was many of them but now it is ok.
Indeed deleting is only from the CLI
So far so good ๐ But tell please for beginner where you write this? In which file? influxdb.persist?
I am facing this issue too. It seems the item switches and contacts are stored as float in OH2.5.x and integer in OH3.0.0Mx. I have to convert the items back and forth every time I go from one version to the other of OH.