Grafana Web UI not accessible after installation of system info binding

Dear community,

one week ago I installed OH3.2 completely from scratch with several bindings (homematic, openweathermap, astro, hue, …). Yesterday I programmed some charts in Grafana/influxdb and integrated them into the sitemaps. Everything worked fine. But when I installed system info binding, following happened
-during installing the binding, the Web UI hang up
-by command line, I still could access openhab
-After a cold restart, everything - including system info - is now running fine… except Grafana
-Trying to access the Grafana WebUI on port 3000, there’s an error message “Safari can not connect to server”.
-The OpenHAB WebUI on port 8086 hence is accessible… so it doesn’t seem to be really a network issue…???

Does anyone have a tip, what the root cause of this problem could be… and how I can solve it?

Thank you in advance,
MC

What is the output of
sudo netstat -tulpn | grep grafana
This should list all ports grafana listens on.

1 Like

@Wolfgang_S Thank you for your answer. It seems, that there is no port for grafana at all since the command line shows no answer at all…

Crosschecking with
sudo netstat -tulpn
however shows several other ports, among which e.g. influxd is listening at 8086 and 8088.

Possible that I have to restart Grafana somehow manually?

OK, tried some command line I encountered by googling:

sudo systemctl restart grafana-server sudo systemctl status grafana-server

results in

Failed to restart sudo.service: Unit sudo.service is masked.
Failed to restart systemctl.service: Unit systemctl.service not found.
Failed to restart status.service: Unit status.service not found.

(I deeply regret, that in past I did never learn LINUX thoroughly… Mentally I’m still stuck at MS DOS 6.1 :wink: )

You need to run the commands one by one, first

sudo systemctl restart grafana-server

Then

sudo systemctl status grafana-server

If this works, all you need to do (probably) is to run

sudo systemctl enable grafana-server

To make it start automatically when the system is booted.

1 Like

Thank you for the explanation, @pacive .
After restart by the first command (sudo systemctl restart grafana-server) the second command for the status (sudo systemctl status grafana-server) results in the prompt.

Feb 14 17:16:26 openhabian systemd[1]: grafana-server.service: Scheduled restart job, restart counter is at 5.
Feb 14 17:16:26 openhabian systemd[1]: Stopped Grafana instance.
Feb 14 17:16:26 openhabian systemd[1]: grafana-server.service: Start request repeated too quickly.
Feb 14 17:16:26 openhabian systemd[1]: grafana-server.service: Failed with result ‘exit-code’.
Feb 14 17:16:26 openhabian systemd[1]: Failed to start Grafana instance.

I’ve also waited > 1 minute between the commands, but doesn’t change anything…

Checking the Grafana version by “grafana-cli --version”, it prompts “Grafana CLI version 8.3.4”. So somehow it seems to be installed…

Check with
sudo journalctl -xu grafana
if that shows more about the root cause why the service cannot be started.
Might be a permission problems for a file or directory.

1 Like

No entries…
– Journal begins at Mon 2022-02-07 19:53:40 CET, ends at Mon 2022-02-14 19:03:29 CET. –
– No entries –

That matches quite well. since Last Monday (7.2.22) I reinstalled the complete OH system.

I would have expected to see entries for Feb 14 17:16:XX …

1 Like

Try that with sudo journalctl -xu grafana-server

1 Like

Hi @pacive ,I just rebooted the system. The journalctl command now showed some more details. Here’s the beginning.

openhabian@openhabian:~ $ sudo journalctl -xu grafana-server
– Journal begins at Tue 2022-02-15 16:18:08 CET, ends at Tue 2022-02-15 16:41:50 CET. –
Feb 15 16:20:43 openhabian systemd[1]: Started Grafana instance.
░░ Subject: A start job for unit grafana-server.service has finished successfully
░░ Defined-By: systemd
░░ Support: Debian -- Support
░░
░░ A start job for unit grafana-server.service has finished successfully.
░░
░░ The job identifier is 97.
Feb 15 16:21:01 openhabian grafana-server[841]: Failed to start grafana. error: failed to initialize file handler: open>
Feb 15 16:21:01 openhabian grafana-server[841]: failed to initialize file handler: open /var/log/grafana/grafana.log: p>
Feb 15 16:21:01 openhabian systemd[1]: grafana-server.service: Main process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: Debian -- Support
░░
░░ An ExecStart= process belonging to unit grafana-server.service has exited.
░░
░░ The process’ exit code is ‘exited’ and its exit status is 1.
Feb 15 16:21:01 openhabian systemd[1]: grafana-server.service: Failed with result ‘exit-code’.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: Debian -- Support
░░
░░ The unit grafana-server.service has entered the ‘failed’ state with result ‘exit-code’.
Feb 15 16:21:01 openhabian systemd[1]: grafana-server.service: Scheduled restart job, restart counter is at 1.
░░ Subject: Automatic restarting of a unit has been scheduled
░░ Defined-By: systemd
░░ Support: Debian -- Support
░░
░░ Automatic restarting of the unit grafana-server.service has been scheduled, as the result for

… there seem to be several start attempts. At the end of the output, there’s the prompt

The job identifier is 846 and the job result is done.
Feb 15 16:21:04 openhabian systemd[1]: grafana-server.service: Start request repeated too quickly.
Feb 15 16:21:04 openhabian systemd[1]: grafana-server.service: Failed with result ‘exit-code’.
░░ Subject: Unit failed
░░ Defined-By: system

If I try to open the referenced file, there’s no entry

openhabian@openhabian:~ $ cat /var/log/grafana/grafana.log
cat /var/log/grafana/grafana.log: No such file or directory

what are the permissions of that directory ?

ls -ld /var/log/grafana
1 Like

Dear @Wolfgang_S , following prompt.

openhabian@openhabian:~ $ ls -ld /var/log/grafana
drwxr-xr-x 2 root root 4096 Feb 7 20:01 /var/log/grafana

1 Like

Try sudo chown grafana:grafana /var/log/grafana and see if you can start it after that

1 Like

@pacive You’re a hero! I’ve entered
sudo chown grafana:grafana /var/log/grafana
then
sudo systemctl restart grafana-server

Now WebUI is accessible again, also the charts do still exist. (Just my InfluxDB seems to be not accessible anymore, but here I’ll first try by myself and in case I don’t find a solution open another post.)

Thank you and @Wolfgang_S so much for your support!

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.