last night I finally managed to upgrade to the OH3 from OH 2.5.
Most of things are working fine (or are waiting on me to fix them), but I believe I found a bug.
I am using this in a rule:
var Float outsideLight = (outsideLightSensor.averageSince(now.minusMinutes(15), "influxdb") as Number).floatValue`
And its throwing this error:
2020-12-27 12:22:21.436 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'LightTemperature-1' failed: error parsing query: found 48h, expected identifier at line 1, char 19 in LightTemperature
It seems like the command averageSince() is not respecting, that I am running InfluxDb v1.
I am missing something?
# The database URL, e.g. http://127.0.0.1:8086 or https://127.0.0.1:8084 .
# Defaults to: http://127.0.0.1:8086
# The name of the database user, e.g. openhab.
# Defaults to: openhab
# The password of the database user.
# The name of the database, e.g. openhab.
# Defaults to: openhab
2020-12-25 08:41:53.437 [ERROR] [ence.internal.PersistenceManagerImpl] - Exception occurred while querying persistence service ‘influxdb’: error parsing query: found DEFAULT, expected identifier at line 1, char 19
org.influxdb.InfluxDBException: error parsing query: found DEFAULT, expected identifier at line 1, char 19
DEFAULT is the retention policy…so what has changed?
I do nothing more than call the data from start up…not used in rules or channels
Similar issue here. I query influxDB from a rule and get this error here: [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'gas_meter-3' failed: error parsing query: found DEFAULT, expected identifier at line 1, char 19 in gas_meter
retentionPolicy in influxdb.cfg is set to default - this is intentional as this is the name of the default policy for the database (it was created before influxDB renamed the default retention policy to autogen).
Thank you so much, this did the trick for my upgrade from OH2.5.11 to OH3.1.
I suspect my influx database was created with some early influx version (around OH2.0), before it changed its default to autogen. It seems that the retention policy “default” is somehow banned by influxdb, as I could change to random names and it would work, just not with “default”.
After testing on a spare server, verifying with statements in the influx client:
Query SELECT "value"::field,"item"::tag FROM default.SomeOpenHABItem
and getting errors if the string “default” was indeed default, or if it did not match what I stated in -newrp in your command.
When ready, I stopped OH3, did drop database openhab_db in the influx client, then ran the influxd restore command, chnaged retention policy (to autogen) in /etc/openhab/service/influxdb.cfg and restarted OH3. Everything now works.