public inbox for [email protected]  
help / color / mirror / Atom feed
pg_basebackup: error: could not create directory
5+ messages / 5 participants
[nested] [flat]

* pg_basebackup: error: could not create directory
@ 2024-09-05 07:40  Samir Mamun <[email protected]>
  0 siblings, 3 replies; 5+ messages in thread

From: Samir Mamun @ 2024-09-05 07:40 UTC (permalink / raw)
  To: Pgsql-admin <[email protected]>

Hi,

Need help with replication setup, pg_basebackup failing with:

pg_basebackup -P -R -X stream -c fast -h <node_name> -U <user_name> -p <port#> -D  <dat_location> -v
Password:
pg_basebackup: initiating base backup, waiting for checkpoint to complete
pg_basebackup: checkpoint completed
pg_basebackup: write-ahead log start point: 6/67000028 on timeline 2
pg_basebackup: starting background WAL receiver
pg_basebackup: created temporary replication slot "pg_basebackup_3720137"
pg_basebackup: error: could not create directory "......": File exists
pg_basebackup: removing contents of data directory "............"
pg_basebackup: changes to tablespace directories will not be undone



Kind Regards
Samir

IMPORTANT NOTE: FUJIFILM Business Innovation Corp.'s and its affiliates' email transmission, including any attachments, is private and confidential and may contain legally privileged information. It is for the addressee's attention only. If you are not the intended recipient and have received this transmission, you must not use, edit, print, copy or disclose its contents to any person or disseminate the information contained herein or hereto attached, and you must notify sender immediately by return email and delete this transmission from your system. Any confidentiality, privilege or copyright is not waived or lost because this e-mail has been sent to you in error. We have used reasonable efforts to protect this transmission from computer viruses and other malicious software, but no warranty is made and the sender takes no responsibility for any loss or damage incurred from using this email or the information contained in this email.


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pg_basebackup: error: could not create directory
@ 2024-09-05 07:44  Muhammad Usman Khan <[email protected]>
  parent: Samir Mamun <[email protected]>
  2 siblings, 0 replies; 5+ messages in thread

From: Muhammad Usman Khan @ 2024-09-05 07:44 UTC (permalink / raw)
  To: Samir Mamun <[email protected]>; +Cc: Pgsql-admin <[email protected]>

Hi,
Kindly check if the destination directory is empty and if not then first
clear the directory and then run the command again.



On Thu, 5 Sept 2024 at 12:40, Samir Mamun <[email protected]>
wrote:

> Hi,
>
>
>
> Need help with replication setup, pg_basebackup failing with:
>
>
>
> pg_basebackup -P -R -X stream -c fast -h <node_name> -U <user_name> -p
> <port#> -D  <dat_location> -v
>
> Password:
>
> pg_basebackup: initiating base backup, waiting for checkpoint to complete
>
> pg_basebackup: checkpoint completed
>
> pg_basebackup: write-ahead log start point: 6/67000028 on timeline 2
>
> pg_basebackup: starting background WAL receiver
>
> pg_basebackup: created temporary replication slot "pg_basebackup_3720137"
>
> pg_basebackup: error: could not create directory "……": File exists
>
> pg_basebackup: removing contents of data directory "…………"
>
> pg_basebackup: changes to tablespace directories will not be undone
>
>
>
>
>
>
>
> Kind Regards
>
> Samir
> IMPORTANT NOTE: FUJIFILM Business Innovation Corp.'s and its affiliates'
> email transmission, including any attachments, is private and confidential
> and may contain legally privileged information. It is for the addressee's
> attention only. If you are not the intended recipient and have received
> this transmission, you must not use, edit, print, copy or disclose its
> contents to any person or disseminate the information contained herein or
> hereto attached, and you must notify sender immediately by return email and
> delete this transmission from your system. Any confidentiality, privilege
> or copyright is not waived or lost because this e-mail has been sent to you
> in error. We have used reasonable efforts to protect this transmission from
> computer viruses and other malicious software, but no warranty is made and
> the sender takes no responsibility for any loss or damage incurred from
> using this email or the information contained in this email.
>


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pg_basebackup: error: could not create directory
@ 2024-09-05 07:51  ajit wangkhem <[email protected]>
  parent: Samir Mamun <[email protected]>
  2 siblings, 0 replies; 5+ messages in thread

From: ajit wangkhem @ 2024-09-05 07:51 UTC (permalink / raw)
  To: Samir Mamun <[email protected]>; +Cc: Pgsql-admin <[email protected]>

Use a simple line if you take base backup on another machine (pg_basebackup
-h 192.168.X.X -U replicauser -D p:\postgresql\X.X\data\ -Xs -v -P.
If you used in a directory used (pg_basebackup -h 127.0.0.1 -U replicauser
-D E:\backup -v -P --format=tar --gzip)

On Thu, Sep 5, 2024 at 1:11 PM Samir Mamun <[email protected]>
wrote:

> Hi,
>
>
>
> Need help with replication setup, pg_basebackup failing with:
>
>
>
> pg_basebackup -P -R -X stream -c fast -h <node_name> -U <user_name> -p
> <port#> -D  <dat_location> -v
>
> Password:
>
> pg_basebackup: initiating base backup, waiting for checkpoint to complete
>
> pg_basebackup: checkpoint completed
>
> pg_basebackup: write-ahead log start point: 6/67000028 on timeline 2
>
> pg_basebackup: starting background WAL receiver
>
> pg_basebackup: created temporary replication slot "pg_basebackup_3720137"
>
> pg_basebackup: error: could not create directory "……": File exists
>
> pg_basebackup: removing contents of data directory "…………"
>
> pg_basebackup: changes to tablespace directories will not be undone
>
>
>
>
>
>
>
> Kind Regards
>
> Samir
> IMPORTANT NOTE: FUJIFILM Business Innovation Corp.'s and its affiliates'
> email transmission, including any attachments, is private and confidential
> and may contain legally privileged information. It is for the addressee's
> attention only. If you are not the intended recipient and have received
> this transmission, you must not use, edit, print, copy or disclose its
> contents to any person or disseminate the information contained herein or
> hereto attached, and you must notify sender immediately by return email and
> delete this transmission from your system. Any confidentiality, privilege
> or copyright is not waived or lost because this e-mail has been sent to you
> in error. We have used reasonable efforts to protect this transmission from
> computer viruses and other malicious software, but no warranty is made and
> the sender takes no responsibility for any loss or damage incurred from
> using this email or the information contained in this email.
>


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pg_basebackup: error: could not create directory
@ 2024-09-05 13:00  Ron Johnson <[email protected]>
  parent: Samir Mamun <[email protected]>
  2 siblings, 1 reply; 5+ messages in thread

From: Ron Johnson @ 2024-09-05 13:00 UTC (permalink / raw)
  To: Pgsql-admin <[email protected]>

On Thu, Sep 5, 2024 at 3:41 AM Samir Mamun <[email protected]>
wrote:

> Hi,
>
>
>
> Need help with replication setup, pg_basebackup failing with:
>
>
>
> pg_basebackup -P -R -X stream -c fast -h <node_name> -U <user_name> -p
> <port#> -D  <dat_location> -v
>
> Password:
>
> pg_basebackup: initiating base backup, waiting for checkpoint to complete
>
> pg_basebackup: checkpoint completed
>
> pg_basebackup: write-ahead log start point: 6/67000028 on timeline 2
>
> pg_basebackup: starting background WAL receiver
>
> pg_basebackup: created temporary replication slot "pg_basebackup_3720137"
>
> pg_basebackup: error: could not create directory "……": File exists
>

It's explicitly telling you the problem: a file already exists in the
replicated $PGDATA.


> pg_basebackup: removing contents of data directory "…………"
>
> pg_basebackup: changes to tablespace directories will not be undone
>


-- 
Death to America, and butter sauce.
Iraq lobster!


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pg_basebackup: error: could not create directory
@ 2024-09-05 13:49  rams nalabolu <[email protected]>
  parent: Ron Johnson <[email protected]>
  0 siblings, 0 replies; 5+ messages in thread

From: rams nalabolu @ 2024-09-05 13:49 UTC (permalink / raw)
  To: Ron Johnson <[email protected]>; +Cc: Pgsql-admin <[email protected]>

I’m not sure what’s the use case. But if you are taking the base backup
with default format you need to make sure all tablespace directories should
be empty as it tries to create backup file under it. So try with tar format
and make sure -D directory is empty then it will create all tablespace
backups in that directory with <<tablespace our>>.tar and you should be
good.
While doing PITR or setting HA server you need to create table space
directory on target server and copy the corresponding tar file and untar
it. You will get tablespace directory information from tablespace_map file
from backup.



On Thu, Sep 5, 2024 at 8:00 AM Ron Johnson <[email protected]> wrote:

> On Thu, Sep 5, 2024 at 3:41 AM Samir Mamun <[email protected]>
> wrote:
>
>> Hi,
>>
>>
>>
>> Need help with replication setup, pg_basebackup failing with:
>>
>>
>>
>> pg_basebackup -P -R -X stream -c fast -h <node_name> -U <user_name> -p
>> <port#> -D  <dat_location> -v
>>
>> Password:
>>
>> pg_basebackup: initiating base backup, waiting for checkpoint to complete
>>
>> pg_basebackup: checkpoint completed
>>
>> pg_basebackup: write-ahead log start point: 6/67000028 on timeline 2
>>
>> pg_basebackup: starting background WAL receiver
>>
>> pg_basebackup: created temporary replication slot "pg_basebackup_3720137"
>>
>> pg_basebackup: error: could not create directory "……": File exists
>>
>
> It's explicitly telling you the problem: a file already exists in the
> replicated $PGDATA.
>
>
>> pg_basebackup: removing contents of data directory "…………"
>>
>> pg_basebackup: changes to tablespace directories will not be undone
>>
>
>
> --
> Death to America, and butter sauce.
> Iraq lobster!
>


^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2024-09-05 13:49 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-09-05 07:40 pg_basebackup: error: could not create directory Samir Mamun <[email protected]>
2024-09-05 07:44 ` Muhammad Usman Khan <[email protected]>
2024-09-05 07:51 ` ajit wangkhem <[email protected]>
2024-09-05 13:00 ` Ron Johnson <[email protected]>
2024-09-05 13:49   ` rams nalabolu <[email protected]>

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