Can't get InfluxDB Persistance on OH3

I’m running OH3.2.0 with influx 1.1.1 on a x64 Ubuntu system and using the InfluxDB Persistence 3.2.0.SNAPSHOT add-on.

I’m trying to view OH data in Grafana. My current settings were working in previously in OH2, but have sense stopping working in OH3.

In openhab.log I see various influx errors, all starting with:

A connection to http://127.0.0.1:8086/ was leaked. ...

My influxdb.cfg is set to default with all values commented out. I have the default setup, db lives on the same machine as OH, db name is openhab, user name is openhab. I’m able to connect to the database via Grafana, but no new data is being populated (although I see old data pre OH3). I’ve created a new database (with and without a password) as a test, but I receive similar errors. And no data being populated to new DB.

If I remove ‘restoreonstartup’ from the .persist file, my log goes crazy with slightly different errors:

2021-07-17 13:08:57.829 [WARN ] [rnal.influx2.InfluxDB2RepositoryImpl] - database not ready
2021-07-17 13:09:00.832 [ERROR] [.client.write.events.WriteErrorEvent] - The error occurred during writing of data
com.influxdb.exceptions.NotFoundException: null

Any ideas?? Been reading a testing for a few hours now, and this thing should work. What the hell? Any recommendations?

Well, got it working. Going thru the steps listed in: InfluxDB+Grafana persistence and graphing a couple things got me

  1. In editing the [http] section of /etc/influxdb/influxdb.conf, the heading [http] was commented out. This comment needed to be removed.
  2. influxdb.cfg needs to have a username and password setup (per the OH docs, this must be new in OH3, as I ran previously without it). This user needs to be setup in the Influx DB
  3. I enabled log:set DEBUG org.openhab.persistence.influxdb, and restarted OH. In the logs, I noticed user auth errors. Looks like dummy me forgot a pretty important step in granting the DB openhab user write privileges. Just needed to run this in the Influx CLI:
GRANT ALL ON openhab_db TO openhab

Restart OH, and was good to go. I sure made this a lot harder than it needed to be!

1 Like