Thread: BUG #2558: initDB failed to run

BUG #2558: initDB failed to run

From
"Dror"
Date:
The following bug has been logged online:

Bug reference:      2558
Logged by:          Dror
Email address:      dror_b@hotmail.com
PostgreSQL version: 8.1.4
Operating system:   win 2003
Description:        initDB failed to run
Details:

On one of mine win 2003 machine ( on any other win2003 machine everything
work as expected), I failed to install postgress in service mode using the
MSI package , after short investigation i found a failure in the initDB
phase, so I install postgress without running the initDB and then ran the
initDB manually with the debug option set, (The user is not an
Administrator).
The strange thing is that EnterpriseDB which is based on postgres works
fine.
The problem seems to be in the initDB.c source file in the
test_connections(void) and test_buffers(void) functions.
Here is the procedures and the output of the initDB.

After the installation I did:

- Runas /user:V_MYUSER CMD

- initDB -D "E:\Postgres\Data" -d -U V_MYUSER

Running in debug mode.
The files belonging to this database system will be owned by user
"V_MYUSER".
This user must also own the server process.

The database cluster will be initialized with locale English_United
States.1252.

fixing permissions on existing directory E:/Postgres\Data ... ok
creating directory E:/Postgres\Data/global ... ok
creating directory E:/Postgres\Data/pg_xlog ... ok
creating directory E:/Postgres\Data/pg_xlog/archive_status ... ok
creating directory E:/Postgres\Data/pg_clog ... ok
creating directory E:/Postgres\Data/pg_subtrans ... ok
creating directory E:/Postgres\Data/pg_twophase ... ok
creating directory E:/Postgres\Data/pg_multixact/members ... ok
creating directory E:/Postgres\Data/pg_multixact/offsets ... ok
creating directory E:/Postgres\Data/base ... ok
creating directory E:/Postgres\Data/base/1 ... ok
creating directory E:/Postgres\Data/pg_tblspc ... ok
selecting default max_connections ... Access is denied.
Access is denied.
Access is denied.
Access is denied.
Access is denied.
Access is denied.
10
selecting default shared_buffers ... Access is denied.
Access is denied.
Access is denied.
Access is denied.
Access is denied.
Access is denied.
Access is denied.
Access is denied.
Access is denied.
Access is denied.
Access is denied.
50
creating configuration files ... ok
creating template1 database in E:/Postgres\Data/base/1 ... VERSION=8.1.4
PGDATA=E:/Postgres\Data
share_path=E:/Program Files/postgres/Database/share
PGPATH=E:/Program Files/postgres/Database/bin
POSTGRES_SUPERUSERNAME=V_MYUSER
POSTGRES_BKI=E:/Program Files/postgres/Database/share/postgres.bki
POSTGRES_DESCR=E:/Program
Files/postgres/Database/share/postgres.description
POSTGRESQL_CONF_SAMPLE=E:/Program
Files/postgres/Database/share/postgresql.conf.sample
PG_HBA_SAMPLE=E:/Program Files/postgres/Database/share/pg_hba.conf.sample
PG_IDENT_SAMPLE=E:/Program
Files/postgres/Database/share/pg_ident.conf.sample
DEBUG:  TZ "Asia/Jerusalem" matches Windows timezone "Jerusalem Standard
Time"
DEBUG:  invoking IpcMemoryCreate(size=1327104)
LOG:  database system was shut down at 2006-08-01 14:36:37 Jerusalem
Standard Time
LOG:  checkpoint record is at 0/20
LOG:  redo record is at 0/20; undo record is at 0/20; shutdown TRUE
LOG:  next transaction ID: 3; next OID: 10000
LOG:  next MultiXactId: 1; next MultiXactOffset: 0
LOG:  database system is ready
DEBUG:  StartTransaction
DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR,
xid/subid/cid: 1/1/0, nestlvl: 1, children: <>
DEBUG:  start transaction
DEBUG:  creating bootstrap relation pg_proc 1255
DEBUG:  column proname name



Regards
DROR

Re: BUG #2558: initDB failed to run

From
Jim Nasby
Date:
Does V_MYUSER have access to the PGDATA directory? This might be an
issue of it not having access to the directory you're running initdb
from...

On Aug 1, 2006, at 12:57 PM, Dror wrote:
> The following bug has been logged online:
>
> Bug reference:      2558
> Logged by:          Dror
> Email address:      dror_b@hotmail.com
> PostgreSQL version: 8.1.4
> Operating system:   win 2003
> Description:        initDB failed to run
> Details:
>
> On one of mine win 2003 machine ( on any other win2003 machine
> everything
> work as expected), I failed to install postgress in service mode
> using the
> MSI package , after short investigation i found a failure in the
> initDB
> phase, so I install postgress without running the initDB and then
> ran the
> initDB manually with the debug option set, (The user is not an
> Administrator).
> The strange thing is that EnterpriseDB which is based on postgres
> works
> fine.
> The problem seems to be in the initDB.c source file in the
> test_connections(void) and test_buffers(void) functions.
> Here is the procedures and the output of the initDB.
>
> After the installation I did:
>
> - Runas /user:V_MYUSER CMD
>
> - initDB -D "E:\Postgres\Data" -d -U V_MYUSER
>
> Running in debug mode.
> The files belonging to this database system will be owned by user
> "V_MYUSER".
> This user must also own the server process.
>
> The database cluster will be initialized with locale English_United
> States.1252.
>
> fixing permissions on existing directory E:/Postgres\Data ... ok
> creating directory E:/Postgres\Data/global ... ok
> creating directory E:/Postgres\Data/pg_xlog ... ok
> creating directory E:/Postgres\Data/pg_xlog/archive_status ... ok
> creating directory E:/Postgres\Data/pg_clog ... ok
> creating directory E:/Postgres\Data/pg_subtrans ... ok
> creating directory E:/Postgres\Data/pg_twophase ... ok
> creating directory E:/Postgres\Data/pg_multixact/members ... ok
> creating directory E:/Postgres\Data/pg_multixact/offsets ... ok
> creating directory E:/Postgres\Data/base ... ok
> creating directory E:/Postgres\Data/base/1 ... ok
> creating directory E:/Postgres\Data/pg_tblspc ... ok
> selecting default max_connections ... Access is denied.
> Access is denied.
> Access is denied.
> Access is denied.
> Access is denied.
> Access is denied.
> 10
> selecting default shared_buffers ... Access is denied.
> Access is denied.
> Access is denied.
> Access is denied.
> Access is denied.
> Access is denied.
> Access is denied.
> Access is denied.
> Access is denied.
> Access is denied.
> Access is denied.
> 50
> creating configuration files ... ok
> creating template1 database in E:/Postgres\Data/base/1 ...
> VERSION=8.1.4
> PGDATA=E:/Postgres\Data
> share_path=E:/Program Files/postgres/Database/share
> PGPATH=E:/Program Files/postgres/Database/bin
> POSTGRES_SUPERUSERNAME=V_MYUSER
> POSTGRES_BKI=E:/Program Files/postgres/Database/share/postgres.bki
> POSTGRES_DESCR=E:/Program
> Files/postgres/Database/share/postgres.description
> POSTGRESQL_CONF_SAMPLE=E:/Program
> Files/postgres/Database/share/postgresql.conf.sample
> PG_HBA_SAMPLE=E:/Program Files/postgres/Database/share/
> pg_hba.conf.sample
> PG_IDENT_SAMPLE=E:/Program
> Files/postgres/Database/share/pg_ident.conf.sample
> DEBUG:  TZ "Asia/Jerusalem" matches Windows timezone "Jerusalem
> Standard
> Time"
> DEBUG:  invoking IpcMemoryCreate(size=1327104)
> LOG:  database system was shut down at 2006-08-01 14:36:37 Jerusalem
> Standard Time
> LOG:  checkpoint record is at 0/20
> LOG:  redo record is at 0/20; undo record is at 0/20; shutdown TRUE
> LOG:  next transaction ID: 3; next OID: 10000
> LOG:  next MultiXactId: 1; next MultiXactOffset: 0
> LOG:  database system is ready
> DEBUG:  StartTransaction
> DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR,
> xid/subid/cid: 1/1/0, nestlvl: 1, children: <>
> DEBUG:  start transaction
> DEBUG:  creating bootstrap relation pg_proc 1255
> DEBUG:  column proname name
>
>
>
> Regards
> DROR
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org
>

--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

Re: BUG #2558: initDB failed to run

From
"Jim Nasby"
Date:
Please cc the list so others can learn.
=20
Yes, I think a patch for this was recently committed. I know it was at leas=
t discussed somewhere...

-----Original Message-----
From: dror [mailto:dror_b@hotmail.com]
Sent: Wednesday, August 09, 2006 2:17 AM
To: Jim Nasby
Subject: RE: [BUGS] BUG #2558: initDB failed to run


Hi Jim,
I have already solved the problem, as it is mentioned before, the problem w=
as that on some windows 2003 machine there is no access to the nul device f=
or non administrators users.
The initDB.c redirect the output to > DEVNUL which on windows defined has "=
nul".
I changed the initDB source by canceling the redirection.
I think this is the easiest way.
I could also solve it by open a file , give W permission to the user to thi=
s file and redirect the output to that file.
=20
=20
I think postgres must solve this issue, as more and more windows 2003 machi=
ne will be discovered with this limitation which prevent from the users to =
install the DB.
Attached you can find the fixed initDB.c file
Regards
Dror






  _____=20=20


> CC: pgsql-bugs@postgresql.org
> From: jnasby@pervasive.com
> Subject: Re: [BUGS] BUG #2558: initDB failed to run
> Date: Tue, 8 Aug 2006 12:30:56 -0500
> To: dror_b@hotmail.com
>=20
> Does V_MYUSER have access to the PGDATA directory? This might be an=20=20
> issue of it not having access to the directory you're running initdb=20=
=20
> from...
>=20
> On Aug 1, 2006, at 12:57 PM, Dror wrote:
> > The following bug has been logged online:
> >
> > Bug reference:      2558
> > Logged by:          Dror
> > Email address:      dror_b@hotmail.com
> > PostgreSQL version: 8.1.4
> > Operating system:   win 2003
> > Description:        initDB failed to run
> > Details:
> >
> > On one of mine win 2003 machine ( on any other win2003 machine=20=20
> > everything
> > work as expected), I failed to install postgress in service mode=20=20
> > using the
> > MSI package , after short investigation i found a failure in the=20=20
> > initDB
> > phase, so I install postgress without running the initDB and then=20=20
> > ran the
> > initDB manually with the debug option set, (The user is not an
> > Administrator).
> > The strange thing is that EnterpriseDB which is based on postgres=20=20
> > works
> > fine.
> > The problem seems to be in the initDB.c source file in the
> > test_connections(void) and test_buffers(void) functions.
> > Here is the procedures and the output of the initDB.
> >
> > After the installation I did:
> >
> > - Runas /user:V_MYUSER CMD
> >
> > - initDB -D "E:\Postgres\Data" -d -U V_MYUSER
> >
> > Running in debug mode.
> > The files belonging to this database system will be owned by user
> > "V_MYUSER".
> > This user must also own the server process.
> >
> > The database cluster will be initialized with locale English_United
> > States.1252.
> >
> > fixing permissions on existing directory E:/Postgres\Data ... ok
> > creating directory E:/Postgres\Data/global ... ok
> > creating directory E:/Postgres\Data/pg_xlog ... ok
> > creating directory E:/Postgres\Data/pg_xlog/archive_status ... ok
> > creating directory E:/Postgres\Data/pg_clog ... ok
> > creating directory E:/Postgres\Data/pg_subtrans ... ok
> > creating directory E:/Postgres\Data/pg_twophase ... ok
> > creating directory E:/Postgres\Data/pg_multixact/members ... ok
> > creating directory E:/Postgres\Data/pg_multixact/offsets ... ok
> > creating directory E:/Postgres\Data/base ... ok
> > creating directory E:/Postgres\Data/base/1 ... ok
> > creating directory E:/Postgres\Data/pg_tblspc ... ok
> > selecting default max_connections ... Access is denied.
> > Access is denied.
> > Access is denied.
> > Access is denied.
> > Access is denied.
> > Access is denied.
> > 10
> > selecting default shared_buffers ... Access is denied.
> > Access is denied.
> > Access is denied.
> > Access is denied.
> > Access is denied.
> > Access is denied.
> > Access is denied.
> > Access is denied.
> > Access is denied.
> > Access is denied.
> > Access is denied.
> > 50
> > creating configuration files ... ok
> > creating template1 database in E:/Postgres\Data/base/1 ...=20=20
> > VERSION=3D8.1.4
> > PGDATA=3DE:/Postgres\Data
> > share_path=3DE:/Program Files/postgres/Database/share
> > PGPATH=3DE:/Program Files/postgres/Database/bin
> > POSTGRES_SUPERUSERNAME=3DV_MYUSER
> > POSTGRES_BKI=3DE:/Program Files/postgres/Database/share/postgres.bki
> > POSTGRES_DESCR=3DE:/Program
> > Files/postgres/Database/share/postgres.description
> > POSTGRESQL_CONF_SAMPLE=3DE:/Program
> > Files/postgres/Database/share/postgresql.conf.sample
> > PG_HBA_SAMPLE=3DE:/Program Files/postgres/Database/share/=20
> > pg_hba.conf.sample
> > PG_IDENT_SAMPLE=3DE:/Program
> > Files/postgres/Database/share/pg_ident.conf.sample
> > DEBUG:  TZ "Asia/Jerusalem" matches Windows timezone "Jerusalem=20=20
> > Standard
> > Time"
> > DEBUG:  invoking IpcMemoryCreate(size=3D1327104)
> > LOG:  database system was shut down at 2006-08-01 14:36:37 Jerusalem
> > Standard Time
> > LOG:  checkpoint record is at 0/20
> > LOG:  redo record is at 0/20; undo record is at 0/20; shutdown TRUE
> > LOG:  next transaction ID: 3; next OID: 10000
> > LOG:  next MultiXactId: 1; next MultiXactOffset: 0
> > LOG:  database system is ready
> > DEBUG:  StartTransaction
> > DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR,
> > xid/subid/cid: 1/1/0, nestlvl: 1, children: <>
> > DEBUG:  start transaction
> > DEBUG:  creating bootstrap relation pg_proc 1255
> > DEBUG:  column proname name
> >
> >
> >
> > Regards
> > DROR
> >
> > ---------------------------(end of=20=20
> > broadcast)---------------------------
> > TIP 4: Have you searched our list archives?
> >
> >                http://archives.postgresql.org
> >
>=20
> --
> Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
> Pervasive Software      http://pervasive.com    work: 512-231-6117
> vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461
>=20
>=20



  _____=20=20

Express yourself instantly with Windows Live Messenger! Windows Live Messen=
ger! <http://imagine-msn.com/messenger/launch80/default.aspx?locale=3Den-us=
&source=3Djoinmsncom/messenger>=20=20

Re: BUG #2558: initDB failed to run

From
"dror"
Date:
It was discussed but never committed to the CVS (as much as I know).
=20


Subject: RE: [BUGS] BUG #2558: initDB failed to runDate: Wed, 9 Aug 2006 13=
:25:38 -0500From: jnasby@pervasive.comTo: dror_b@hotmail.comCC: pgsql-bugs@=
postgresql.org



Please cc the list so others can learn.
=20
Yes, I think a patch for this was recently committed. I know it was at leas=
t discussed somewhere...

-----Original Message-----From: dror [mailto:dror_b@hotmail.com]Sent: Wedne=
sday, August 09, 2006 2:17 AMTo: Jim NasbySubject: RE: [BUGS] BUG #2558: in=
itDB failed to runHi Jim,I have already solved the problem, as it is mentio=
ned before, the problem was that on some windows 2003 machine there is no a=
ccess to the nul device for non administrators users.The initDB.c redirect =
the output to > DEVNUL which on windows defined has "nul".I changed the ini=
tDB source by canceling the redirection.I think this is the easiest way.I c=
ould also solve it by open a file , give W permission to the user to this f=
ile and redirect the output to that file.  I think postgres must solve this=
 issue, as more and more windows 2003 machine will be discovered with this =
limitation which prevent from the users to install the DB.Attached you can =
find the fixed initDB.c fileRegardsDror

> CC: pgsql-bugs@postgresql.org> From: jnasby@pervasive.com> Subject: Re: [=
BUGS] BUG #2558: initDB failed to run> Date: Tue, 8 Aug 2006 12:30:56 -0500=
> To: dror_b@hotmail.com> > Does V_MYUSER have access to the PGDATA directo=
ry? This might be an  > issue of it not having access to the directory you'=
re running initdb  > from...> > On Aug 1, 2006, at 12:57 PM, Dror wrote:> >=
 The following bug has been logged online:> >> > Bug reference:      2558> =
> Logged by:          Dror> > Email address:      dror_b@hotmail.com> > Pos=
tgreSQL version: 8.1.4> > Operating system:   win 2003> > Description:     =
   initDB failed to run> > Details:> >> > On one of mine win 2003 machine (=
 on any other win2003 machine  > > everything> > work as expected), I faile=
d to install postgress in service mode  > > using the> > MSI package , afte=
r short investigation i found a failure in the  > > initDB> > phase, so I i=
nstall postgress without running the initDB and then  > > ran the> > initDB=
 manually with the debug option set, (The user is not an> > Administrator).=
> > The strange thing is that EnterpriseDB which is based on postgres  > > =
works> > fine.> > The problem seems to be in the initDB.c source file in th=
e> > test_connections(void) and test_buffers(void) functions.> > Here is th=
e procedures and the output of the initDB.> >> > After the installation I d=
id:> >> > - Runas /user:V_MYUSER CMD> >> > - initDB -D "E:\Postgres\Data" -=
d -U V_MYUSER> >> > Running in debug mode.> > The files belonging to this d=
atabase system will be owned by user> > "V_MYUSER".> > This user must also =
own the server process.> >> > The database cluster will be initialized with=
 locale English_United> > States.1252.> >> > fixing permissions on existing=
 directory E:/Postgres\Data ... ok> > creating directory E:/Postgres\Data/g=
lobal ... ok> > creating directory E:/Postgres\Data/pg_xlog ... ok> > creat=
ing directory E:/Postgres\Data/pg_xlog/archive_status ... ok> > creating di=
rectory E:/Postgres\Data/pg_clog ... ok> > creating directory E:/Postgres\D=
ata/pg_subtrans ... ok> > creating directory E:/Postgres\Data/pg_twophase .=
.. ok> > creating directory E:/Postgres\Data/pg_multixact/members ... ok> >=
 creating directory E:/Postgres\Data/pg_multixact/offsets ... ok> > creatin=
g directory E:/Postgres\Data/base ... ok> > creating directory E:/Postgres\=
Data/base/1 ... ok> > creating directory E:/Postgres\Data/pg_tblspc ... ok>=
 > selecting default max_connections ... Access is denied.> > Access is den=
ied.> > Access is denied.> > Access is denied.> > Access is denied.> > Acce=
ss is denied.> > 10> > selecting default shared_buffers ... Access is denie=
d.> > Access is denied.> > Access is denied.> > Access is denied.> > Access=
 is denied.> > Access is denied.> > Access is denied.> > Access is denied.>=
 > Access is denied.> > Access is denied.> > Access is denied.> > 50> > cre=
ating configuration files ... ok> > creating template1 database in E:/Postg=
res\Data/base/1 ...  > > VERSION=3D8.1.4> > PGDATA=3DE:/Postgres\Data> > sh=
are_path=3DE:/Program Files/postgres/Database/share> > PGPATH=3DE:/Program =
Files/postgres/Database/bin> > POSTGRES_SUPERUSERNAME=3DV_MYUSER> > POSTGRE=
S_BKI=3DE:/Program Files/postgres/Database/share/postgres.bki> > POSTGRES_D=
ESCR=3DE:/Program> > Files/postgres/Database/share/postgres.description> > =
POSTGRESQL_CONF_SAMPLE=3DE:/Program> > Files/postgres/Database/share/postgr=
esql.conf.sample> > PG_HBA_SAMPLE=3DE:/Program Files/postgres/Database/shar=
e/ > > pg_hba.conf.sample> > PG_IDENT_SAMPLE=3DE:/Program> > Files/postgres=
/Database/share/pg_ident.conf.sample> > DEBUG:  TZ "Asia/Jerusalem" matches=
 Windows timezone "Jerusalem  > > Standard> > Time"> > DEBUG:  invoking Ipc=
MemoryCreate(size=3D1327104)> > LOG:  database system was shut down at 2006=
-08-01 14:36:37 Jerusalem> > Standard Time> > LOG:  checkpoint record is at=
 0/20> > LOG:  redo record is at 0/20; undo record is at 0/20; shutdown TRU=
E> > LOG:  next transaction ID: 3; next OID: 10000> > LOG:  next MultiXactI=
d: 1; next MultiXactOffset: 0> > LOG:  database system is ready> > DEBUG:  =
StartTransaction> > DEBUG:  name: unnamed; blockState:       DEFAULT; state=
: INPROGR,> > xid/subid/cid: 1/1/0, nestlvl: 1, children: <>> > DEBUG:  sta=
rt transaction> > DEBUG:  creating bootstrap relation pg_proc 1255> > DEBUG=
:  column proname name> >> >> >> > Regards> > DROR> >> > ------------------=
---------(end of  > > broadcast)---------------------------> > TIP 4: Have =
you searched our list archives?> >> >                http://archives.postgr=
esql.org> >> > --> Jim C. Nasby, Sr. Engineering Consultant      jnasby@per=
vasive.com> Pervasive Software      http://pervasive.com    work: 512-231-6=
117> vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461> >=
=20

Express yourself instantly with Windows Live Messenger! Windows Live Messen=
ger!=20
_________________________________________________________________
Try Live.com - your fast, personalized homepage with all the things you car=
e about in one place.
http://www.live.com/getstarted=