Re: pg_basebackup permission denied error

From: Gokhan Demir <demirgokhan(at)gmail(dot)com>
To: Günce Kaya <guncekaya14(at)gmail(dot)com>
Cc: Shreeyansh Dba <shreeyansh2014(at)gmail(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: pg_basebackup permission denied error
Date: 2017-11-09 08:55:21
Message-ID: CAOBOzNpNroTAHVRp3H+dkWTn1W_P-1aKB-oW8_Lzuj7H1o+aeg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi Günce,

There must be no "data" directory on the target server, which the
pg_basebackup command is run on, (this is a precaution set by postgreSQL to
force admins to make sure no data will be overwritten) and the owner of
parent directory of this "data" director must also be postgres user and
postgres user must have necessary permissions on the parent directory. So,
I wouldn't suggest using "/data" if it is right below the "/" (root)
directory if I understand correctly.

Issue might be caused because of the above situation. Just my two cents..

Gokhan.

On Thu, Nov 9, 2017 at 11:07 AM, Günce Kaya <guncekaya14(at)gmail(dot)com> wrote:

> Hi again,
>
> I have created rep user like;
>
> CREATE USER rep REPLICATION LOGIN ENCRYPTED PASSWORD 'xxxx';
>
> So, user having replication permission. Maybe I miss something about this
> situation. Is there anything additional for that?
>
> Regards,
> Gunce
>
> On Thu, Nov 9, 2017 at 8:49 AM, Shreeyansh Dba <shreeyansh2014(at)gmail(dot)com>
> wrote:
>
>>
>>
>> On Thu, Nov 9, 2017 at 6:27 AM, Shreeyansh Dba <shreeyansh2014(at)gmail(dot)com>
>> wrote:
>>
>>>
>>>
>>> On Thu, Nov 9, 2017 at 6:16 AM, Günce Kaya <guncekaya14(at)gmail(dot)com>
>>> wrote:
>>>
>>>> Hello,
>>>>
>>>> I'm getting error when using pg_basebackup as bellow;
>>>>
>>>> pg_basebackup: could not create directory "/data": Permission denied
>>>>
>>>> I couldn't overcome with that problem. Any suggestion would be
>>>> appreciated.
>>>>
>>>> Regards,
>>>> Gunce Kaya
>>>>
>>>> Linkedin <https://tr.linkedin.com/in/guncekaya> - Twitter
>>>> <https://twitter.com/gguncesi> - Blog
>>>> <http://www.guncekaya.blogspot.com.tr/>
>>>>
>>>
>>> Hi Gunce Kaya,
>>>
>>> /data -- directory requires postgres user permission.
>>>
>>> In addition to this, the user might not be a valid DB user having enough
>> privileges in order to perform backup having entry in pg_hba file.
>>
>> https://shreeyansh.com/
>> [image: http://www.shreeyansh.com] <http://www.shreeyansh.com>
>>
>
>
>
> --
> Gunce Kaya
>
> Linkedin <https://tr.linkedin.com/in/guncekaya> - Twitter
> <https://twitter.com/gguncesi> - Blog
> <http://www.guncekaya.blogspot.com.tr/>
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Shreeyansh Dba 2017-11-09 09:04:27 Re: pg_basebackup permission denied error
Previous Message Gokhan Demir 2017-11-09 08:40:31 PostgreSQL WAL file issue