PureStorage-OpenConnect / pure-fa-openmetrics-exporter

Pure Storage OpenMetrics exporter for FlashArray
Apache License 2.0
18 stars 26 forks source link

docker prometheus fails to start #30

Closed lehatdst closed 1 year ago

lehatdst commented 1 year ago

I issue: sudo docker run -d -p 9090:9090 --name=prometheus -v /tmp/prometheus-pure.yml:/etc/prometheus/prometheus.yml -v /tmp/prometheus-data:/prometheus prom/prometheus:latest The Display: $ sudo docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES dcd500712644 prom/prometheus:latest "/bin/prometheus --c…" 22 seconds ago Exited (2) 21 seconds ago prometheus c83486d8df90 quay.io/purestorage/pure-fa-om-exporter:latest "/usr/local/bin/pure…" 16 minutes ago Up 16 minutes 0.0.0.0:9490->9490/tcp pure-fa-om-exporter

Logs for prometheus: sudo docker logs prometheus ts=2023-02-03T16:42:25.144Z caller=main.go:512 level=info msg="No time or size retention was set so using the default time retention" duration=15d ts=2023-02-03T16:42:25.144Z caller=main.go:556 level=info msg="Starting Prometheus Server" mode=server version="(version=2.42.0, branch=HEAD, revision=225c61122d88b01d1f0eaaee0e05b6f3e0567ac0)" ts=2023-02-03T16:42:25.145Z caller=main.go:561 level=info build_context="(go=go1.19.5, platform=linux/amd64, user=root@c67d48967507, date=20230201-07:53:32)" ts=2023-02-03T16:42:25.145Z caller=main.go:562 level=info host_details="(Linux 4.18.0-408.el8.x86_64 #1 SMP Mon Jul 18 17:42:52 UTC 2022 x86_64 dcd500712644 (none))" ts=2023-02-03T16:42:25.145Z caller=main.go:563 level=info fd_limits="(soft=1048576, hard=1048576)" ts=2023-02-03T16:42:25.145Z caller=main.go:564 level=info vm_limits="(soft=unlimited, hard=unlimited)" ts=2023-02-03T16:42:25.145Z caller=query_logger.go:91 level=error component=activeQueryTracker msg="Error opening query log file" file=/prometheus/queries.active err="open /prometheus/queries.active: permission denied" panic: Unable to create mmap-ed active query log

goroutine 1 [running]: github.com/prometheus/prometheus/promql.NewActiveQueryTracker({0x7ffed10bef02, 0xb}, 0x14, {0x3d8ba20, 0xc000051040}) /app/promql/query_logger.go:121 +0x3cd main.main() /app/cmd/prometheus/main.go:618 +0x69d3

Seems to be a premission issue. Does anyone know how to fix this error.

lehatdst commented 1 year ago

The issue is a Prometheus issue with UserID permissions. I found the solution in the Prometheus community.

sdodsley commented 1 year ago

@lehatdst do you have a reference for that?

lehatdst commented 1 year ago

I found the link: https://github.com/prometheus/prometheus/issues/5976 which had suggestion on the issue. I used the "--user root" on the sudo docker command when I start prometheus. It appears to work, until a different solution is tested. This works for starting PROMETHEUS: sudo docker run --user root -d -p 9090:9090 --name=prometheus -v /tmp/prometheus-pure.yml:/etc/prometheus/prometheus.yml -v /tmp/prometheus-data:/prometheus prom/prometheus:latest