public inbox for [email protected]  
help / color / mirror / Atom feed
From: Frans Simmelvuo (Papula-Nevinpat) <[email protected]>
To: [email protected] <[email protected]>
Subject: pg_basebackup "Permission denied" error when initiating streaming replication
Date: Tue, 7 May 2024 10:28:23 +0000
Message-ID: <GV1PR01MB85793D04E48B1855BCA755ABA7E42@GV1PR01MB8579.eurprd01.prod.exchangelabs.com> (raw)

Hi,

I'm trying to initiate streaming replication between two Postgres 10 servers on Windows. The source cluster is of size ~450gb, and the cluster consists of the primary data folder, and two separated tablespaces. One of the tablespaces is configured with a symbolic link inside Windows.

Now, the problem I'm encountering is the following:
I call pg_basebackup at the target as follows:
>> pg_basebackup -h <SRC_IP> -U <SUPERUSER> -p <SRC_PORT> -W -D <TARGETDIR> -T "C:\Server Files\Data\ProgramsData\PostgreSQL\10\data\base\demo_tablespace"=E:\PG_tablespace_data\10\demo_tablespace -T "C:\Server Files\Data\ProgramsData\PostgreSQL\10\data\base\tsb_tablespace"=E:\PG_tablespace_data\10\tsb_tablespace -P -R -v

This starts the pg_basebackup and it runs without problems for the duration of copying the 450gbs of data.
Then the output is the following:

>>pg_basebackup: initiating base backup, waiting for checkpoint to complete
>>pg_basebackup: checkpoint complete
>>pg_basebackup: write-ahead log start point: 181/9000028 on timeline 1
>>pg_basebackup: starting background WAL receiver
>>432917950/482036946 kB (100%), 3/3 tablespaces
>>pg_basebackup: could not get write-ahead log end position from server: ERROR: could not open file "./base/demo_tablespace": Permission denied

The demo_tablespace is the one that is a symbolic link from another folder. After the error, I find that all the data is copied to the target tablespaces and primary data directory, but the data directory is missing all pg_... directories and configuration files. So no running database at target.

I'm running the source Postgres service on Windows as a local account, the command is given with administrator cmd and the ./base/demo_tablespace folder's security settings should have all needed permissions for the operation.

I have a hard time understanding why pg_basebackup can retrieve the data from the ./base/demo_tablespace directory, and then suddenly gets denied. I'm running out of ideas on what to try next.

BR,
Frans Simmelvuo


reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: pg_basebackup "Permission denied" error when initiating streaming replication
  In-Reply-To: <GV1PR01MB85793D04E48B1855BCA755ABA7E42@GV1PR01MB8579.eurprd01.prod.exchangelabs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox