pozgo/grafana-xxl

"Failed to parse /etc/grafana/grafana.ini"

mjp0 opened this issue ยท 7 comments

mjp0 commented

I just updated my grafana-xxl docker image and now the image doesn't start anymore.

Error logs looks like this:

grafana_1 | Restart grafana after installing plugins . <service grafana-server restart>
grafana_1 | t=2017-08-22T17:45:09+0000 lvl=crit msg="Failed to parse /etc/grafana/grafana.ini, open /etc/grafana/grafana.ini: permission denied%!(EXTRA []interface {}=[])"

I haven't done any customizing (straight from docker hub) so I'm puzzled what could cause this. If I skip entrypoint and run run.sh inside the image, it loads normally upto to INFO[08-22|17:44:45] Initializing HTTP Server logger=http.server address=0.0.0.0:3000 protocol=http subUrl= socket=.

Any ideas?

/etc/grafana/grafana.ini: permission denied

How did you start your container? It's looks like a docker-compose. I guess you have problem with used volume /etc/grafana. Try to remove that volume from your system.

mjp0 commented

Yes, it's docker compose. Would removing /etc/grafana remove all dashboards etc. integrations I have?

Create backup first to be safe.

mjp0 commented

Actually it can't be related to docker volume because I'm only keeping /var/lib/grafana as a docker volume and the problem is /etc/grafana/grafana.ini.

That's not a true. /var/lib/grafana is your explicit docker volume. I guess your docker-compose is creating implicit volume /etc/grafana, which is defined in the Dockerfile.

mjp0 commented

I'm still unclear why this started happening now even though I have been using this image for the past 6 months without any changes in the docker compose configuration.

I know you already closed the issue, even though you didn't actually provide a working solution, but in case somebody else run into this same problem, the issue is that /run.sh, which is the entrypoint script, doesn't change permissions for /etc/grafana/grafana.ini from root to grafana user which is used to run grafana. This lead to that permission error.

The problem was solved by creating an explicit docker volume for /etc/grafana/ directory, then manually mounting it to a temp docker image, changing permissions to grafana:grafana for /etc/grafana/grafana.ini. This of course is not a sustainable solution but fixed this particular problem. Hopefully maintainer of this image will improve the script, or alternative you can clone the repo and modify /run.sh yourself.

Feel free to open PR. Thx.