Yet another "Dashboard won't launch on port 3000" failures =P

Hey all

Apologies in advance if this is just an absolute idiot question, but I’m having one hell of a hard time getting Grafana working.

So, I’ve properly installed Grafana (or at least I believe I have!) and kicked it off with :
pi@raspberrypi:~ $ sudo systemctl start grafana-server
So far, so good.

However, http://192.168.1.118:3000/ (the local host for this pi) returns nothing, simply a warning saying:
This site can’t be reached
192.168.1.118 refused to connect.

Ok, so I’ve checked the system log to confirm that it’s working:

    pi@raspberrypi:~ $ tail /var/log/syslog
    Jan  9 17:55:55 raspberrypi systemd[1]: Reloading.
    Jan  9 17:56:03 raspberrypi systemd[1]: serial-getty@ttyAMA0.service: Current command vanished from the unit file, execution of the command list won't be resumed.
    Jan  9 17:56:30 raspberrypi systemd[1]: Stopping Grafana instance...
    Jan  9 17:56:30 raspberrypi systemd[1]: grafana-server.service: Main process exited, code=killed, status=15/TERM
    Jan  9 17:56:30 raspberrypi systemd[1]: grafana-server.service: Succeeded.
    Jan  9 17:56:30 raspberrypi systemd[1]: Stopped Grafana instance.
    Jan  9 17:56:30 raspberrypi systemd[1]: Started Grafana instance.

So it seems to be working. Furthermore, I’ve checked the following:

pi@raspberrypi:~ $ systemctl status grafana-server.service
● grafana-server.service - Grafana instance
   Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2020-01-09 17:56:30 GMT; 14min ago
     Docs: http://docs.grafana.org
 Main PID: 1449 (grafana-server)
   Memory: 324.0K
   CGroup: /system.slice/grafana-server.service
           └─1449 /usr/sbin/grafana-server --config=/etc/grafana/grafana.ini --pidfile=/var/run/grafana/grafana-server.pid --packaging=deb cfg:de

Jan 09 17:56:30 raspberrypi systemd[1]: Started Grafana instance.
lines 1-10/10 (END)

Also so far so good. However still nothing on http://192.168.1.118:3000/

I’ve tried tail -f /var/log/grafana/grafana.log to check the specific grafana log, but weirdly there doesn’t seem to be a grafana log:

pi@raspberrypi:~ $ tail -f /var/log/grafana/grafana.log
tail: cannot open '/var/log/grafana/grafana.log' for reading: No such file or directory
tail: no files remaining

And sure enough, if I CD into /var/log/grafana/ it’s an entirely empty directory.

I’ve also tried sudo systemctl daemon-reload and sudo systemctl restart grafana-server and there have been no change in results. If I check the system log after these two commands, I get the following:

pi@raspberrypi:~ $ tail /var/log/syslog
Jan  9 18:13:22 raspberrypi systemd[1]: Reloading.
Jan  9 18:13:34 raspberrypi systemd[1]: Stopping Grafana instance...
Jan  9 18:13:34 raspberrypi systemd[1]: grafana-server.service: Main process exited, code=killed, status=15/TERM
Jan  9 18:13:34 raspberrypi systemd[1]: grafana-server.service: Succeeded.
Jan  9 18:13:34 raspberrypi systemd[1]: Stopped Grafana instance.
Jan  9 18:13:34 raspberrypi systemd[1]: Started Grafana instance.

Does anyone have any ideas of what I could try next? I’ve also tried rebooting the Pi, no luck there either.

Help me ObiWan Kenobi’s, you’re my only hope!

Hey all

Apologies in advance if this is just an absolute idiot question, but I’m
having one hell of a hard time getting Grafana working.

So, I’ve properly installed Grafana (or at least I believe I have!)

How?

and kicked it off with : pi@raspberrypi:~ $ sudo systemctl start grafana-server
So far, so good.

However, http://192.168.1.118:3000/ (the local host for this pi) returns
nothing, simply a warning saying: This site can’t be reached
192.168.1.118 refused to connect.

I wouldn’t use the term “local host” when referring to a non-loopback IP
address - it can be misleading.

But anyway, do you believe Grafana should be listening on the IP address
192.168.1.118 or 127.0.0.1?

Jan 9 17:56:30 raspberrypi systemd[1]: Started Grafana instance.

That says it started.

So it seems to be working.

“Started” != “Working” :slight_smile:

Furthermore, I’ve checked the following:

 Main PID: 1449 (grafana-server)
   Memory: 324.0K
   CGroup: /system.slice/grafana-server.service
           └─1449 /usr/sbin/grafana-server

–config=/etc/grafana/grafana.ini
–pidfile=/var/run/grafana/grafana-server.pid --packaging=deb cfg:de

Okay, so if you try “ps ax” what do you find against PID 1449?

Also so far so good. However still nothing on http://192.168.1.118:3000/

How about “netstat -lptn”? Or if you prefer, “ss -lptn”?

Do you see anything listening on port 3000, and/or do you see any Grafana
process listening at all?

I’ve tried tail -f /var/log/grafana/grafana.log to check the specific
grafana log, but weirdly there doesn’t seem to be a grafana log:

That sounds to me like it is not starting correctly, no matter what systemd
decides to tell you.

Does anyone have any ideas of what I could try next? I’ve also tried
rebooting the Pi, no luck there either.

What changes have you made to the default /etc/grafana/grafana.ini?

Antony.

Hi Anthony, thanks so much for replying! Very reasonable feedback for sure. Let me see if I can answer a few of your questions.

So, I’ve properly installed Grafana (or at least I believe I have!)

How?

By doing the following:

wget https://dl.grafana.com/oss/release/grafana_6.4.4_armhf.deb
sudo dpkg -i grafana_6.4.4_armhf.deb

and then:

sudo systemctl enable grafana-server in order to enable it on system start

and then:

sudo systemctl start grafana-server

Apologies for referring to the address as local host, you’re correct in that being misleading. I believe that Grafana should be listening on the IP address 192.168.1.118 as discovered by running hostname -I

After running ps ax I did not see anything running on PID 1449.

...
 786 ?        Sl     0:00 /usr/lib/menu-cache/menu-cached /run/user/1000/menu-c
  793 ?        Ssl    0:00 /usr/lib/gvfs/gvfs-mtp-volume-monitor
  797 ?        Ssl    0:00 /usr/lib/gvfs/gvfs-afc-volume-monitor
  819 ?        Sl     0:00 /usr/lib/gvfs/gvfsd-trash --spawner :1.4 /org/gtk/gvf
 5741 ?        I      0:00 [kworker/0:0-events]
 7840 ?        I<     0:00 [kworker/0:2H-mmc_complete]
 8394 ?        I      0:00 [kworker/u2:1-events_unbound]
 8556 ?        I      0:01 [kworker/0:1-events]
...

netstat -lptn resulted in the following:

pi@raspberrypi:~ $ netstat -lptn
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:8088          0.0.0.0:*               LISTEN      -                   
tcp6       0      0 :::8086                 :::*                    LISTEN      -                   
tcp6       0      0 :::22                   :::*                    LISTEN      -   

and ss -lptn resulted in:

pi@raspberrypi:~ $ ss -lptn
State     Recv-Q    Send-Q       Local Address:Port        Peer Address:Port    
LISTEN    0         128                0.0.0.0:22               0.0.0.0:*       
LISTEN    0         128              127.0.0.1:8088             0.0.0.0:*       
LISTEN    0         128                      *:8086                   *:*       
LISTEN    0         128                   [::]:22                  [::]:* 

And finally, I’ve not touched /etc/grafana/grafana.ini at all.

I hope this helps a bit!

Cheers
Josh

So, I’ve properly installed Grafana (or at least I believe I have!)

How?

By doing the following:

wget https://dl.grafana.com/oss/release/grafana_6.4.4_armhf.deb
sudo dpkg -i grafana_6.4.4_armhf.deb

I don’t think that will result in a working installation - I think you should
use apt-get or aptitude in order to make sure you get any additional
dependencies, which dpkg won’t do for you.

After running ps ax I did not see anything running on PID 1449.

Okay, so that tells us the output from “systemctl status grafana-
server.service” is telling you a process is running which in fact isn’t.

netstat -lptn resulted in the following:

pi@raspberrypi:~ $ netstat -lptn
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)

It would be good to run this command as root, then you can see the process
names of the listening services.

Ports 8086 and 8088 tell me that you’ve got influxdb installed and running, but
Grafana is definitely not running.

So, I would go back to your installation method and try again, following the
guidelines at https://grafana.com/docs/grafana/latest/installation/debian/

Antony.