Skip to content

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

@joeshin

Description

@joeshin

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:

cimg-postgres/pg_cron.sh

Lines 21 to 22 in 418064b

cat /var/lib/postgresql/data/postgresql.conf | grep shared
cat /var/lib/postgresql/data/postgresql.conf | grep include

To Reproduce
Set PGDATA to any non-default dir.

Expected behavior
Env var is used to avoid errors.

Workarounds
Unsure.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions