[bitnami/postgresql-repmgr] repmgr.conf file content duplicated on each container restart
Name and Version
bitnami/postgres-repmgr:16.0.0
What architecture are you using?
None
What steps will reproduce the bug?
- Follow the guide "Using a Docker Compose file" on "https://hub.docker.com/r/bitnami/postgresql-repmgr" to start a single postgres server using docker compose
- See that "/opt/bitnami/repmgr/conf/repmgr.conf" contains configuration of the node
- Restart the container
- See that "/opt/bitnami/repmgr/conf/repmgr.conf" content is now duplicated
For each restart of the container the repmgr.conf gets populated with the same configuration
In some cases (can't reproduce consistently) a lot of "NUL" characters are added to the config file
What is the expected behavior?
That replication manager config is only populated once - and the container supports restarts
What do you see instead?
Duplicated config data
Additional information
No response
Hi @ahweis,
With duplicated you means that the whole configuration is appended twice on the config file? Could you show the previous and after outputs?
Hi @aoterolorenzo ,
First time the container is started the conf file will be configured once, and then look like below:
event_notification_command='/opt/bitnami/repmgr/events/router.sh %n %e %s "%t" "%d"'
ssh_options='-o "StrictHostKeyChecking no" -v'
use_replication_slots='1'
pg_bindir='/opt/bitnami/postgresql/bin'
# FIXME: these 2 parameter should work
node_id=1001
node_name='postgresql16-1'
location='default'
conninfo='user=replmgr password=password host=postgresql16-1 dbname=repmgr port=5432 connect_timeout=5'
failover='automatic'
promote_command='PGPASSWORD=password repmgr standby promote -f "/opt/bitnami/repmgr/conf/repmgr.conf" --log-level DEBUG --verbose'
follow_command='PGPASSWORD=password repmgr standby follow -f "/opt/bitnami/repmgr/conf/repmgr.conf" -W --log-level DEBUG --verbose'
reconnect_attempts='3'
reconnect_interval='5'
log_level='NOTICE'
priority='100'
degraded_monitoring_timeout='5'
data_directory='/bitnami/postgresql/data'
async_query_timeout='20'
pg_ctl_options='-o "--config-file=\"/opt/bitnami/postgresql/conf/postgresql.conf\" --external_pid_file=\"/opt/bitnami/postgresql/tmp/postgresql.pid\" --hba_file=\"/opt/bitnami/postgresql/conf/pg_hba.conf\""'
pg_basebackup_options=''
Then if the container is restarted the config will be written again, and the file now looks like this:
event_notification_command='/opt/bitnami/repmgr/events/router.sh %n %e %s "%t" "%d"'
ssh_options='-o "StrictHostKeyChecking no" -v'
use_replication_slots='1'
pg_bindir='/opt/bitnami/postgresql/bin'
# FIXME: these 2 parameter should work
node_id=1001
node_name='postgresql16-1'
location='default'
conninfo='user=replmgr password=password host=postgresql16-1 dbname=repmgr port=5432 connect_timeout=5'
failover='automatic'
promote_command='PGPASSWORD=password repmgr standby promote -f "/opt/bitnami/repmgr/conf/repmgr.conf" --log-level DEBUG --verbose'
follow_command='PGPASSWORD=password repmgr standby follow -f "/opt/bitnami/repmgr/conf/repmgr.conf" -W --log-level DEBUG --verbose'
reconnect_attempts='3'
reconnect_interval='5'
log_level='NOTICE'
priority='100'
degraded_monitoring_timeout='5'
data_directory='/bitnami/postgresql/data'
async_query_timeout='20'
pg_ctl_options='-o "--config-file=\"/opt/bitnami/postgresql/conf/postgresql.conf\" --external_pid_file=\"/opt/bitnami/postgresql/tmp/postgresql.pid\" --hba_file=\"/opt/bitnami/postgresql/conf/pg_hba.conf\""'
pg_basebackup_options=''
event_notification_command='/opt/bitnami/repmgr/events/router.sh %n %e %s "%t" "%d"'
ssh_options='-o "StrictHostKeyChecking no" -v'
use_replication_slots='1'
pg_bindir='/opt/bitnami/postgresql/bin'
# FIXME: these 2 parameter should work
node_id=1001
node_name='postgresql16-1'
location='default'
conninfo='user=replmgr password=password host=postgresql16-1 dbname=repmgr port=5432 connect_timeout=5'
failover='automatic'
promote_command='PGPASSWORD=password repmgr standby promote -f "/opt/bitnami/repmgr/conf/repmgr.conf" --log-level DEBUG --verbose'
follow_command='PGPASSWORD=password repmgr standby follow -f "/opt/bitnami/repmgr/conf/repmgr.conf" -W --log-level DEBUG --verbose'
reconnect_attempts='3'
reconnect_interval='5'
log_level='NOTICE'
priority='100'
degraded_monitoring_timeout='5'
data_directory='/bitnami/postgresql/data'
async_query_timeout='20'
pg_ctl_options='-o "--config-file=\"/opt/bitnami/postgresql/conf/postgresql.conf\" --external_pid_file=\"/opt/bitnami/postgresql/tmp/postgresql.pid\" --hba_file=\"/opt/bitnami/postgresql/conf/pg_hba.conf\""'
pg_basebackup_options=''
For each restart of the container the a new set of configs will be added
Is there a correlation with another issue I see when e.g. the container crashes and tries to startup it complains that the /tmp/repmgrd.pid already exists and therefor can't start the replication manager before this file is deleted - could the config / setup have some logic not handling this correct?
This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.
Keep issue alive - can I provide more details?
Hi @ahweis,
Let me create a task for the team in order to fix this behavior. We will reach you back here.