Mkdir: can't create directory '/var/lib/grafana/plugins': Permission denied

yes that is for a docker image of grafana. the github repo you are pointing to and having errors for is not for grafana

Iā€™m trying to use Docker to install Grafana and yet that is not a suitable topic?

but you are not installing grafana. you are installing another repo that has nothing to do with grafana. unless i am in need of another cup of coffee

1 Like

The error messages are about the directories that are used by Grafana.

Ok, Iā€™m going to say it more plainly: that repository you keep pointing to is pure crap. It was created by someone either negligent or someone who simply doesnā€™t understand docker.

First of all, the folder data and data/grafana donā€™t exist before hand. So obviously you cannot change their permissions. You have to create them manually and change the permission on data/grafana (only this one, because it seems that data/db is used by the other container). And to the grafana folder (again, relative path, in the git repository).

It then works without any issues. Insisting that this is a bug while using some random repository on the internet and asking for the grafana staff to fix thisā€¦ isnā€™t cool (Iā€™ve nothing to do with them, just for your own information).

You need to understand the basics of docker. This is all it boils down to.

2 Likes

ok, thanks for your feedback.

1 Like

Well, that repo does use the grafanaā€™s official image. So much is true. But I agree with you.

1 Like

the error messages could have said something about tesla, google, my kitchen sink but that has no direct bearing on tesla, google or my kitchen. :wink:

2 Likes

In a non-development environment at least I would use named volumes though instead of bind mounts. Actually I would used named volumes anyway if I can access them directly. They are located under /var/lib/docker/volumes.

So you could have something ilke:

volumes:
      - questdb-data:/root/.questdb/db

which corresponds then to /var/lib/docker/volumes/questdb-data on the host itself.

1 Like

ok thanks, I will review.

2 Likes

Including all of the necessary prerequisites and fundamental administration knowledge is difficult for any tutorial. I see that you have opened an issue with the tutorial author, so they may be able to provide further assistance.

As @yosiasz and @cretin have described, this is a permissions issue. I recommend reviewing their suggestions, as well as the solution Usman linked in the Grafana issue you opened.

Iā€™m not sure what distribution youā€™re running so please refer to more specific documentation as needed, but beginning with reviewing Linux file permissions and file structure should be helpful for this and future projects:

Another tip to tackle this is on the command prompt type the command id

for e.g. I am using the root user for running docker-compose file so (It should return 0 for root)

[root@docker loki-stack]# id -u
0

Open your docker-compose file and

in the grafana section just add this line after the image is picked by you;

user: "0"

Then run this docker command;

[root@docker loki-stack]# docker-compose up -d --force-recreate

And it should not return any errors. I did this recently with the latest grafana version 9.0.3

4 Likes