Setting of grafana.ini (https)

I want to access Grafana via https
It does not work with https setup.
When I restart grafana-server, I get an error and it does not start.
The required setting is recognized as editing of grafana.ini and it is already set.

vi grafana.ini

-----------------------------------
# Protocol (http or https)
protocol = https

# https certs & key file
cert_file = /etc/httpd/conf/ssl/server.crt
cert_key = /etc/httpd/conf/ssl/server.key
-----------------------------------

The log is described below.

■systemctl status grafana-server.service

----------------------------------------------------------------------
● grafana-server.service - Grafana instance
** Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; enabled; vendor preset: disabled)**
** Active: failed (Result: start-limit) since 火 2017-08-01 14:22:11 JST; 197ms ago**
** Docs: http://docs.grafana.org**
** Process: 19658 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=exited, status=1/FAILURE)**
** Main PID: 19658 (code=exited, status=1/FAILURE)**

** 8月 01 14:22:11 systemd[1]: grafana-server.service: main process exited, cod…URE**
** 8月 01 14:22:11 systemd[1]: Unit grafana-server.service entered failed state.**
** 8月 01 14:22:11 systemd[1]: grafana-server.service failed.**
** 8月 01 14:22:11 systemd[1]: grafana-server.service holdoff time over, schedu…rt.**
** 8月 01 14:22:11 systemd[1]: start request repeated too quickly for grafana-s…ice**
** 8月 01 14:22:11 systemd[1]: Failed to start Grafana instance.**
** 8月 01 14:22:11 systemd[1]: Unit grafana-server.service entered failed state.**
** 8月 01 14:22:11 systemd[1]: grafana-server.service failed.**
Hint: Some lines were ellipsized, use -l to show in full.
----------------------------------------------------------------------

■tail -f /var/log/grafana/grafana.log
----------------------------------------------------------------------
t=2017-08-01T14:22:10+0900 lvl=crit msg="Failed to parse /etc/grafana/grafana.ini, open /etc/grafana/grafana.ini: permission denied%!(EXTRA []interface {}=[])"
t=2017-08-01T14:22:10+0900 lvl=crit msg="Failed to parse /etc/grafana/grafana.ini, open /etc/grafana/grafana.ini: permission denied%!(EXTRA []interface {}=[])"
t=2017-08-01T14:22:10+0900 lvl=crit msg="Failed to parse /etc/grafana/grafana.ini, open /etc/grafana/grafana.ini: permission denied%!(EXTRA []interface {}=[])"
t=2017-08-01T14:22:11+0900 lvl=crit msg="Failed to parse /etc/grafana/grafana.ini, open /etc/grafana/grafana.ini: permission denied%!(EXTRA []interface {}=[])"
t=2017-08-01T14:22:11+0900 lvl=crit msg=“Failed to parse /etc/grafana/grafana.ini, open /etc/grafana/grafana.ini: permission denied%!(EXTRA []interface {}=[])”
----------------------------------------------------------------------

I want to know the cause.
Please let me know if I have any missing settings.

The log output error is pretty clear :slight_smile: the grafana user running the process does not have permission to open grafana.ini, when you change it you must have changed permissions for to file

1 Like

after changing the permission, still getting the same error.

1 Like

How to change the permission to access grafana.ini file. Actually I want write permission to grafana.ini file in my case to update smtp settings

@pasarisrushti10 That depends on your operating system. I recommend reading FilePermissions in the Ubuntu community documentation.

If you just want to change a few lines, open a terminal, run sudo nano -B /etc/grafana/grafana.ini, make your changes and save by pressing ctrl+x, y and enter to close the editor. The -B makes sure Grafana saves a version of your file from before your edits so that you can go back to that version if you accidentally corrupt the file (with sudo mv /etc/grafana/grafana.ini~ /etc/grafana/grafana.ini). If you do any of these steps wrong, you may break your Grafana installation, so I’d proceed with caution unless you feel sure about what you’re doing.

Good luck!

Thanks @emiltullstedt for the reply.