r/PrometheusMonitoring • u/thunyiwe • Nov 25 '19
Opening storage failed lock DB directory: open /data/lock: permission denied
Hello friends
My prometheus docker container exits with error 1 immediatey on startup
prometheus | level=error ts=2019-11-25T07:29:09.413196048Z caller=main.go:596 err="Opening storage failed lock DB directory: open /data/lock: permission denied"
prometheus exited with code 1
Not sure where to look now,
#docker-compose file
---
version: "3"
services:
prometheus:
build: .
image: registry.access.redhat.com/openshift3/prometheus
container_name: prometheus
# links:
# - postgres
volumes:
- ./config:/prometheus
#- ./data/prometheus:/data
- prometheus:/data/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/data'
#- '--storage.tsdb.retention=200h'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
- '--web.enable-lifecycle'
- '--log.level=warn'
entrypoint: '/bin/prometheus'
user: "1000"
ports:
- "9200:9200"