Bad ownership/permissions of grafana.ini after related units reboot.

Bug #1788124 reported by Nick Moffitt
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Grafana Charm
Invalid
Undecided
Unassigned

Bug Description

for some time after its related apaches and influxdbs and such had rebooted, our grafana instance had a badly-owned config file:

    Aug 21 07:55:55 juju-c7b322-prod-showback-2 grafana-server[1328]: t=2018-08-21T07:55:55+0000 lvl=crit msg="Failed to parse /etc/grafana/grafana.ini, open /etc/grafana/grafana.ini: permission denied%!(EXTR

    ubuntu@juju-c7b322-prod-showback-2:~$ ls -l /etc/grafana/grafana.ini
    -rw-r----- 1 root root 6664 May 23 12:16 /etc/grafana/grafana.ini
    ubuntu@juju-c7b322-prod-showback-2:~$ sudo chgrp grafana /etc/grafana/grafana.ini

This chgrp fixed things. There's something non-idempotent in the mechanisms used to write out this INI file if it can revert back to root:root ownership after a hook execution.

Revision history for this message
Nick Moffitt (nick-moffitt) wrote :

It looks like this may have been the result of admin intervention, though I can find no trace of it beyond some history showing edits of the file in vim. It does look as though the layer renders the file 0644 rather than 0640, so I don't see that the charm is to blame. I likewise see nothing in the package's hooks to show that it touches the file, and it's not listed as a conffile in dpkg --status.

This seems to have been the result of user error dating back to late May, and not a bug in the charm.

./charm/reactive/grafana.py: render(source=GRAFANA_INI_TMPL,
./charm/reactive/grafana.py: target=grafana_ini,
./charm/reactive/grafana.py- context=settings,
./charm/reactive/grafana.py- owner='root', group='root',
./charm/reactive/grafana.py- perms=0o644,

Package: grafana
Status: install ok installed
Priority: extra
Section: default
Installed-Size: 161921
Maintainer: <email address hidden>
Architecture: amd64
Version: 5.2.1
Depends: adduser, libfontconfig
Conffiles:
 /etc/default/grafana-server 06959dae18c2a458543a93d99983f62e
 /etc/init.d/grafana-server 719be2ff0469898c54537428ddd4a2a4
 /usr/lib/systemd/system/grafana-server.service c7d5b7ac8550b1a930a964020c02f9a5
Description: Grafana
License: "Apache 2.0"
Vendor: Grafana
Homepage: https://grafana.com

dpkg-query: no path found matching pattern /etc/grafana/grafana.ini

Changed in grafana-charm:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.