pg_basebackup fails with Could not stat file or directory "./.pg_hba.conf.un~" - Mailing list pgsql-bugs

From Stephens, Gary
Subject pg_basebackup fails with Could not stat file or directory "./.pg_hba.conf.un~"
Date
Msg-id DM4PR11MB5328327445FFA1FE28426198F0B79@DM4PR11MB5328.namprd11.prod.outlook.com
Whole thread Raw
Responses Re: pg_basebackup fails with Could not stat file or directory "./.pg_hba.conf.un~"
List pgsql-bugs

Hi,

 

I’m writing to report a bug with pg_basebackup. It fails with this error:

 

pg_basebackup: error: could not initiate base backup: ERROR:  could not stat file or directory "./.pg_hba.conf.un~": Permission denied

 

The file in question is a temporary file created by vim, and has the same permissions and security context as the file that it was editing (pg_hba.conf).

 

It's unclear to me why pg_basebackup is trying to read this file. It's also unclear why it's failing when it does try to read it, since the file has the same permissions and security context that should allow the instance to read it (even though the backup really shouldn’t need to read it).

 

The directory where it resides is /var/lib/pgsql/data (this is where pg_hba.conf resides as well).

 

Please note: After I removed the file, the backup ran normally. I have not tested to see whether other temp files in the same directory would cause a similar failure.

 

Database version:

postgres=# select version();

                                                   version

-------------------------------------------------------------------------------------------------------------

PostgreSQL 13.7 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-10), 64-bit

 

Thanks,

 

Gary Stephens

Enterprise Holdings, Incorporated




CONFIDENTIALITY NOTICE: This e-mail and any files transmitted with it are intended solely for the use of the individual or entity to whom they are addressed and may contain confidential and privileged information protected by law. If you received this e-mail in error, any review, use, dissemination, distribution, or copying of the e-mail is strictly prohibited. Please notify the sender immediately by return e-mail and delete all copies from your system.


pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #17811: Replacing an underlying view breaks OLD/NEW tuple when accessing it via upper-level view
Next
From: "David G. Johnston"
Date:
Subject: Re: pg_basebackup fails with Could not stat file or directory "./.pg_hba.conf.un~"