-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[influxdb] FieldTypeConflictException: "..." is type integer, already exists as type float #9037
Comments
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:
|
Try updating to M2 or a recent snapshot build so you get the fix for #8798. |
I'm on M2 already. I'm avoiding going to the snapshots at the moment as I believe they had issues with the rules DSL not working properly. |
OK then you should have the fix and there is no need to go to snapshots. The DSL issues are also fixed in build # 2010. I don't know if you've used the initial version of the OH3 influxdb add-on? If so, it may have resulted in unrecoverable issues, see #8831:
|
This was a fresh install of OH3 at 3.0.0M2. I opted to create a new VM for my OH3 instead of trying to upgrade from anything. I started at M2. The influxdb was migrated from OH2. |
Hey, I today upgraded from OH2.5 to 3.0. And I'm getting this influxdb errors. Can You explain me how to repair this? |
I'm also experiencing this issue after upgrading from openHAB 2.5.10 to openHAB 3.0 M2.
and that seems to work fine. |
I used this command for every thing that showed errors. there was many of them but now it is ok.
|
I am facing this issue too. |
same here |
have somebody wrote a script to do this automatic for all items? |
On one of my OH instances I also ran into this issue with some #!/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 |
So far so good :) But tell please for beginner where you write this? In which file? influxdb.persist? |
This is BASH script. Read on Google what is this. |
I had the exact same problem on my windows installation. In case anyone needs the powershell script - feel free.
If you feel good with it - remove the readhost in the loop :-) But it would really be nice, if we had a better upgrade path from 2.x to 3.x OH with influxdb here. Maybe integrate a kind of update routine in the installation/ update? |
Here is a description on how to produce a copy-paste list of items needing fixing. (Linux) |
For people in a InfluxDB2 context:
Drop the bucket
Drop the bucket |
I tried to fix influxDB using the bash script from wborn above. But it didn't work well. I have about 100 affected items. I had the following issues:
I've no idea why influxdb consumes so much memory. So my only option seems to be to drop my database and recreate it. :-( I assume, that I'm not the only one affected by this problem. I'd appreciate if there were be some kind of workaround implemented in openhab, enabling openhab to work with both: floats and integers |
Note for Ubuntu users. When you run wborn's script use:
Otherwise Ubuntu will run dash shell by default and you will get a redirection error. See https://stackoverflow.com/questions/2462317/bash-syntax-error-redirection-unexpected Also, in addition to adding your specific measurement names at the top of the script, check that the DB name is correct in the 'influx' line. Mine was 'openhab_db' rather than 'openhab'. To find the Influx DB name for your openHAB instance, start a influx shell and run a query as below:
|
This issue has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/rules-and-persistence-error/117060/4 |
This issue has been mentioned on openHAB Community. There might be relevant details there: |
The issue still exists in openhab 3.1. |
This issue happens if you create a blank complete new database. |
Same here, migrating from openHAB 2.5 to 3.1 and discovering this bug.
Thanks, but this doesn't yet work for me on InfluxDB 2.0.8 My query:
Result:
|
@stefan-muc you have to replace the values of "temp" bucket must be created before the query is executed. |
Yeah sure!
Yes, I figured that out. So the steps are:
So the only question left for me is: How do I do 3. drop a measurement? Didn't yet find that in UI. |
Still didn't find it in UI, but found a CLI line for that:
|
Indeed deleting is only from the CLI |
Would it make sense to check persistence settings in such cases to avoid this type of regressions in the future? In this case, it's about Contact and Switch. |
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.
The text was updated successfully, but these errors were encountered: