VCD Standby cell deployment fails with error 'could not open file "./postgresql.conf-bak": Permission denied'
vCloud Director 10.x
VCD cell fails to configure with exception : 'could not get COPY data stream: ERROR: could not open file "./postgresql.conf-bak": Permission denied'
This file '/postgresql.conf-bak' exists in location /var/vmware/vpostgres/14/pgdata/ and while cloning primary the database, its errors out with : 'Permission denied' error stack
Configure-vcd.log indicates below:
Jun 05 03:49:47 hostname.example.com systemd[1]: vpostgres.service: Control process exited, code=exited status=1
Jun 05 03:49:47 hostname.example.com systemd[1]: vpostgres.service: Failed with result 'exit-code'.
Jun 05 03:49:47 hostname.example.com systemd[1]: Failed to start VMware Postgres database server.
Creating repmgr standby configuration.
2024-06-05 10:12:56 | setup-repmgr-standby.sh | Creating repmgr standby configuration.
2024-06-05 10:12:56 | configure-repmgr.sh | Creating repmgr-node-id
2024-06-05 10:12:56 | configure-repmgr.sh | Writing /opt/vmware/vpostgres/current/etc/repmgr.conf
Cloning primary database (100.xx.xx.xxx) to standby using repmgr. This may take a long time, depending on database size.
2024-06-05 10:12:56 | setup-repmgr-standby.sh | Cloning primary database (100.xx.xx.xx) to standby using repmgr. This may take a long time, depending on database size.
NOTICE: destination directory "/var/vmware/vpostgres/current/pgdata" provided
INFO: connecting to source node
DETAIL: connection string is: user=repmgr host=100.xx.xx.xx gssencmode=disable
DETAIL: current installation size is 51 GB
INFO: replication slot usage not requested; no replication slot will be set up for this standby
NOTICE: checking for available walsenders on the source node (2 required)
NOTICE: checking replication connections can be made to the source server (2 required)
WARNING: data checksums are not enabled and "wal_log_hints" is "off"
DETAIL: pg_rewind requires "wal_log_hints" to be enabled
WARNING: directory "/var/vmware/vpostgres/current/pgdata" exists but is not empty
NOTICE: deleting existing directory "/var/vmware/vpostgres/current/pgdata"
NOTICE: starting backup (using pg_basebackup)...
HINT: this may take some time; consider using the -c/--fast-checkpoint option
INFO: executing:
/opt/vmware/vpostgres/current/bin/pg_basebackup -l "repmgr base backup" -D /var/vmware/vpostgres/current/pgdata -d 'user=repmgr host=100.xx.xx.xx gssencmode=disable' -X stream
pg_basebackup: error: could not get COPY data stream: ERROR: could not open file "./postgresql.conf-bak": Permission denied
pg_basebackup: removing contents of data directory "/var/vmware/vpostgres/current/pgdata"
ERROR: unable to take a base backup of the source server
HINT: data directory ("/var/vmware/vpostgres/current/pgdata") may need to be cleaned up manually
Error creating clone of primary node to this standy server using repmgr
2024-06-05 10:13:24 | setup-repmgr-standby.sh | [ERROR] Error creating clone of primary node to this standy server using repmgr
2024-06-05 10:13:24 | setupvcd.sh | [ERROR] Failed to configure repmgr on this standby. Check /opt/vmware/var/log/vcd/configure-vcd.log for additional information. Aborting.
2024-06-05 10:13:24 | configure-vcd.sh | [ERROR] setupvcd script failed to execute.