InfluxDB+Grafana persistence and graphing

As far as I understand your description you changed the admin username in Grafana ( which is the client ).
You need to use the same username/password also in the server part which is influxdb that is accessed by the client.

Can you please help me on how I do that? in the ./etc/influxdb/influxdb.conf file I cannot find a username and password setting…

I found the correct config file, it is lying at ./etc/openhab/services/influxdb.cfg. However the problem persists, log files now look different tough…it says create admin user first…but how?

I actually realised that there is a setting in the Openhab web UI where the user is also administered (see screenshot). I have the same settings there as well. BTW, when I change this setting it is NOT going to get written into the ./etc/openhab/services/influxdb.cfg. Should not this not be the server-side setting?

Openhab Log stream:

2022-01-06 20:36:37.085 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Time zone set to 'Europe/Vienna'.
2022-01-06 20:36:37.120 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Location set to '48.307193812638864,16.565958559513096'.
2022-01-06 20:36:37.122 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Locale set to 'de_AT'.
2022-01-06 20:36:43.588 [WARN ] [org.openhab.core.net.NetUtil        ] - Could not find broadcast address of primary IP, using broadcast address null of first interface instead
2022-01-06 20:36:50.093 [INFO ] [.core.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
2022-01-06 20:36:53.383 [INFO ] [org.openhab.ui.internal.UIService   ] - Started UI on port 8080
2022-01-06 20:36:56.766 [INFO ] [ab.ui.habpanel.internal.HABPanelTile] - Started HABPanel at /habpanel
2022-01-06 20:36:57.453 [INFO ] [e.automation.internal.RuleEngineImpl] - Rule engine started.
2022-01-06 20:36:59.220 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'QueryablePersistenceService.query()' on 'org.openhab.persistence.influxdb.InfluxDBPersistenceService@1f1f299': error authorizing query: create admin user first or disable authentication
org.influxdb.InfluxDBException: error authorizing query: create admin user first or disable authentication

the journal looks pretty much the same:

 -- Journal begins at Wed 2022-01-05 15:45:02 CET, ends at Thu 2022-01-06 20:47:51 CET. --

Jan 06 20:36:11 openhabian systemd[1]: Starting InfluxDB is an open-source, distributed, time series database...

Jan 06 20:36:17 openhabian influxd-systemd-start.sh[862]: Merging with configuration at: /etc/influxdb/influxdb.conf

Jan 06 20:36:17 openhabian influxd-systemd-start.sh[859]: ts=2022-01-06T19:36:17.917287Z lvl=info msg="InfluxDB starting" log_id=0YtE6v~G000 version=1.8.10 branch=1.8 commit=688e697c51fd

Jan 06 20:36:17 openhabian influxd-systemd-start.sh[859]: ts=2022-01-06T19:36:17.917359Z lvl=info msg="Go runtime" log_id=0YtE6v~G000 version=go1.13.8 maxprocs=4

Jan 06 20:36:18 openhabian influxd-systemd-start.sh[994]: Merging with configuration at: /etc/influxdb/influxdb.conf

Jan 06 20:36:18 openhabian influxd-systemd-start.sh[859]: ts=2022-01-06T19:36:18.123688Z lvl=info msg="Using data dir" log_id=0YtE6v~G000 service=store path=/var/lib/influxdb/data

Jan 06 20:36:18 openhabian influxd-systemd-start.sh[859]: ts=2022-01-06T19:36:18.124045Z lvl=info msg="Compaction settings" log_id=0YtE6v~G000 service=store max_concurrent_compactions=2 throughput_bytes_per_second=50331648 throughput_bytes_per_second_burst=50331648

Jan 06 20:36:18 openhabian influxd-systemd-start.sh[859]: ts=2022-01-06T19:36:18.124111Z lvl=info msg="Open store (start)" log_id=0YtE6v~G000 service=store trace_id=0YtE6wo0000 op_name=tsdb_open op_event=start

Jan 06 20:36:18 openhabian influxd-systemd-start.sh[859]: ts=2022-01-06T19:36:18.124236Z lvl=info msg="Open store (end)" log_id=0YtE6v~G000 service=store trace_id=0YtE6wo0000 op_name=tsdb_open op_event=end op_elapsed=0.129ms

Jan 06 20:36:18 openhabian influxd-systemd-start.sh[859]: ts=2022-01-06T19:36:18.162712Z lvl=info msg="Opened service" log_id=0YtE6v~G000 service=subscriber

Jan 06 20:36:18 openhabian influxd-systemd-start.sh[859]: ts=2022-01-06T19:36:18.162777Z lvl=info msg="Starting monitor service" log_id=0YtE6v~G000 service=monitor

Jan 06 20:36:18 openhabian influxd-systemd-start.sh[859]: ts=2022-01-06T19:36:18.162798Z lvl=info msg="Registered diagnostics client" log_id=0YtE6v~G000 service=monitor name=build

Jan 06 20:36:18 openhabian influxd-systemd-start.sh[859]: ts=2022-01-06T19:36:18.162815Z lvl=info msg="Registered diagnostics client" log_id=0YtE6v~G000 service=monitor name=runtime

Jan 06 20:36:18 openhabian influxd-systemd-start.sh[859]: ts=2022-01-06T19:36:18.162830Z lvl=info msg="Registered diagnostics client" log_id=0YtE6v~G000 service=monitor name=network

Jan 06 20:36:18 openhabian influxd-systemd-start.sh[859]: ts=2022-01-06T19:36:18.162853Z lvl=info msg="Registered diagnostics client" log_id=0YtE6v~G000 service=monitor name=system

Jan 06 20:36:18 openhabian influxd-systemd-start.sh[859]: ts=2022-01-06T19:36:18.162884Z lvl=info msg="Starting precreation service" log_id=0YtE6v~G000 service=shard-precreation check_interval=10m advance_period=30m

Jan 06 20:36:18 openhabian influxd-systemd-start.sh[859]: ts=2022-01-06T19:36:18.190002Z lvl=info msg="Starting snapshot service" log_id=0YtE6v~G000 service=snapshot

Jan 06 20:36:18 openhabian influxd-systemd-start.sh[859]: ts=2022-01-06T19:36:18.224870Z lvl=info msg="Starting continuous query service" log_id=0YtE6v~G000 service=continuous_querier

Jan 06 20:36:18 openhabian influxd-systemd-start.sh[859]: ts=2022-01-06T19:36:18.251422Z lvl=info msg="Starting HTTP service" log_id=0YtE6v~G000 service=httpd authentication=true

Jan 06 20:36:18 openhabian influxd-systemd-start.sh[859]: ts=2022-01-06T19:36:18.251593Z lvl=info msg="opened HTTP access log" log_id=0YtE6v~G000 service=httpd path=stderr

Jan 06 20:36:18 openhabian influxd-systemd-start.sh[859]: ts=2022-01-06T19:36:18.251621Z lvl=info msg="Auth is enabled but shared-secret is blank. BearerAuthentication is disabled." log_id=0YtE6v~G000 service=httpd

Jan 06 20:36:18 openhabian influxd-systemd-start.sh[856]: InfluxDB API unavailable after 1 attempts...

Jan 06 20:36:18 openhabian influxd-systemd-start.sh[859]: ts=2022-01-06T19:36:18.573369Z lvl=info msg="Listening on HTTP" log_id=0YtE6v~G000 service=httpd addr=127.0.0.1:8086 https=false

Jan 06 20:36:18 openhabian influxd-systemd-start.sh[859]: ts=2022-01-06T19:36:18.573460Z lvl=info msg="Starting retention policy enforcement service" log_id=0YtE6v~G000 service=retention check_interval=30m

Jan 06 20:36:18 openhabian influxd-systemd-start.sh[859]: ts=2022-01-06T19:36:18.573806Z lvl=info msg="Listening for signals" log_id=0YtE6v~G000

Jan 06 20:36:18 openhabian influxd-systemd-start.sh[859]: ts=2022-01-06T19:36:18.573786Z lvl=info msg="Sending usage statistics to usage.influxdata.com" log_id=0YtE6v~G000

Jan 06 20:36:19 openhabian influxd-systemd-start.sh[859]: [httpd] 127.0.0.1 - - [06/Jan/2022:20:36:19 +0100] "GET /health HTTP/1.1" 200 107 "-" "curl/7.74.0" ebfddf01-6f27-11ec-8001-e45f01610c46 38105

Jan 06 20:36:19 openhabian influxd-systemd-start.sh[856]: InfluxDB started

Jan 06 20:36:19 openhabian systemd[1]: Started InfluxDB is an open-source, distributed, time series database.

Jan 06 20:36:59 openhabian influxd-systemd-start.sh[859]: [httpd] 127.0.0.1 - AlexollonAdmin [06/Jan/2022:20:36:59 +0100] "GET /ping HTTP/1.1" 204 0 "-" "okhttp/3.14.9" 038f5f6a-6f28-11ec-8002-e45f01610c46 63

Jan 06 20:36:59 openhabian influxd-systemd-start.sh[859]: ts=2022-01-06T19:36:59.209731Z lvl=info msg="Error authorizing query" log_id=0YtE6v~G000 service=httpd error="create admin user first or disable authentication"

That as far as I understand is the user that accesses the influxdb.

The user defined in the web UI resp. influxdb.cfg file is the user that will be used as admin user to create the influxdb and also to access the database and store values.

Did you just rename it in Grafana or also in the openhab configuration ?
At what time ? Assumed that you initially used user_a and changed it to user_b later but the influxdb already was created it seem to contain user_a.
Do a sudo

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

Among other entries that should show the list of users that once were created.

You may have two options ( choose either 1 or 2 ) to try:

  1. a) reinstall influxdb
    b) reconfigure influxdb ( created db and create (admin) user, grafana user )
  2. a) change the influxdb configuration to not use authentication;
    b) restart influxdb service
    c) then use influx client to access the influxdb ;
    d) examine the users that are stored in the db;
    e) change the users settings like remove obsolete user;
    f) add an admin account;
    g) add the related passsword;
    h) enable authentication again

Thx Wolfgang for your help!

actually this meta.db file does not hold any relevant information. it is only 20 bytes long.

openhabian@openhabian:~ $ sudo strings /var/lib/influxdb/meta/meta.db
openhabian@openhabian:~ $ la strings /var/lib/influxdb/meta/meta.db
ls: cannot access 'strings': No such file or directory
-rw-r--r-- 1 influxdb influxdb 20 Jan  6 21:20 /var/lib/influxdb/meta/meta.db
openhabian@openhabian:~ $ 

to your proposals how to solve the issue - first of all a BIG THANK YOU for your efforts!
ad 1) that would mean I would loose the data collected so far and the grafana dashboard I created. not a big drama, but not what I really want.
ad 2) sounds like a logical way. however, I dont know how to do that exactly.

I played a little bit around: the file

./etc/openhab/services/influxdb.cfg

data is shown in the UI (see screenshot). However, what does not work is to edit the settings there - actually you can do that in the UI but the data is not written to the config file (also not after restart of openhab an edited change is accepted).

Actually there are 3 users:
.) the InfluxDB admin user to setup the DB,etc
.) the Openhab user that accesses the influxDB = that is the one in the UI shown and from this one we know where it is stored (./etc/openhab/services/influxdb.cfg)
.) the Grafana user that accesses the influxDB
For the first and last I dont know where to find them.
I also dont know which one is actually causing the problem, I was thinking of the second one. There is no other config file in the same directory. I searched several locations for Grafana, like

/etc/grafana/provisioning

but no config file found that holds the authentication data for Grafana…but that is anyway a second order problem, first InfluxDB has to work with Openhab again…

There is a script here written by Christoph Wempe that I’ve used in the past to migrate data from a 2.4 system into InfluxDB. I’ve not tested it in a 3.2 system but thought it could possibly be useful.

1 Like

Let’s do one step back. I think there is some information missing to fully understand the probelm.
a) is this a fresh OH3 instance ?
b) was it migrated from OH2 ?
c) were does the existing data come from ?
d) you started to collect data but in between you changed the admin account configuration in Grafana ?

Hi Wolfgang,

to your q:
a) yes, fresh instance.
b) no data migrated. and yes, I can reinstall influxdb if needed, but I would rather want to understand the problem better before I do that.
c) I dont know exactly what you mean with “existing data”? if you mean sensor data: it comes from HUE bridge with some motion sensors as well as from Netatmo devices. This works all fine. I can see the devices online and showing instant values. what does not work is showing historic data - but obviously as the writing to the influxDB does not work (and persistence is set to influxDB).
d) actually I thought everything is fine when I did the initial configuration. I am a little bit a “strict follower of my own rules” and I made a “mistake” when I installed the influxDB that I wanted to correct “in operation in the Grafana web app”. That was the only change I did after the installation when everything was working perfectly and the first restart of the Raspi when Grafana/InfluxDB stopped working. Obviously a very stupid mistake. But nevertheless, I would want to understand what is wrong and how to correct it without reinstalling influxDB/Grafana.

Sure, that’s the way how learning works.
From that what I understand my conclusion would be that the admin user never has been created.
Let’s try to check:

  • turn off authentication in /etc/influxdb/influxdb.conf ( for individual steps see Change InfluxDB password user )
  • connect to the influx instance: influx
  • enter: show users
  • enter: show databases

The output then will show the list of users vs. admins and databases.
What is the output of the above commands ?

If no admin is being shown you need to create one.
Also make sure that you have a user for openhab and for grafana.

Here we go:

openhabian@openhabian:/etc/influxdb $ cat influxdb.conf | grep -v "#" | grep -v "^$"
[meta]
  dir = "/var/lib/influxdb/meta"
[data]
  dir = "/var/lib/influxdb/data"
  wal-dir = "/var/lib/influxdb/wal"
  series-id-set-cache-size = 100
[coordinator]
[retention]
[shard-precreation]
[monitor]
  store-enabled = false
[http]
  enabled = true
  bind-address = "localhost:8086"
  auth-enabled = false
[logging]
[subscriber]
[[graphite]]
[[collectd]]
[[opentsdb]]
[[udp]]
[continuous_queries]
[tls]
openhabian@openhabian:/etc/influxdb $ service influxdb start
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to start 'influxdb.service'.
Authenticating as: ,,, (openhabian)
Password: 
==== AUTHENTICATION COMPLETE ===
openhabian@openhabian:/etc/influxdb $ show user
-bash: show: command not found
openhabian@openhabian:/etc/influxdb $ show users
-bash: show: command not found
openhabian@openhabian:/etc/influxdb $ influx
Connected to http://localhost:8086 version 1.8.10
InfluxDB shell version: 1.8.10
> show users
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 <database>".
> 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 <database>".
> 

Actually I did not stop the influxDB before I did “show user”. I repeated now with stopping influx first. outcome is the following:

openhabian@openhabian:/etc/influxdb $ service influxdb stop
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to stop 'influxdb.service'.
Authenticating as: ,,, (openhabian)
Password: 
==== AUTHENTICATION COMPLETE ===
openhabian@openhabian:/etc/influxdb $ service influxdb start
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to start 'influxdb.service'.
Authenticating as: ,,, (openhabian)
Password: 
==== AUTHENTICATION COMPLETE ===
openhabian@openhabian:/etc/influxdb $ influx
Connected to http://localhost:8086 version 1.8.10
InfluxDB shell version: 1.8.10
> show users
user admin
---- -----

And show databases yields:

> show databases
name: databases
name
----

Perfect.
That means there is no user at all defined in influxdb ( the list below the headline is empty ).
And there is also no database defined yet ( besides the headline nothing is being shown ).

This means create the database and the admin and the grafana user first.
Commands are described in very first post of this thread.
This also could/should be done by running the openhabian install procedure for influxdb.
As there is no influxdb right now you also cannot already have data collected yet - at least not in influxdb.

Hmm, I started openhabian-config and executed the installation of influx&grafana again. It failed. I tried it 3 times. I started openhabian-config once from the root and once from ./home/openhabian

InfluxDB installation seemed to work, but not Grafana.


openhabian@openhabian:~ $ openhabian-config 
2022-01-07_15:39:18_CET [openHABian] Checking for root privileges... 
This script must be run as root. Did you mean 'sudo openhabian-config'?
More info: https://www.openhab.org/docs/installation/openhabian.html
openhabian@openhabian:~ $ sudo openhabian-config 
[sudo] password for openhabian: 
2022-01-07_15:39:28_CET [openHABian] Checking for root privileges... OK
2022-01-07_15:39:28_CET [openHABian] Loading configuration file '/etc/openhabian.conf'... OK
2022-01-07_15:39:28_CET [openHABian] openHABian configuration tool version: [openHAB3]{2021-12-02T09:19:37-07:00}(bb960d8)
2022-01-07_15:39:28_CET [openHABian] Checking for changes in origin branch openHAB3... OK
2022-01-07_15:39:30_CET [openHABian] Switching to branch openHAB3... OK
2022-01-07_15:39:30_CET [openHABian] Adding slightly tuned bash configuration files to system... OK
2022-01-07_15:39:37_CET [openHABian] Updating Linux package information... OK
2022-01-07_15:39:38_CET [openHABian] Beginning setup of InfluxDB and Grafana... OK
2022-01-07_15:39:39_CET [openHABian] Configuring InfluxDB... OK
2022-01-07_15:42:28_CET [openHABian] Configuring Grafana... OK
2022-01-07_15:43:32_CET [openHABian] Installing InfluxDB... OK
2022-01-07_15:43:35_CET [openHABian] Setting up new InfluxDB installation... OK
2022-01-07_15:43:36_CET [openHABian] Installing Grafana.. FAILED
2022-01-07_15:45:02_CET [openHABian] Updating Linux package information... OK
2022-01-07_15:45:02_CET [openHABian] Beginning setup of InfluxDB and Grafana... OK
2022-01-07_15:45:03_CET [openHABian] Configuring InfluxDB... OK
2022-01-07_15:46:23_CET [openHABian] Configuring Grafana... OK
2022-01-07_15:46:39_CET [openHABian] Setting up new InfluxDB installation... OK
2022-01-07_15:46:40_CET [openHABian] Installing Grafana.. FAILED
2022-01-07_15:48:16_CET [openHABian] Checking for default openHABian username:password combination... OK
2022-01-07_15:48:16_CET [openHABian] We hope you got what you came for! See you again soon ;)
openhabian@openhabian:~ $ pwd
/home/openhabian
openhabian@openhabian:~ $ cd..
openhabian@openhabian:/home $ cd..
openhabian@openhabian:/ $ sudo openhabian-config 
2022-01-07_15:48:37_CET [openHABian] Checking for root privileges... OK
2022-01-07_15:48:38_CET [openHABian] Loading configuration file '/etc/openhabian.conf'... OK
2022-01-07_15:48:38_CET [openHABian] openHABian configuration tool version: [openHAB3]{2021-12-02T09:19:37-07:00}(bb960d8)
2022-01-07_15:48:38_CET [openHABian] Checking for changes in origin branch openHAB3... OK
2022-01-07_15:48:40_CET [openHABian] Switching to branch openHAB3... OK
2022-01-07_15:48:40_CET [openHABian] Adding slightly tuned bash configuration files to system... OK
2022-01-07_15:48:47_CET [openHABian] Updating Linux package information... OK
2022-01-07_15:48:47_CET [openHABian] Beginning setup of InfluxDB and Grafana... OK
2022-01-07_15:48:48_CET [openHABian] Configuring InfluxDB... OK
2022-01-07_15:50:09_CET [openHABian] Configuring Grafana... OK
2022-01-07_15:50:17_CET [openHABian] Installing InfluxDB... OK
2022-01-07_15:50:20_CET [openHABian] Setting up new InfluxDB installation... OK
2022-01-07_15:50:21_CET [openHABian] Installing Grafana.. FAILED
2022-01-07_15:52:15_CET [openHABian] Checking for default openHABian username:password combination... OK
2022-01-07_15:52:15_CET [openHABian] We hope you got what you came for! See you again soon ;)
openhabian@openhabian:/ $ 

I used my own (and 3 different usernames) when being asked to enter the various usernames.

I ran the installation in maximum debug mode: influx seemingly was successfully installed. but on Grafana an access to localhost:3000 is refused…???

curl: (7) Failed to connect to localhost port 3000: Connection refused

The last part of the debugging info:

...
Check if InfluxDB is running... 
+ cond_redirect curl --retry 6 --retry-connrefused --user myNameAdmin:12345678 --insecure http://localhost:8086/query
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ curl --retry 6 --retry-connrefused --user myNameAdmin:12345678 --insecure http://localhost:8086/query \033[39;49;00m'

$ curl --retry 6 --retry-connrefused --user myNameAdmin:12345678 --insecure http://localhost:8086/query 
+ curl --retry 6 --retry-connrefused --user myNameAdmin:12345678 --insecure http://localhost:8086/query
{"error":"missing required parameter \"q\""}
+ return 0
+ echo OK
OK
+ return 0
+ echo OK
OK
+ influxDBAddress=http://localhost:8086
+ [[ -n myNameAdmin ]]
++ timestamp
++ date +%F_%T_%Z
+ echo -n '2022-01-07_16:17:49_CET [openHABian] Setting up new InfluxDB installation... '
2022-01-07_16:17:49_CET [openHABian] Setting up new InfluxDB installation... + cond_echo 'Creating InfluxDB database myNameOH'
+ [[ -z '' ]]
+ echo -e '\033[33;01mCreating InfluxDB database myNameOH\033[39;49;00m'
Creating InfluxDB database myNameOH
+ cond_redirect curl --user myNameAdmin:12345678 --insecure http://localhost:8086/query --data-urlencode 'q=CREATE DATABASE myNameOH'
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ curl --user myNameAdmin:12345678 --insecure http://localhost:8086/query --data-urlencode q=CREATE DATABASE myNameOH \033[39;49;00m'

$ curl --user myNameAdmin:12345678 --insecure http://localhost:8086/query --data-urlencode q=CREATE DATABASE myNameOH 
+ curl --user myNameAdmin:12345678 --insecure http://localhost:8086/query --data-urlencode 'q=CREATE DATABASE myNameOH'
{"results":[{"statement_id":0}]}
+ return 0
+ cond_echo 'Creating InfluxDB user myNameOpenhab'
+ [[ -z '' ]]
+ echo -e '\033[33;01mCreating InfluxDB user myNameOpenhab\033[39;49;00m'
Creating InfluxDB user myNameOpenhab
+ cond_redirect curl --user myNameAdmin:12345678 --insecure http://localhost:8086/query --data-urlencode 'q=CREATE USER myNameOpenhab WITH PASSWORD '\''12345678'\'''
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ curl --user myNameAdmin:12345678 --insecure http://localhost:8086/query --data-urlencode q=CREATE USER myNameOpenhab WITH PASSWORD '\''12345678'\'' \033[39;49;00m'

$ curl --user myNameAdmin:12345678 --insecure http://localhost:8086/query --data-urlencode q=CREATE USER myNameOpenhab WITH PASSWORD '12345678' 
+ curl --user myNameAdmin:12345678 --insecure http://localhost:8086/query --data-urlencode 'q=CREATE USER myNameOpenhab WITH PASSWORD '\''12345678'\'''
{"results":[{"statement_id":0}]}
+ return 0
+ cond_redirect curl --user myNameAdmin:12345678 --insecure http://localhost:8086/query --data-urlencode 'q=SET PASSWORD FOR myNameOpenhab = '\''12345678'\'''
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ curl --user myNameAdmin:12345678 --insecure http://localhost:8086/query --data-urlencode q=SET PASSWORD FOR myNameOpenhab = '\''12345678'\'' \033[39;49;00m'

$ curl --user myNameAdmin:12345678 --insecure http://localhost:8086/query --data-urlencode q=SET PASSWORD FOR myNameOpenhab = '12345678' 
+ curl --user myNameAdmin:12345678 --insecure http://localhost:8086/query --data-urlencode 'q=SET PASSWORD FOR myNameOpenhab = '\''12345678'\'''
{"results":[{"statement_id":0}]}
+ return 0
+ cond_redirect curl --user myNameAdmin:12345678 --insecure http://localhost:8086/query --data-urlencode 'q=GRANT ALL ON myNameOH TO myNameOpenhab'
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ curl --user myNameAdmin:12345678 --insecure http://localhost:8086/query --data-urlencode q=GRANT ALL ON myNameOH TO myNameOpenhab \033[39;49;00m'

$ curl --user myNameAdmin:12345678 --insecure http://localhost:8086/query --data-urlencode q=GRANT ALL ON myNameOH TO myNameOpenhab 
+ curl --user myNameAdmin:12345678 --insecure http://localhost:8086/query --data-urlencode 'q=GRANT ALL ON myNameOH TO myNameOpenhab'
{"results":[{"statement_id":0}]}
+ return 0
+ cond_echo 'Creating InfluxDB user myNameGrafana2influx'
+ [[ -z '' ]]
+ echo -e '\033[33;01mCreating InfluxDB user myNameGrafana2influx\033[39;49;00m'
Creating InfluxDB user myNameGrafana2influx
+ cond_redirect curl --user myNameAdmin:12345678 --insecure http://localhost:8086/query --data-urlencode 'q=CREATE USER myNameGrafana2influx WITH PASSWORD '\''12345678'\'''
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ curl --user myNameAdmin:12345678 --insecure http://localhost:8086/query --data-urlencode q=CREATE USER myNameGrafana2influx WITH PASSWORD '\''12345678'\'' \033[39;49;00m'

$ curl --user myNameAdmin:12345678 --insecure http://localhost:8086/query --data-urlencode q=CREATE USER myNameGrafana2influx WITH PASSWORD '12345678' 
+ curl --user myNameAdmin:12345678 --insecure http://localhost:8086/query --data-urlencode 'q=CREATE USER myNameGrafana2influx WITH PASSWORD '\''12345678'\'''
{"results":[{"statement_id":0}]}
+ return 0
+ cond_redirect curl --user myNameAdmin:12345678 --insecure http://localhost:8086/query --data-urlencode 'q=SET PASSWORD FOR myNameGrafana2influx = '\''12345678'\'''
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ curl --user myNameAdmin:12345678 --insecure http://localhost:8086/query --data-urlencode q=SET PASSWORD FOR myNameGrafana2influx = '\''12345678'\'' \033[39;49;00m'

$ curl --user myNameAdmin:12345678 --insecure http://localhost:8086/query --data-urlencode q=SET PASSWORD FOR myNameGrafana2influx = '12345678' 
+ curl --user myNameAdmin:12345678 --insecure http://localhost:8086/query --data-urlencode 'q=SET PASSWORD FOR myNameGrafana2influx = '\''12345678'\'''
{"results":[{"statement_id":0}]}
+ return 0
+ cond_redirect curl --user myNameAdmin:12345678 --insecure http://localhost:8086/query --data-urlencode 'q=GRANT READ ON myNameOH TO myNameGrafana2influx'
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ curl --user myNameAdmin:12345678 --insecure http://localhost:8086/query --data-urlencode q=GRANT READ ON myNameOH TO myNameGrafana2influx \033[39;49;00m'

$ curl --user myNameAdmin:12345678 --insecure http://localhost:8086/query --data-urlencode q=GRANT READ ON myNameOH TO myNameGrafana2influx 
+ curl --user myNameAdmin:12345678 --insecure http://localhost:8086/query --data-urlencode 'q=GRANT READ ON myNameOH TO myNameGrafana2influx'
{"results":[{"statement_id":0}]}
+ return 0
+ echo OK
OK
++ timestamp
++ date +%F_%T_%Z
+ echo -n '2022-01-07_16:17:50_CET [openHABian] Installing Grafana.. '
2022-01-07_16:17:50_CET [openHABian] Installing Grafana.. + cond_redirect grafana_install 12345678
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ grafana_install 12345678 \033[39;49;00m'

$ grafana_install 12345678 
+ grafana_install 12345678
+ local adminPassword=12345678
+ local keyName=grafana
+ grafana_is_installed
+ dpkg -s grafana
+ [[ -s /etc/grafana/grafana.ini ]]
+ return 0
++ timestamp
++ date +%F_%T_%Z
+ echo -n '2022-01-07_16:17:50_CET [openHABian] Setting up Grafana service... '
2022-01-07_16:17:50_CET [openHABian] Setting up Grafana service... + cond_redirect zram_dependency install grafana-server
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ zram_dependency install grafana-server \033[39;49;00m'

$ zram_dependency install grafana-server 
+ zram_dependency install grafana-server
+ local zramServiceConfig=/etc/systemd/system/zram-config.service
+ local install=yes
+ [[ -f /etc/ztab ]]
+ [[ install == \i\n\s\t\a\l\l ]]
+ shift 1
+ [[ grafana-server == \r\e\m\o\v\e ]]
+ for arg in "$@"
+ [[ yes == \y\e\s ]]
+ grep -qs grafana-server.service /etc/systemd/system/zram-config.service
+ [[ yes == \n\o ]]
+ cond_redirect systemctl -q daemon-reload
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ systemctl -q daemon-reload \033[39;49;00m'

$ systemctl -q daemon-reload 
+ systemctl -q daemon-reload
+ return 0
+ return 0
+ zram_is_installed
+ [[ -s /etc/ztab ]]
+ [[ -d /opt/zram ]]
+ return 0
+ mkdir -p /opt/zram/log.bind/grafana /var/log/grafana
+ cond_redirect systemctl enable --now grafana-server.service
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ systemctl enable --now grafana-server.service \033[39;49;00m'

$ systemctl enable --now grafana-server.service 
+ systemctl enable --now grafana-server.service
Synchronizing state of grafana-server.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable grafana-server
+ return 0
+ echo OK
OK
++ timestamp
++ date +%F_%T_%Z
+ echo -n '2022-01-07_16:17:52_CET [openHABian] Setting up Grafana... '
2022-01-07_16:17:52_CET [openHABian] Setting up Grafana... + cond_echo '\nWait for Grafana to start... '
+ [[ -z '' ]]
+ echo -e '\033[33;01m\nWait for Grafana to start... \033[39;49;00m'

Wait for Grafana to start... 
+ cond_redirect curl -4 --retry 6 --retry-connrefused --insecure --head http://localhost:3000
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ curl -4 --retry 6 --retry-connrefused --insecure --head http://localhost:3000 \033[39;49;00m'

$ curl -4 --retry 6 --retry-connrefused --insecure --head http://localhost:3000 
+ curl -4 --retry 6 --retry-connrefused --insecure --head http://localhost:3000
curl: (7) Failed to connect to localhost port 3000: Connection refused
Warning: Problem : connection refused. Will retry in 1 seconds. 6 retries 
Warning: left.
curl: (7) Failed to connect to localhost port 3000: Connection refused
Warning: Problem : connection refused. Will retry in 2 seconds. 5 retries 
Warning: left.
curl: (7) Failed to connect to localhost port 3000: Connection refused
Warning: Problem : connection refused. Will retry in 4 seconds. 4 retries 
Warning: left.
curl: (7) Failed to connect to localhost port 3000: Connection refused
Warning: Problem : connection refused. Will retry in 8 seconds. 3 retries 
Warning: left.
curl: (7) Failed to connect to localhost port 3000: Connection refused
Warning: Problem : connection refused. Will retry in 16 seconds. 2 retries 
Warning: left.
curl: (7) Failed to connect to localhost port 3000: Connection refused
Warning: Problem : connection refused. Will retry in 32 seconds. 1 retries 
Warning: left.
curl: (7) Failed to connect to localhost port 3000: Connection refused
+ return 7
+ echo 'FAILED (wait for Grafana to start)'
FAILED (wait for Grafana to start)
+ return 1
+ return 1
+ echo FAILED
FAILED
+ return 1
+ '[' 1 -ne 0 ']'
+ whiptail --msgbox 'There was an error or interruption during the execution of:\n  "20 | Optional Components"\n\nPlease try again. If the error persists, please read /opt/openhabian/docs/openhabian-DEBUG.md or https://github.com/openhab/openhabian/blob/main/docs/openhabian-DEBUG.md how to proceed.' 14 80
+ return 0
+ true
+ show_main_menu
+ local choice
+ local version
+++ get_git_revision
+++ local branch
+++ local commitDate
+++ local shorthash
++++ git -C /opt/openhabian rev-parse --abbrev-ref HEAD
+++ branch=openHAB3
++++ git -C /opt/openhabian log --pretty=format:%aI -n 1
+++ commitDate=2021-12-02T09:19:37-07:00
++++ git -C /opt/openhabian log --pretty=format:%h -n 1
+++ shorthash=bb960d8
+++ echo '[openHAB3]{2021-12-02T09:19:37-07:00}(bb960d8)'
++ whiptail --title 'openHABian Configuration Tool — [openHAB3]{2021-12-02T09:19:37-07:00}(bb960d8)' --menu 'Setup Options' 19 116 12 --cancel-button Exit --ok-button Execute '00 | About openHABian' 'Information about the openHABian project and this tool' '' '' '01 | Select Branch' 'Select the openHABian config tool version ("branch") to run' '02 | Upgrade System' 'Update all installed software packages (incl. openHAB) to their latest version' '03 | Install openHAB' 'Install or upgrade to openHAB 3' '04 | Import config' 'Import an openHAB 3 configuration from file or URL' '' '' '10 | Apply Improvements' 'Apply the latest improvements to the basic openHABian setup ►' '20 | Optional Components' 'Choose from a set of optional software components ►' '30 | System Settings' 'A range of system and hardware related configuration steps ►' '40 | openHAB Related' 'Switch the installed openHAB version or apply tweaks ►' '50 | Backup/Restore' 'Manage backups and restore your system ►'
+ choice=
+ RET=1
+ '[' 1 -eq 1 ']'
+ return 255
+ system_check_default_password
+ is_pi
+ is_pifour
+ [[ '' == \p\i\4 ]]
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]11[0-9a-fA-F]$' /proc/cpuinfo
+ return 0
+ return 0
+ local algo
+ local defaultPassword
+ local defaultUser
+ local generatedPassword
+ local introText
+ local originalPassword
+ local salt
+ is_pi
+ is_pifour
+ [[ '' == \p\i\4 ]]
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]11[0-9a-fA-F]$' /proc/cpuinfo
+ return 0
+ return 0
+ id -u pi
+ is_pi
+ is_pifour
+ [[ '' == \p\i\4 ]]
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]11[0-9a-fA-F]$' /proc/cpuinfo
+ return 0
+ return 0
+ defaultUser=openhabian
+ defaultPassword=openhabian
++ grep -w openhabian /etc/shadow
++ cut -d: -f2
+ originalPassword='$y$j9T$WDuhwaGgLhKT5f09ID/5n/$TKRPXY0Z9qeY0CRH8Ez7X72VKuFEV/N/uVXAylXxNID'
++ echo '$y$j9T$WDuhwaGgLhKT5f09ID/5n/$TKRPXY0Z9qeY0CRH8Ez7X72VKuFEV/N/uVXAylXxNID'
++ cut '-d$' -f2
+ algo=y
+ introText='The default password was detected on your system! That is a serious security concern. Bad guys or malicious programs in your subnet are able to gain root access!\n\nPlease set a strong password by typing the command '\''passwd openhabian'\''!'
++ echo '$y$j9T$WDuhwaGgLhKT5f09ID/5n/$TKRPXY0Z9qeY0CRH8Ez7X72VKuFEV/N/uVXAylXxNID'
++ cut '-d$' -f3
+ salt=j9T
+ export algo defaultPassword salt
++ perl -le 'print crypt("$ENV{defaultPassword}","\$$ENV{algo}\$$ENV{salt}\$")'
+ generatedPassword='$y$j9T$$1DJdHt2WNxWqFR3sUxwYKh.KdyI9MF4X/A9710MJGjA'
++ timestamp
++ date +%F_%T_%Z
+ echo -n '2022-01-07_16:19:49_CET [openHABian] Checking for default openHABian username:password combination... '
2022-01-07_16:19:49_CET [openHABian] Checking for default openHABian username:password combination... ++ id -u openhabian
+ [[ -n 1000 ]]
+ [[ $y$j9T$$1DJdHt2WNxWqFR3sUxwYKh.KdyI9MF4X/A9710MJGjA == \$\y\$\j\9\T\$\W\D\u\h\w\a\G\g\L\h\K\T\5\f\0\9\I\D\/\5\n\/\$\T\K\R\P\X\Y\0\Z\9\q\e\Y\0\C\R\H\8\E\z\7\X\7\2\V\K\u\F\E\V\/\N\/\u\V\X\A\y\l\X\x\N\I\D ]]
+ echo OK
OK
++ timestamp
++ date +%F_%T_%Z
+ echo -e '2022-01-07_16:19:49_CET [openHABian] We hope you got what you came for! See you again soon ;)'
2022-01-07_16:19:49_CET [openHABian] We hope you got what you came for! See you again soon ;)

Now I found another interesting issue: the config files of influxDB WERE NOT changed with the reinstatement. they hold obsolete information!
openhab is NOT the username I used in the installation process, but myNameAdmin
that means to me that there is some rights issue - however I wonder why the installation process says that influxDB was correctly setup. BTW, the influxDB now indeed works again, but grafana not.

BTW, I “grepped” for the DBname to find config files that hold any such information…so it should be fairly accurate.

openhabian@openhabian:/ $ cat ./srv/openhab-conf/services/influxdb.cfg
url=http://localhost:8086
user=openhab
password=myoldpwd
db= myoldDB
retentionPolicy=autogen
openhabian@openhabian:/ $ cat ./srv/openhab-userdata/config/org/openhab/influxdb.config
:org.apache.felix.configadmin.revision:=L"16"
db="myoldDB"
password="myoldpwd"
retentionPolicy="autogen"
service.pid="org.openhab.influxdb"
url="http://localhost:8086"
user="openhab"
openhabian@openhabian:/ $ 

And, I can also not access influx via the web interface http://192.168.178.111:8086 .

The debug log shows that the installation of influxdb, create users, db went ok.
Grafana, as you already stated, seems to have a problem.

Check if grafana is running and on which port it is running:

sudo netstat -tulpn |grep -i grafana

Grafana seems not to be up and / or listening on port 3000.
There must be something in the log files e.g. /var/log/granfana/grafana.log

Check if journalctl shows a granfana related message:

sudo journalctl | grep -i grafana

Could be that there is a problem with permissions to create a pid file or to create a log file.
In that case check permissions of /var/log/grafana directory.
But journalctl should give a hint in that case.

There is a bigger issue. I restarted the Raspi (before I stopped openhab, influx) and again there is no influx working. So the problem we thought is solved, is actually not.

jfyi: auth-enabled = false in the influxdb config.

show users in influx again shows no admin users. how can that be? I only restarted the Raspi…

I installed now influx&grafana once again via openhabian-config…

no show userss shows:

user             admin
----             -----
AlexollonAdmin   true
AlexollonOpenhab false
AlexollonGrafana false

I ran the 2 commands…here is the outcome. There is a “permission denied” error on /var/log/grafana/grafana.log.

**openhabian@openhabian**:**/ $** sudo netstat -tulpn |grep -i grafana

**openhabian@openhabian**:**/ $** sudo journalctl | grep -i grafana

Jan 07 17:41:19 openhabian systemd[1]: Started **Grafana** instance.

Jan 07 17:41:31 openhabian **grafana**-server[856]: Failed to start **grafana**. error: failed to initialize file handler: open /var/log/**grafana**/**grafana**.log: permission denied

Jan 07 17:41:31 openhabian **grafana**-server[856]: failed to initialize file handler: open /var/log/**grafana**/**grafana**.log: permission denied

Jan 07 17:41:31 openhabian systemd[1]: **grafana**-server.service: Main process exited, code=exited, status=1/FAILURE

Jan 07 17:41:31 openhabian systemd[1]: **grafana**-server.service: Failed with result 'exit-code'.

Jan 07 17:41:31 openhabian systemd[1]: **grafana**-server.service: Scheduled restart job, restart counter is at 1.

Jan 07 17:41:31 openhabian systemd[1]: Stopped **Grafana** instance.

Jan 07 17:41:31 openhabian systemd[1]: Started **Grafana** instance.

Jan 07 17:41:32 openhabian **grafana**-server[1114]: Failed to start **grafana**. error: failed to initialize file handler: open /var/log/**grafana**/**grafana**.log: permission denied

Jan 07 17:41:32 openhabian **grafana**-server[1114]: failed to initialize file handler: open /var/log/**grafana**/**grafana**.log: permission denied

Jan 07 17:41:32 openhabian systemd[1]: **grafana**-server.service: Main process exited, code=exited, status=1/FAILURE

Jan 07 17:41:32 openhabian systemd[1]: **grafana**-server.service: Failed with result 'exit-code'.

Jan 07 17:41:32 openhabian systemd[1]: **grafana**-server.service: Scheduled restart job, restart counter is at 2.

Jan 07 17:41:32 openhabian systemd[1]: Stopped **Grafana** instance.

Jan 07 17:41:32 openhabian systemd[1]: Started **Grafana** instance.

Jan 07 17:41:32 openhabian **grafana**-server[1135]: Failed to start **grafana**. error: failed to initialize file handler: open /var/log/**grafana**/**grafana**.log: permission denied

Jan 07 17:41:32 openhabian **grafana**-server[1135]: failed to initialize file handler: open /var/log/**grafana**/**grafana**.log: permission denied

Jan 07 17:41:32 openhabian systemd[1]: **grafana**-server.service: Main process exited, code=exited, status=1/FAILURE

Jan 07 17:41:32 openhabian systemd[1]: **grafana**-server.service: Failed with result 'exit-code'.

Jan 07 17:41:33 openhabian systemd[1]: **grafana**-server.service: Scheduled restart job, restart counter is at 3.

Jan 07 17:41:33 openhabian systemd[1]: Stopped **Grafana** instance.

Jan 07 17:41:33 openhabian systemd[1]: Started **Grafana** instance.

Jan 07 17:41:33 openhabian **grafana**-server[1188]: Failed to start **grafana**. error: failed to initialize file handler: open /var/log/**grafana**/**grafana**.log: permission denied

Jan 07 17:41:33 openhabian **grafana**-server[1188]: failed to initialize file handler: open /var/log/**grafana**/**grafana**.log: permission denied

Jan 07 17:41:33 openhabian systemd[1]: **grafana**-server.service: Main process exited, code=exited, status=1/FAILURE

Jan 07 17:41:33 openhabian systemd[1]: **grafana**-server.service: Failed with result 'exit-code'.

Jan 07 17:41:33 openhabian systemd[1]: **grafana**-server.service: Scheduled restart job, restart counter is at 4.

Jan 07 17:41:33 openhabian systemd[1]: Stopped **Grafana** instance.

Jan 07 17:41:33 openhabian systemd[1]: Started **Grafana** instance.

Jan 07 17:41:34 openhabian **grafana**-server[1228]: Failed to start **grafana**. error: failed to initialize file handler: open /var/log/**grafana**/**grafana**.log: permission denied

Jan 07 17:41:34 openhabian **grafana**-server[1228]: failed to initialize file handler: open /var/log/**grafana**/**grafana**.log: permission denied

Jan 07 17:41:34 openhabian systemd[1]: **grafana**-server.service: Main process exited, code=exited, status=1/FAILURE

Jan 07 17:41:34 openhabian systemd[1]: **grafana**-server.service: Failed with result 'exit-code'.

Jan 07 17:41:34 openhabian systemd[1]: **grafana**-server.service: Scheduled restart job, restart counter is at 5.

Jan 07 17:41:34 openhabian systemd[1]: Stopped **Grafana** instance.

Jan 07 17:41:34 openhabian systemd[1]: Started **Grafana** instance.

Jan 07 17:41:34 openhabian **grafana**-server[1261]: Failed to start **grafana**. error: failed to initialize file handler: open /var/log/**grafana**/**grafana**.log: permission denied

Jan 07 17:41:34 openhabian **grafana**-server[1261]: failed to initialize file handler: open /var/log/**grafana**/**grafana**.log: permission denied

Jan 07 17:41:34 openhabian systemd[1]: **grafana**-server.service: Main process exited, code=exited, status=1/FAILURE

Jan 07 17:41:34 openhabian systemd[1]: **grafana**-server.service: Failed with result 'exit-code'.

Jan 07 17:41:34 openhabian systemd[1]: **grafana**-server.service: Scheduled restart job, restart counter is at 6.

Jan 07 17:41:34 openhabian systemd[1]: Stopped **Grafana** instance.

Jan 07 17:41:34 openhabian systemd[1]: **grafana**-server.service: Start request repeated too quickly.

Jan 07 17:41:34 openhabian systemd[1]: **grafana**-server.service: Failed with result 'exit-code'.

Jan 07 17:41:34 openhabian systemd[1]: Failed to start **Grafana** instance.

Jan 07 17:52:44 openhabian influxd-systemd-start.sh[5502]: ts=2022-01-07T16:52:44.103758Z lvl=info msg="Executing query" log_id=0YuN9HeW000 service=query query="CREATE USER Alexollon**Grafana** WITH PASSWORD [REDACTED]"

Jan 07 17:52:44 openhabian influxd-systemd-start.sh[5502]: [httpd] 127.0.0.1 - AlexollonAdmin [07/Jan/2022:17:52:44 +0100] "POST /query HTTP/1.1 {'q': 'CREATE USER Alexollon**Grafana** WITH PASSWORD '12345678''}" 200 33 "-" "curl/7.74.0" 3bf3d97e-6fda-11ec-8009-e45f01610c46 128411

Jan 07 17:52:44 openhabian influxd-systemd-start.sh[5502]: ts=2022-01-07T16:52:44.255562Z lvl=info msg="Executing query" log_id=0YuN9HeW000 service=query query="SET PASSWORD FOR Alexollon**Grafana** = [REDACTED]"

Jan 07 17:52:44 openhabian influxd-systemd-start.sh[5502]: [httpd] 127.0.0.1 - AlexollonAdmin [07/Jan/2022:17:52:44 +0100] "POST /query HTTP/1.1 {'q': 'SET PASSWORD FOR Alexollon**Grafana** = '12345678''}" 200 33 "-" "curl/7.74.0" 3c0b0656-6fda-11ec-800a-e45f01610c46 132079

Jan 07 17:52:44 openhabian influxd-systemd-start.sh[5502]: ts=2022-01-07T16:52:44.412772Z lvl=info msg="Executing query" log_id=0YuN9HeW000 service=query query="GRANT READ ON dieKuchars TO Alexollon**Grafana**"

Jan 07 17:52:44 openhabian influxd-systemd-start.sh[5502]: [httpd] 127.0.0.1 - AlexollonAdmin [07/Jan/2022:17:52:44 +0100] "POST /query HTTP/1.1 {'q': 'GRANT READ ON dieKuchars TO Alexollon**Grafana**'}" 200 33 "-" "curl/7.74.0" 3c2300d8-6fda-11ec-800b-e45f01610c46 2233

Jan 07 17:52:47 openhabian systemd[1]: Started **Grafana** instance.

Jan 07 17:52:47 openhabian **grafana**-server[5646]: Failed to start **grafana**. error: failed to initialize file handler: open /var/log/**grafana**/**grafana**.log: permission denied

Jan 07 17:52:47 openhabian **grafana**-server[5646]: failed to initialize file handler: open /var/log/**grafana**/**grafana**.log: permission denied

Jan 07 17:52:47 openhabian systemd[1]: **grafana**-server.service: Main process exited, code=exited, status=1/FAILURE

Jan 07 17:52:47 openhabian systemd[1]: **grafana**-server.service: Failed with result 'exit-code'.

Jan 07 17:52:47 openhabian systemd[1]: **grafana**-server.service: Scheduled restart job, restart counter is at 1.

Jan 07 17:52:47 openhabian systemd[1]: Stopped **Grafana** instance.

Jan 07 17:52:47 openhabian systemd[1]: Started **Grafana** instance.

Jan 07 17:52:48 openhabian **grafana**-server[5665]: Failed to start **grafana**. error: failed to initialize file handler: open /var/log/**grafana**/**grafana**.log: permission denied

Jan 07 17:52:48 openhabian **grafana**-server[5665]: failed to initialize file handler: open /var/log/**grafana**/**grafana**.log: permission denied

Jan 07 17:52:48 openhabian systemd[1]: **grafana**-server.service: Main process exited, code=exited, status=1/FAILURE

Jan 07 17:52:48 openhabian systemd[1]: **grafana**-server.service: Failed with result 'exit-code'.

Jan 07 17:52:48 openhabian systemd[1]: **grafana**-server.service: Scheduled restart job, restart counter is at 2.

Jan 07 17:52:48 openhabian systemd[1]: Stopped **Grafana** instance.

Jan 07 17:52:48 openhabian systemd[1]: Started **Grafana** instance.

Jan 07 17:52:48 openhabian **grafana**-server[5675]: Failed to start **grafana**. error: failed to initialize file handler: open /var/log/**grafana**/**grafana**.log: permission denied

Jan 07 17:52:48 openhabian **grafana**-server[5675]: failed to initialize file handler: open /var/log/**grafana**/**grafana**.log: permission denied

Jan 07 17:52:48 openhabian systemd[1]: **grafana**-server.service: Main process exited, code=exited, status=1/FAILURE

Jan 07 17:52:48 openhabian systemd[1]: **grafana**-server.service: Failed with result 'exit-code'.

Jan 07 17:52:48 openhabian systemd[1]: **grafana**-server.service: Scheduled restart job, restart counter is at 3.

Jan 07 17:52:48 openhabian systemd[1]: Stopped **Grafana** instance.

Jan 07 17:52:48 openhabian systemd[1]: Started **Grafana** instance.

Jan 07 17:52:49 openhabian **grafana**-server[5689]: Failed to start **grafana**. error: failed to initialize file handler: open /var/log/**grafana**/**grafana**.log: permission denied

Jan 07 17:52:49 openhabian **grafana**-server[5689]: failed to initialize file handler: open /var/log/**grafana**/**grafana**.log: permission denied

Jan 07 17:52:49 openhabian systemd[1]: **grafana**-server.service: Main process exited, code=exited, status=1/FAILURE

Jan 07 17:52:49 openhabian systemd[1]: **grafana**-server.service: Failed with result 'exit-code'.

Jan 07 17:52:49 openhabian systemd[1]: **grafana**-server.service: Scheduled restart job, restart counter is at 4.

Jan 07 17:52:49 openhabian systemd[1]: Stopped **Grafana** instance.

Jan 07 17:52:49 openhabian systemd[1]: Started **Grafana** instance.

Jan 07 17:52:49 openhabian **grafana**-server[5700]: Failed to start **grafana**. error: failed to initialize file handler: open /var/log/**grafana**/**grafana**.log: permission denied

Jan 07 17:52:49 openhabian **grafana**-server[5700]: failed to initialize file handler: open /var/log/**grafana**/**grafana**.log: permission denied

Jan 07 17:52:49 openhabian systemd[1]: **grafana**-server.service: Main process exited, code=exited, status=1/FAILURE

Jan 07 17:52:49 openhabian systemd[1]: **grafana**-server.service: Failed with result 'exit-code'.

Jan 07 17:52:49 openhabian systemd[1]: **grafana**-server.service: Scheduled restart job, restart counter is at 5.

Jan 07 17:52:49 openhabian systemd[1]: Stopped **Grafana** instance.

Jan 07 17:52:49 openhabian systemd[1]: **grafana**-server.service: Start request repeated too quickly.

Jan 07 17:52:49 openhabian systemd[1]: **grafana**-server.service: Failed with result 'exit-code'.

Jan 07 17:52:49 openhabian systemd[1]: Failed to start **Grafana** instance.

**openhabian@openhabian**:**/ $**

So I checked rights on this directory:

openhabian@openhabian:/var/log $ la
total 9.5M
drwxr-xr-x   1 root    root            4.0K Jan  7 17:17 ./
drwxr-xr-x  11 root    root            4.0K Jan  5 15:22 ../
-rw-rw-r--   1 root    root             18K Jan  5 15:20 alternatives.log
drwxrwxr-x   2 root    root            4.0K Jan  5 15:21 apt/
-rw-rw----   1 root    adm              18K Jan  7 17:58 auth.log
-rw-rw-r--   1 root    root               0 Oct 30 13:29 bootstrap.log
-rw-rw----   1 root    utmp               0 Oct 30 13:29 btmp
-rw-rw----   1 root    adm             3.6M Jan  7 18:02 daemon.log
-rw-rw----   1 root    adm              25K Jan  7 17:51 debug
-rw-rw-r--   1 root    root            110K Jan  5 15:21 dpkg.log
-rw-rw-r--   1 root    root             24K Jan  5 15:21 faillog
-rw-rw-r--   1 root    root             484 Jan  5 15:16 fontconfig.log
drwxr-xr-x   2 root    root            4.0K Jan  5 16:01 grafana/
drwxr-sr-x+  1 root    systemd-journal 4.0K Oct 30 13:29 journal/
-rw-rw----   1 root    adm             585K Jan  7 17:17 kern.log
-rw-rw-r--   1 root    utmp            286K Jan  7 17:41 lastlog
-rw-rw----   1 root    adm             551K Jan  7 17:17 messages
drwxrwxr-x   1 openhab openhabian      4.0K Jan  7 17:41 openhab/
drwx------   2 root    root            4.0K Oct 30 13:29 private/
drwxrwxr-x   3 root    root            4.0K Oct 30 13:13 runit/
drwxr-x---   1 root    root            4.0K Jan  7 17:44 samba/
-rw-rw----   1 root    adm             4.2M Jan  7 18:02 syslog
drwxrwxr-x   2 root    root            4.0K Feb  2  2021 sysstat/
drwxrwxr-x   2 root    root            4.0K Jan  5 15:15 unattended-upgrades/
-rw-rw----   1 root    adm             8.1K Jan  7 17:17 user.log
-rw-rw-r--   1 root    utmp             13K Jan  7 17:41 wtmp
lrwxrwxrwx   1 root    root              32 Jan  5 15:21 zram-config -> /usr/local/share/zram-config/log/

But my main problem remains: InfluxDB does not work after restarting the Raspi.

the dir needs to be owned by grafana:grafana
so this is the reason why grafana does not start.

The above and

could be caused by ZRAM.
ZRAM is a “mirror” for a set of directories in memory.
The explanation would be that the install was done in ZRAM and checked in ZRAM but not saved back to the SD card. When Pi is booted again data is copied again from SD card back to ZRAM. In case it was missing on SD it is missing in ZRAM, too.
In such cases I disable ZRAM. Make sure that the installation first works without using ZRAM and then make sure that ZRAM is enabled again.

Well, the good thing is: Grafana works again, however I dont know how to change the database…but that is a minor issue.

Bigger is that persistence again does not work, ie no data is shown in graphs of openhab web interface. There is no error anymore, users in influx look good. Still, does not work.

I give up now. I need to do a full reinstall.

Still I learnt a lot (and saved a lot of learnings for the future) - thank you Wolfgang!

one last question: I did a backup of the openhabian config out of the config tool as I dont want to enter all the THINGS and ITEMS data again. But I am worried that I will take the problems with me. Does this config data also include influx and Grafana config files or just the openhab configuration stuff?