Thread: post-bootstrap init : permission denied pg_description

post-bootstrap init : permission denied pg_description

From
François SIMON
Date:
Hello All,

I am trying to install PostgreSQL 16.4 on AIX 7.1.

I get an error at initdb step :

performing post-bootstrap initialization ... 2024-09-12 12:09:07.075 CEST [14745748] FATAL:  permission denied for
tablepg_description 

This version of PostgreSQL was build on this machine with
IBM XL C compiler 10.1 :

export OBJECT_MODE=64
$srcdir/configure --prefix=$instdir --without-icu
make
make install

When I run initdb with -n option, I can see that files in
PGDATA directory seem to have expected permissions.

I have tried to install PostgreSQL 15.1, 16.0 and 16.3
but got the same error with all these versions.

Any help would be appreciated.

François



Re: post-bootstrap init : permission denied pg_description

From
Adrian Klaver
Date:
On 9/12/24 03:58, François SIMON wrote:
> Hello All,
> 
> I am trying to install PostgreSQL 16.4 on AIX 7.1.
> 
> I get an error at initdb step :
> 
> performing post-bootstrap initialization ... 2024-09-12 12:09:07.075 CEST [14745748] FATAL:  permission denied for
tablepg_description
 

That looks like an issue with the user you are running the command as.

What user is that?

What is the complete initdb command you used?

> 
> This version of PostgreSQL was build on this machine with
> IBM XL C compiler 10.1 :
> 
> export OBJECT_MODE=64
> $srcdir/configure --prefix=$instdir --without-icu
> make
> make install
> 
> When I run initdb with -n option, I can see that files in
> PGDATA directory seem to have expected permissions.
> 
> I have tried to install PostgreSQL 15.1, 16.0 and 16.3
> but got the same error with all these versions.
> 
> Any help would be appreciated.
> 
> François
> 
> 

-- 
Adrian Klaver
adrian.klaver@aklaver.com




Re: post-bootstrap init : permission denied pg_description

From
François SIMON
Date:
Le Thu, Sep 12, 2024 at 08:20:59AM -0700, Adrian Klaver a écrit :
> On 9/12/24 03:58, François SIMON wrote:
> > Hello All,
> > 
> > I am trying to install PostgreSQL 16.4 on AIX 7.1.
> > 
> > I get an error at initdb step :
> > 
> > performing post-bootstrap initialization ... 2024-09-12 12:09:07.075 CEST [14745748] FATAL:  permission denied for
tablepg_description
 
> 
> That looks like an issue with the user you are running the command as.
> 
> What user is that?

A normal user account.

> What is the complete initdb command you used?

I use no option.

PGDATA is set to a subdirectory of $HOME for this user.
$HOME is on a NFS volume.

# export PGDATA=$HOME/data
# initdb
The files belonging to this database system will be owned by user "fsi".      
This user must also own the server process.                                        
                                                                                   
The database cluster will be initialized with locale "C".                          
The default database encoding has accordingly been set to "SQL_ASCII".             
The default text search configuration will be set to "english".                    
                                                                                   
Data page checksums are disabled.                                                  
                                                                                   
creating directory /net/h10/home/fsi/data ... ok                    
creating subdirectories ... ok                                                     
selecting dynamic shared memory implementation ... posix                           
selecting default max_connections ... 100                                          
selecting default shared_buffers ... 128MB                                         
selecting default time zone ... Europe/Paris                                       
creating configuration files ... ok                                                
running bootstrap script ... ok                                                    

Thank you for your help.

François



Re: post-bootstrap init : permission denied pg_description

From
Adrian Klaver
Date:
On 9/12/24 09:03, François SIMON wrote:
> Le Thu, Sep 12, 2024 at 08:20:59AM -0700, Adrian Klaver a écrit :
>> On 9/12/24 03:58, François SIMON wrote:
>>> Hello All,

> A normal user account.

Is that the account you did the make install as?


> PGDATA is set to a subdirectory of $HOME for this user.
> $HOME is on a NFS volume.

Have you read this?:

https://www.postgresql.org/docs/16/creating-cluster.html#CREATING-CLUSTER-FILESYSTEM



> creating directory /net/h10/home/fsi/data ... ok
> creating subdirectories ... ok
> selecting dynamic shared memory implementation ... posix
> selecting default max_connections ... 100
> selecting default shared_buffers ... 128MB
> selecting default time zone ... Europe/Paris
> creating configuration files ... ok
> running bootstrap script ... ok

Can you add the complete portion of the output that threw the error?


> 
> Thank you for your help.
> 
> François

-- 
Adrian Klaver
adrian.klaver@aklaver.com




Re: post-bootstrap init : permission denied pg_description

From
François SIMON
Date:
Le Thu, Sep 12, 2024 at 06:03:47PM +0200, François SIMON a écrit :
> Le Thu, Sep 12, 2024 at 08:20:59AM -0700, Adrian Klaver a écrit :
> > On 9/12/24 03:58, François SIMON wrote:
> > > Hello All,
> > > 
> > > I am trying to install PostgreSQL 16.4 on AIX 7.1.
> > > 
> > > I get an error at initdb step :
> > > 
> > > performing post-bootstrap initialization ... 2024-09-12 12:09:07.075 CEST [14745748] FATAL:  permission denied
fortable pg_description
 
> > 
> > That looks like an issue with the user you are running the command as.
> > 
> > What user is that?
> 
> A normal user account.
> 

I think the environment is ok because it works with an initdb
built with gcc.

# ls -l /prod/postgresql
V16.3 -> V16.3-build_gcc
V16.3-build_gcc
V16.3-build_xlc

# initdb
Success. You can start the database...

# ln -sf V16.3-build_xlc /prod/postgresl/V16.3
V16.3 -> V16.3-build_xlc
V16.3-build_gcc
V16.3-build_xlc

# pg_ctl -l logfile start
server started

# psql -d template1
psql (16.3à
Type "help" for help.

template1=# \l
List of databases
Name
--------
postgres
template0
template1
...

So the problem seems to come from xlc, and only at initdb step.
I can see that initdb runs a backend postgres in single user mode.
And this is this backend, when compiled with xlc, that shows :
FATAL:  permission denied for table pg_description

François



Re: post-bootstrap init : permission denied pg_description

From
Adrian Klaver
Date:
On 9/12/24 10:06, François SIMON wrote:
> Le Thu, Sep 12, 2024 at 06:03:47PM +0200, François SIMON a écrit :
>> Le Thu, Sep 12, 2024 at 08:20:59AM -0700, Adrian Klaver a écrit :
>>> On 9/12/24 03:58, François SIMON wrote:
>>>> Hello All,

> So the problem seems to come from xlc, and only at initdb step.
> I can see that initdb runs a backend postgres in single user mode.
> And this is this backend, when compiled with xlc, that shows :
> FATAL:  permission denied for table pg_description

Well this is going to need someone else to troubleshoot as it is out of 
my depth.

> 
> François

-- 
Adrian Klaver
adrian.klaver@aklaver.com




Re: post-bootstrap init : permission denied pg_description

From
François SIMON
Date:
Le Thu, Sep 12, 2024 at 09:52:57AM -0700, Adrian Klaver a écrit :
> On 9/12/24 09:03, François SIMON wrote:
> > $HOME is on a NFS volume.
> 
> Have you read this?:
> 
> https://www.postgresql.org/docs/16/creating-cluster.html#CREATING-CLUSTER-FILESYSTEM

Yes. I understand NFS is OK, but yes I see some warnings.

> > selecting default time zone ... Europe/Paris
> > creating configuration files ... ok
> > running bootstrap script ... ok
> 
> Can you add the complete portion of the output that threw the error?

# initdb
The files belonging to this database system will be owned by user "fsi".
This user must also own the server process.

The database cluster will be initialized with locale "C".
The default database encoding has accordingly been set to "SQL_ASCII".
The default text search configuration will be set to "english".

Data page checksums are disabled.

creating directory /net/h10/home/fsi/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Europe/Paris
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... 2024-09-12 17:38:35.580 CEST [9896122] FATAL:  permission denied for table
pg_description
2024-09-12 17:38:35.580 CEST [9896122] STATEMENT:
        WITH funcdescs AS ( SELECT p.oid as p_oid, o.oid as o_oid, oprname FROM pg_proc p JOIN pg_operator o ON oprcode
=p.oid ) INSERT INTO pg_description   SELECT p_oid, 'pg_proc'::regclass, 0,     'implementation of ' || oprname || '
operator'  FROM funcdescs   WHERE NOT EXISTS (SELECT 1 FROM pg_description    WHERE objoid = p_oid AND classoid =
'pg_proc'::regclass)  AND NOT EXISTS (SELECT 1 FROM pg_description    WHERE objoid = o_oid AND classoid =
'pg_operator'::regclass        AND description LIKE 'deprecated%');
 

child process exited with exit code 1
initdb: removing data directory "/net/h10/home/fsi/data"


François



Re: post-bootstrap init : permission denied pg_description

From
Tom Lane
Date:
=?iso-8859-1?Q?Fran=E7ois?= SIMON <francois.simon@free.fr> writes:
> So the problem seems to come from xlc, and only at initdb step.
> I can see that initdb runs a backend postgres in single user mode.
> And this is this backend, when compiled with xlc, that shows :
> FATAL:  permission denied for table pg_description

Yeah.  This seems like it must be an xlc code-generation bug.
It's got nothing to do with filesystem permissions: you're failing
an ACL check at the logical "table" level, which you should not
be because single-user mode implies superuser permissions.

We do have one buildfarm member building with 64-bit xlc on
AIX 7.1:

https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=hornet&dt=2024-09-11%2003%3A51%3A02

I see that that uses a bunch of odd CFLAGS, but they look like they
are mostly to suppress compiler warnings.  Another important bit of
the recipe for AIX is -D_LARGE_FILES=1, but I'm not sure that that
would have any impact during initdb (since we're not dealing with
any large files at that point).

You could perhaps try different -O optimization levels.  Also
make sure your xlc is up-to-date.

            regards, tom lane



Re: post-bootstrap init : permission denied pg_description

From
François SIMON
Date:
Le Thu, Sep 12, 2024 at 01:38:11PM -0400, Tom Lane a écrit :
> =?iso-8859-1?Q?Fran=E7ois?= SIMON <francois.simon@free.fr> writes:
> > So the problem seems to come from xlc, and only at initdb step.
> > I can see that initdb runs a backend postgres in single user mode.
> > And this is this backend, when compiled with xlc, that shows :
> > FATAL:  permission denied for table pg_description
> 
> Yeah.  This seems like it must be an xlc code-generation bug.
> It's got nothing to do with filesystem permissions: you're failing
> an ACL check at the logical "table" level, which you should not
> be because single-user mode implies superuser permissions.
> 
> We do have one buildfarm member building with 64-bit xlc on
> AIX 7.1:
> 
> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=hornet&dt=2024-09-11%2003%3A51%3A02
> 
> I see that that uses a bunch of odd CFLAGS, but they look like they
> are mostly to suppress compiler warnings.  Another important bit of
> the recipe for AIX is -D_LARGE_FILES=1, but I'm not sure that that
> would have any impact during initdb (since we're not dealing with
> any large files at that point).
> 
> You could perhaps try different -O optimization levels.  Also
> make sure your xlc is up-to-date.

Thank you for all this information.

Unfortunately I haven't obtained any better results yet.

I tried -O2, -O3, with or without -D_LARGE_FILES=1, xlc_r instead
of xlc, and all the same flags as the buildfarm member.

I will try with another version of xlc if possible.

François

> 
>             regards, tom lane