Tutorial Grafana Fundamentals Docker Prometheus container does not run

Tried on Ubuntu 20.04 and 21.10

Cloning the grafana tutorials from github, docker coompose up -d, when following the tutorial trying to add a prometheus source the error is “HTTP error Bad Gateway”.

A more thorough inspection shows that the prometheus container has exited after one second. Inspecting the prometheus log shows:

level=error ts=2022-02-18T09:33:32.859Z caller=main.go:285 msg=“Error loading config (–config.file=/etc/prometheus/prometheus.yml)” err=“open /etc/prometheus/prometheus.yml: permission denied”

I gave permission a+rw to prometheus.yml before running the container but that didn’t help.

What exactly is wrong? How can I run the tutorial?

sounds like one of Grafana’s funky user:group permissions issues. See if this comment helps:

fwiw I’ve been revising that tutorial and test it often, so let me know if that doesn’t work and I’ll try to run through the steps on a fresh Ubuntu vm

@rnoldr are you still having trouble running the fundamentals tutorial?

If so please reach out. The author and I can help you troubleshoot.

also, for that fundamentals tutorial, the correct path for adding prometheus is:
http://prometheus:9090, and not the ip, as it often is in real situations


Thanks for all your suggestions. I am sorry that I don’t understand them very well. The instructions tell me to clone the github repository, check if docker is running (it does) and run docker-compose up. I checked the volumes this time and it creates two: one with an internal docker name and one called ‘tutorial-environment_app_data’.

I cleared all volumes, checked that no containers were running and chown the prometheus directory to 472:472 (later 132:142 because I found out that was user:group grafana) and did a chmod 777 on prometheus and prometheus/prometheus.yml.

The same error persisted. And I think that is because it expects the config files should have the correct permissions in the docker container itself. Is that the case?