InfluxDB problems after installation of "system info" binding

One week ago I updated to OH3.2 with a full installation by scratch. Setting up InfluxDB and Grafana, everything worked fine. After installation of “system info” binding, I didn’t have access to Grafana UI anymore. Thankfully I could resolve this issue by great support of this community (Grafana Web UI not accessible after installation of system info binding).

Now, since Grafana is working again, I encountered that there seem to be connection issues to influxDB. Current situation:

-Testing influxDB in Grafana UI (“test and save”) results in the message “InfluxDB Error: error authorizing query: create admin user first or disable authentication”. This is strange for me, since the user and password were set up and just worked before installing the “system info” binding.

-In the OH log, there’s the message “2022-02-16 10:40:00.035 [ERROR] [org.influxdb.impl.BatchProcessor ] - Batch could not be sent. Data will be lost” and
“org.influxdb.InfluxDBException$DatabaseNotFoundException: database not found: “openhab””

-Commandline apparently confirms problem with non-existing admin user:
openhabian@openhabian:~ $ journalctl -u influxdb
Feb 15 17:41:01 openhabian influxd-systemd-start.sh[849]: ts=2022-02-15T16:41:01.814120Z lvl=info msg=“Error authorizing query” log_id=0ZgZt9uW000 service=httpd error=“create admin user first or disable authentication”

Following the advices in the thread mentioned upwards, I received some more details, but couldn’t eliminate the problem.

-influxd seems to listen to ports 8086/8088.
openhabian@openhabian:~ $ sudo netstat -tulpn | grep influx
tcp 0 0 127.0.0.1:8086 0.0.0.0:* LISTEN 3912/influxd
tcp 0 0 127.0.0.1:8088 0.0.0.0:* LISTEN 3912/influxd

-Owner rights are at influxdb, so this also seems to be OK.
openhabian@openhabian:~ $ ls -ld /var/lib/influxdb/ /var/lib/influxdb/*
drwxr-xr-x 1 influxdb influxdb 4096 Feb 15 17:39 /var/lib/influxdb/
drwxr-xr-x 2 influxdb influxdb 4096 Feb 12 23:31 /var/lib/influxdb/data
-rw-r–r-- 1 influxdb influxdb 4 Feb 15 17:39 /var/lib/influxdb/influxd.pid
drwxr-xr-x 1 influxdb influxdb 4096 Feb 15 21:52 /var/lib/influxdb/meta

-I’ve also followed a recommendation in OH 3.1.0 InfluxDB stopped working after update to 1.8.7-1 without success.
openhabian@openhabian:~ $ sudo chmod +x /usr/lib/influxdb/scripts/influxd-systemd-start.sh
openhabian@openhabian:~ $ sudo systemctl restart influxdb.service

I have the impression, that by the “system info” binding the influxdb users, rights and/or settings which I defined perviously in the openhabian-config (Users: admin, grafana, openhab) were changed somehow, since I neither get access by openhab (log) nor by Grafana GUI…

Any hint how I can get back access to the previous influxDB database with the users? (I definitely did not change them by myself…).

Thank you all in advance,
MC

Are you able to connect to your influxdb using the influx client software e.g.
Enter

influx

Connected to http://localhost:8086 version 1.8.10
InfluxDB shell version: 1.8.10

Enter

auth

Anser question for username / password according to what you have setup:

username: admin
password: 

Enter

show databases

It will show the available databases:

name: databases
name
----
 openhab

Based on the erorr message you get in the logs I assume that for whatever reason your admin user is lost and needs to be setup again.
DB definition and user accounts are stored in /var/lib/influxdb/meta/meta.db . It is a binary file that you can inspect with the strings command but you cannot edit the file.

1 Like

Dear @Wolfgang_S,

thank you again for your quick response. Yes, it seems that the users and/or maybe also the database is lost. Following the commends you sent, I get these prompts:

openhabian@openhabian:~ $ influx
Connected to http://localhost:8086 version 1.8.10
InfluxDB shell version: 1.8.10

auth
username: admin
password:
show databases
ERR: error authorizing query: create admin user first or disable authentication
Warning: It is possible this error is due to not setting a database.
Please set a database with the command "use ".

(same prompt also appears on “show users”)

Using the strings command, there’s no output. But using nano I can see some binary entry in /var/lib/influxdb/meta/meta.db

Here I get

strings /var/lib/influxdb/meta/meta.db 

openhab
autogen
autogen
admin
<$2a$10$3WXWQReauByPyn0X9OykGe12345nprEcXvo6Z8wzubVJsCqBYj5y.
openhab
<$2a$10$3J9gmz5varoVO.7BJwLn7e74fTF612345tjiB4FT5liudv5bgMHim
openhab
grafana
<$2a$10$JquUbTvIQximHfYhZjmpkexClGwjZ9Z12345wXYbC0BFosyYmwNJe
openhab

Either reinstall influxdb ( doing a complete deletion of all configuration data which will delete also /var/lib/influxdb content ) or try to fix it by creating an admin user in the influx client.

1 Like

Yes, I just get a blank line…
openhabian@openhabian:~ $ strings /var/lib/influxdb/meta/meta.db
openhabian@openhabian:~ $

OK, will try to create an admin user first. If this doesn’t work, I have to re-install… :frowning:

Thank you again for your great support!

Halleluja! System is now working! And installing influxdb and Grafana by openhabian-config over the previous version did NOT delete the previously generated charts, just only the data of one week! :smile: ley:

1 Like