CircleCI-Public / CircleCI-Public/cimg-postgres

Bug Report: pg_cron.sh references /var/lib/postgresql/data/ directly

Open
#136 2 comments 1 reaction 1 assignee Claimed by @marboledacci View on GitHub
bug
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.