docker-compose: file permission issues with grafana, gitserver, prometheus, redis-store
Created by: ggilmore
- Sourcegraph version:
- Platform information:
Steps to reproduce:
- Install docker and docker-compose on a linux host (Ubuntu 18.04 for my purposes)
- Clone https://github.com/sourcegraph/deploy-sourcegraph-docker on to the host
cd docker-compose && docker-compose up -d
- See that grafana, gitserver, prometheus, and redis-store all etc. are restarting with file permission issues
Logs:
grafana:
mkdir: can't create directory '/var/lib/grafana/plugins': Permission denied
GF_PATHS_DATA='/var/lib/grafana' is not writable.
gitserver:
2020/01/16 20:22:46 failed to setup temporary directory: mkdir /data/repos/.tmp: permission denied
redis-store
6:M 16 Jan 20:21:07.282 # Can't open the append-only file: Permission denied
prometheus
goroutine 1 [running]:
github.com/prometheus/prometheus/promql.NewActiveQueryTracker(0x7ffc3e779ede, 0xb, 0x14, 0x2b4f400, 0xc0006fb290, 0x2b4f400)
/app/promql/query_logger.go:115 +0x48c
main.main()
/app/cmd/prometheus/main.go:364 +0x5229
level=info ts=2020-01-16T20:38:30.233Z caller=main.go:296 msg="no time or size retention was set so using the default time retention" duration=15d
level=info ts=2020-01-16T20:38:30.233Z caller=main.go:332 msg="Starting Prometheus" version="(version=2.14.0, branch=HEAD, revision=edeb7a44cbf745f1d8be4ea6f215e79e651bfe19)"
level=info ts=2020-01-16T20:38:30.233Z caller=main.go:333 build_context="(go=go1.13.4, user=root@df2327081015, date=20191111-14:27:12)"
level=info ts=2020-01-16T20:38:30.233Z caller=main.go:334 host_details="(Linux 5.0.0-1028-gcp #29~18.04.1-Ubuntu SMP Thu Dec 19 19:04:05 UTC 2019 x86_64 cff8783f9cc6 (none))"
level=info ts=2020-01-16T20:38:30.233Z caller=main.go:335 fd_limits="(soft=1048576, hard=1048576)"
level=info ts=2020-01-16T20:38:30.233Z caller=main.go:336 vm_limits="(soft=unlimited, hard=unlimited)"
level=error ts=2020-01-16T20:38:30.233Z caller=query_logger.go:85 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(0x7ffe6a746ede, 0xb, 0x14, 0x2b4f400, 0xc00056e570, 0x2b4f400)
/app/promql/query_logger.go:115 +0x48c
main.main()
/app/cmd/prometheus/main.go:364 +0x5229