When I run docker-compose up I get these messages:
Errors and Messages
Attaching to grafana_alerts, questdb_alerts
grafana_alerts | mkdir: can't create directory '/var/lib/grafana/plugins': Permission denied
grafana_alerts | GF_PATHS_DATA='/var/lib/grafana' is not writable.
grafana_alerts | You may have issues with file permissions, more information here: http://docs.grafana.org/installation/docker/#migrate-to-v51-or-later
Steps attempted to fix
When I run this
id -u
1000
I see that I am user 1000, so I tried that in addition to user 472
To be honest, this sounds more like an issue related to basic understanding of permissions, docker and user IDs than to grafana, but I may be wrong.
Where exactly are you running the chown commands? This isnât clear from your initial post.
[later edit:]
You are using a bind mount. That means that the permissions on the host need to be adapted accordingly. Now, depending on where youâre actually running this, the host might be the computer youâre running this on if itâs linux or a virtual machine if youâre running docker desktop on windows/mac.
Basic example is to open my repo in codespaces, type docker-compose up, and see the errors. I donât see anything in my actual code that could cause the errors.
Yeah, well, you still havenât answered my questions (the second one, related to the OS, was implied, of course), so Iâm not sure how I can help you further.
Your question is: " Where exactly are you running the chown commands? This isnât clear from your initial post."
Answer - in a DigitalOcean droplet - but you donât even need to do any chown or anything to see the errors. The error is visible via clone the repo or open via cloudspaces (browser based vm) and do docker-compose up and see the permissions errors.
You cannot be running the chown commands in the droplet, because those directories donât exist on the host in that path /var/lib/grafana or /etc/grafana/provisioning. If you were to do that, then youâd have received a clear message âno such file or directoryâ (Iâm not talking about the moment you run docker-compose up, which is different). And if they do exist, they have nothing to do with your grafana running inside the container.
So first you have to understand that this ./grafana/provisioning/:/etc/grafana/provisioning/ (in the volumes) is a relative path. Itâs relative to the place where you run docker-compose up.
So you have to run the chown on those directories in the git repository that youâve cloned.
I also see that the second pair chown commands overwrite the first one - why are you changing it again like that? It doesnât make any sense. You need to change it to 472 only.
but you donât even need to do any chown or anything to see the errors.
You need to run the chown commands, otherwise it doesnât work. This is not related to grafana at all, this is plain docker.
I did not want to find an error and try nothing and just report the bug here.
So, ignore the chown stuff - the basic point is out of the box, the repo does not work because of the permissions errors.
Example
Errors:
grafana_alerts | mkdir: can't create directory '/var/lib/grafana/plugins': Permission denied
grafana_alerts | GF_PATHS_DATA='/var/lib/grafana' is not writable.
grafana_alerts | You may have issues with file permissions, more information here: http://docs.grafana.org/installation/docker/#migrate-to-v51-or-later
As noted, I did try several ways to fix but could not solve. Any ideas? Are you able to get it to launch?
What does it have to do with grafana? From what I can see it has nothing to do with grafana? there is a folder called grafana :smile Have you looked into not using it at all and spinning up your own vanilla grafana and connecting it to questdb and using slack notification?
I have many projects and it is much cleaner to use docker and Terraform etc.
Doing all this via the UI will surely be possible, or ideally the Cloud Grafana, but the basic case of docker-compose up should be a prudent start.
I whole heartedly agree, auto provisioning via docker or podman is the way to go. but again this has nothing to do with grafan other than the mention of a folder called grafana