grafana/grafana-docker

Unable to Install plugins - Permission denied. Make sure you have write access to plugindir

vjsairam opened this issue · 8 comments

I am trying to install plugins in the latest version of grafana through helm, image: "grafana/grafana:5.1.0"

I see an error with the below message,

GF_PATHS_DATA='/var/lib/grafana' is not writable.
You may have issues with file permissions, more information here: http://docs.grafana.org/installation/docker/#migration-from-a-previous-version-of-the-docker-container-to-5-1-or-later
installing natel-plotly-panel @ 0.0.4
from url: https://grafana.com/api/plugins/natel-plotly-panel/versions/0.0.4/download
into: /var/lib/grafana/plugins
Error: ✗ Could not create /var/lib/grafana/plugins/natel-plotly-panel. Permission denied. Make sure you have write access to plugindir
NAME:
Grafana cli plugins install - install <plugin id> <plugin version (optional)>
USAGE:
Grafana cli plugins install [arguments...]

I think this is connected to the 5.1.0 breaking change with the docker image.

xlson commented

As jecnua mentioned this is related to file permissions. Is /var/lib/grafana a volume by any chance? For Grafana to be able to install plugins user id 472 needs write access to /var/lib/grafana/plugins. And if you use sqlite for the database it also require write access to /var/lib/grafana/grafana.db.

Alternatively, if the volumes are from a previous version of Grafana you could just run the container with the old Grafan user id 104 and your permissions since before should keep working.

@jecnua / @xlson I am not migrating the versions and I am doing a new deployment using Helm charts.

Everything looks okay,
uid=472(grafana) gid=472(grafana) groups=472(grafana),2006

xlson commented

Can you check the file permissions for /var/lib/grafana/plugins? They should be 472 but I presume they are different for some reason. Is this your own packaging?

drwxr-sr-x 4 104 107 6144 Mar 21 14:19 briangann-datatable-panel
drwxr-sr-x 5 104 107 6144 Apr 24 08:42 digiapulssi-organisations-panel
drwxr-sr-x 4 104 107 6144 Mar 21 14:18 grafana-piechart-panel
drwxr-sr-x 4 104 107 6144 Mar 21 14:19 jdbranham-diagram-panel
drwxr-sr-x 4 104 107 6144 Apr 11 02:34 mtanda-histogram-panel
drwxr-sr-x 4 104 107 6144 Mar 25 10:58 natel-discrete-panel
drwxr-sr-x 4 104 107 6144 Mar 21 14:18 natel-plotly-panel
drwxr-sr-x 4 104 107 6144 Apr 24 08:52 raintank-worldping-app
drwxr-sr-x 6 104 107 6144 Apr 11 02:34 ryantxu-ajax-panel
drwxr-sr-x 4 104 107 6144 Apr 11 02:34 vonage-status-panel

No, this is not my packaging.

xlson commented

The plugins folder is owned by the userid/groupid we used for Grafana in previous versions. That's either a persistant volume or those plugins are bundled with the helm packaging but my guess would be a persistent volume given the different sets of dates. In that case, you should be able to change the ownership of everything below /var/lib/grafana/plugins to 472 and the boot should keep going.

xlson commented

If the problem is with the packaging you should reach out to the maintainer of the Grafana helm packaging.

The issue is resolved after updating the helm charts and doing a fresh deployment. Thanks @xlson