fg2it / grafana-on-raspberry

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

armhf docker container not starting on arm64 with volume #31

Closed phdelodder closed 6 years ago

phdelodder commented 6 years ago

When I try to start the container I get the following error:

lvl=crit msg="Failed to parse /etc/grafana/grafana.ini, open /etc/grafana/grafana.ini: permission denied%!(EXTRA []interface {}=[])"

using fg2it/grafana-armhf:v5.0.3

fg2it commented 6 years ago

@phdelodder Thanks for reporting. Could you provide some details :

The title of the issue mentions 'arm64', but the docker I provide (currently) only support armhf (armv7). So that could be the reason, could you try to install the aarch64 deb package ?

Another interesting point is the perm inside de container. Could you check that ?

$ docker run -ti --entrypoint /bin/bash fg2it/grafana-armhf:v5.0.3
[inside docker]$ ls -l /etc/grafana
total 24
-rw-r----- 1 root grafana 13660 Mar 17 02:42 grafana.ini
-rw-r----- 1 root grafana  3468 Mar 17 02:42 ldap.toml
drwxr-xr-x 4 root grafana  4096 Mar 22 19:45 provisioning

If permissions don't allow read try to fix that and run to confirm it is indeed the problem :

[inside docker]$ chmod +r /etc/grafana/grafana.ini
[inside docker]$ /run.sh

You can also try to increase log level

[inside docker]$ /run.sh cfg:default.log.level="debug"

or

$ docker run -ti --rm fg2it/grafana-armhf:v5.0.3 cfg:default.log.level="debug"
phdelodder commented 6 years ago

Thanks for the followup. But I restarted the docker container and now it works. I have no more explanation for it.

fg2it commented 6 years ago

Good, I guess. Could you tell me the hardware and os you are using ?

phdelodder commented 6 years ago

I'm running rock64 with dietpi. I can reproduce it it occurs always the first time you create the container, when I stop the container and start it again the issue is gone.

fg2it commented 6 years ago

That is strange. What version of docker are you using ? How do you start your container ?

phdelodder commented 6 years ago

Docker version 17.12.1-ce, build 7390fc6 docker-compose version 1.8.0, build unknown

fg2it commented 6 years ago

Do you mount any volume in your container ? How do you start it ? It would help if you could check the permissions, before and after launching grafana, something along :

$ docker run -ti --entrypoint /bin/bash fg2it/grafana-armhf:v5.0.3
[inside docker]$ ls -l /etc/grafana
[inside docker]$ /run.sh
#interrupt if needed with ctrl+c
[inside docker]$ ls -l /etc/grafana
phdelodder commented 6 years ago

yes I mounted the a custom volume, without the volume it works like a charm

fg2it commented 6 years ago

[TL;DR]

[long story] So custom volume is very likely the reason. That is why I was asking for command line in my first post... There are some issues with the current handling of permissions with the official images (with I follow). Depending on how you do things, it could have been fixed by c8bbfc79f6c800540728926440a93bd8e2f4312f that tracks grafana/grafana-docker@291c817 (and I would have think so) or still be open (that seems to be the case since fg2it/grafana-armhf:v5.0.3 includes this change; more diagnostics would help understanding what is happening and ask Grafana staff to fix). The official docker is expected to change with v5.1.0 release thanks to grafana/grafana-docker#146, that should solve these kinds of problem.