CircleCI-Public / CircleCI-Public/cimg-postgres
Bug Report: pg_cron.sh references /var/lib/postgresql/data/ directly
- Dominant language
- Dockerfile
- Stars
- 10
- Forks
- 27
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
When PGDATA env var is set to override the default data directory, the container errors on startup:
```
/usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/pg_cron.sh
shared_buffers = 512MB
max_connections = 200
max_prepared_transactions = 200
max_locks_per_transaction = 512
max_pred_locks_per_transaction = 256
listen_addresses = '*'
shared_preload_libraries = 'pg_cron'
cron.database_name = 'circle_test'
grep: /var/lib/postgresql/data/postgresql.conf: No such file or directory
/docker-entrypoint-initdb.d/pg_cron.sh: line 18: /var/lib/postgresql/data/postgresql.conf: No such file or directory
cat: /var/lib/postgresql/data/postgresql.conf: No such file or directory
cat: /var/lib/postgresql/data/postgresql.conf: No such file or directory
exited with error (exited with 1)
```
Tracked down this this line:
https://github.com/CircleCI-Public/cimg-postgres/blob/418064b6bade57bffc5ab8e74b6774c295a19c70/pg_cron.sh#L21-L22
**To Reproduce**
Set PGDATA to any non-default dir.
**Expected behavior**
Env var is used to avoid errors.
**Workarounds**
Unsure.
Contributor guide
Assessment
This issue has not been assessed yet.