fg2it / grafana-on-raspberry

Grafana packages for raspberry pi (armv6/armv7) and aarch64/arm64
311 stars 32 forks source link

Semicolon on grafana.ini #10

Closed riccardo1991 closed 7 years ago

riccardo1991 commented 7 years ago

Hello, I tried to install Grafana on a Raspi 3 with a brand new flashed Raspian. It was not working, so I checked the config file grafana.ini and all the entries had a semicolon ';' at the beginning of every line. I removed all of them and now Grafana is working perfectly.

fg2it commented 7 years ago

Which version did you used ? Could you link it ? I should probably add that ';' at the start of line in grafana config file are just comments. Usually, it describes the default value for a config parameter.

riccardo1991 commented 7 years ago

I installed the 3.1 version with the APT method on a Raspberry 3. I tried to force Grafana running with both init.d and systemd, but I could not reach localhost:3000. I noticed the semicolons on the config file, but in my MacOS version I do not have them so I tried to remove all of them and then I could run Grafana perfecly.

fg2it commented 7 years ago

So, first, problem seems to be with init.d/systemd. Do you have log of the problem you had when you tried to start grafana with them ?

It seems that grafana doesn't load it default config, that is probably why by changing grafana.ini it is working.

The default config should be in /usr/share/grafana/conf/defaults.ini, how does this file look like (should look like this defaults.ini) ?

Do you have something in the grafana log file (should be in /var/log/grafana/grafana.log) ? You should have log lines looking like :

t=2016-11-30T00:25:54+0000 lvl=info msg="Starting Grafana" logger=main version=3.1.1 commit=v3.1.0+20-g2bfccd7 compiled=2016-08-01
T10:47:55+0000
t=2016-11-30T00:25:54+0000 lvl=info msg="Config loaded from" logger=settings file=/usr/share/grafana/conf/defaults.ini
t=2016-11-30T00:25:54+0000 lvl=info msg="Config loaded from" logger=settings file=/etc/grafana/grafana.ini
[...]
riccardo1991 commented 7 years ago

Sorry for late reply, I was working today on another script and I could not focus on Grafana. Tomorrow morning I will check about the log. Anyway even tomorrow (or more likely on Monday) I will do a new installation of everything on a fresh flashed raspian, because I need to write a tutorial step by step for my project. In that occasion I will for sure check the log. Thank you for your effort for the Grafana port, the bees thank you 🐝

mattwkcc commented 7 years ago

I also ran into this issue. Removing the ";" from the lines allows me to start the server and connect to it on port 3000. Thanks

fg2it commented 7 years ago

@mattwkcc please, please, please, provide details. Which version, what are the logs saying, are the default config file there ...

fg2it commented 7 years ago

@wimroose thanks for your input ! Don't know why your comment is not posted here, so I quote it

Starting grafana doesn't work for me neither. I've installed 4.01 version. I copied the defaults.ini to /etc/grafana/grafana.ini to be sure the config file thing wasn't an issue, but grafana fails to start whatsoever. Grafana log is nonexisting.

$ sudo /bin/systemctl status grafana-server
 grafana-server.service - Grafana instance
   Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; enabled)
   Active: failed (Result: start-limit) since Thu 2016-12-08 11:34:49 CET; 6min ago
     Docs: http://docs.grafana.org
  Process: 28953 ExecStart=/usr/sbin/grafana-server --config=${CONF_FILE} --pidfile=${PID_FILE} cfg:default.paths.logs=${LOG_DIR} cfg:default.paths.data=${DATA_DIR} cfg:default.paths.plugins=${PLUGINS_DIR} (code=killed, signal=ILL)
 Main PID: 28953 (code=killed, signal=ILL)

Dec 08 11:34:49 nagios systemd[1]: grafana-server.service holdoff time over, scheduling restart.
Dec 08 11:34:49 nagios systemd[1]: Stopping Grafana instance...
Dec 08 11:34:49 nagios systemd[1]: Starting Grafana instance...
Dec 08 11:34:49 nagios systemd[1]: grafana-server.service start request repeated too quickly, refusing to start.
Dec 08 11:34:49 nagios systemd[1]: Failed to start Grafana instance.
Dec 08 11:34:49 nagios systemd[1]: Unit grafana-server.service entered failed state.

I don't have that. Here is what I have (debian-jessie, on pi 2, with v4.0.1 :

$ sudo dpkg -P gafana #remove previous install, including config file
$ sudo wget https://github.com/fg2it/grafana-on-raspberry/releases/download/v4.0.1/grafana_4.0.1-1480722482_armhf.deb
$ sudo dpkg -i grafana_4.0.1-1480722482_armhf.deb
[...]
$ sudo systemctl daemon-reload #ensure systemd files are reloaded
$ sudo systemctl start grafana-server
$ sudo systemctl status grafana-server
 grafana-server.service - Grafana instance
   Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; disabled)
   Active: active (running) since Fri 2016-12-09 00:05:16 UTC; 5s ago
     Docs: http://docs.grafana.org
 Main PID: 24382 (grafana-server)
   CGroup: /system.slice/grafana-server.service
           └─24382 /usr/sbin/grafana-server --config=/etc/grafana/grafana.ini --pidfile= cfg:default.paths.logs=/var/log/grafana cfg:default.paths.data=/var/lib/grafana cfg:default.paths.plugins=/var/lib/grafana/plugins
[...]

The problem could be related to your ExecStart line. The fact you have variable names (${CONF_FILE}, ...) and not variable values seems odd.

Could you check you have correct /usr/lib/systemd/system/grafana-server.service and /etc/default/grafana-server ?

You can also try to start it by hand :

$ sudo /usr/sbin/grafana-server --config=/etc/grafana/grafana.ini --homepath=/usr/share/grafana
WimRoose commented 7 years ago

@fg2it

I removed my post, because I got the armv7 release, while working on a raspi B+ :) Armv6 version is working fine. For some reason I always download wrong version of your releases :) Thanks for the great work anyway

EDIT: actually, grafana (armv6) failed to start with the message I've posted earlier. My grafana-server.service & /etc/default/grafana-server are ok, and I did systemctl daemon-reload.

I started grafana manually (successfull), and after killing it, systemctl start grafana-server does work.

Wim

fg2it commented 7 years ago

@WimRoose indeed you seem unlucky with that 😉 If you have any suggestion for me to be clearer, help yourself. What os version do you use ? Raspbian ? which release ? I would like to be able to reproduce this problem to know if an issue should be open in grafana.

fg2it commented 7 years ago

Without further data, I close this as an issue related to os configuration.