Hello,
I ran into same problem starting prometheus service. Running the prometheus 
from the command line reveals the cause.

# sudo -u prometheus /usr/local/bin/prometheus   
--config.file=/etc/prometheus/prometheus.yml   
--storage.tsdb.path=/var/lib/prometheus   --storage.tsdb.retention.time=30d 
  --storage.tsdb.retention.size=0   
--web.console.libraries=/etc/prometheus/console_libraries   
--web.console.templates=/etc/prometheus/consoles   
--web.listen-address=:9090   --web.external-url=
level=error ts=2023-01-30T08:27:05.043Z caller=main.go:290 msg="Error 
loading config (--config.file=/etc/prometheus/prometheus.yml)" err="open 
/etc/prometheus/prometheus.yml: permission denied"

This was clearly a permissions problem. I fixed it using chmod but in case 
SELinux is enabled on the node, you may need to check file contexts.


On Saturday, May 28, 2022 at 7:52:03 AM UTC Brian Candler wrote:

> On Saturday, 28 May 2022 at 05:27:37 UTC+1 Vanshika Sahgal wrote:
>
>> yeah, it finally worked. The paths were creating an issue and the 
>> prometheus user as well. Is it of importance?
>
>
> I don't know what you mean. Describe what you had to do with "the paths" 
> and "the prometheus user" and maybe we can comment whether it is important 
> or not.
>
> If you ended up running prometheus as root (say), then that's a really bad 
> idea - for any software in general, not just prometheus.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/25f69c34-4853-49e0-89a1-eb58972a453bn%40googlegroups.com.

Reply via email to