Thread: BUG #9531: Failed to install

BUG #9531: Failed to install

From
yzhang@trinityusa.com
Date:
The following bug has been logged on the website:

Bug reference:      9531
Logged by:          Yong Zhang
Email address:      yzhang@trinityusa.com
PostgreSQL version: 9.3.3
Operating system:   Windows 7 Ultimate SP1 64-bit
Description:

I failed to install 9.3.3.1, both 32-bit and 64-bit versions. I even tried
with switch "--enable_acledit 1". Got exactly the same result. I also tried
9.1 and 9.2. They are the same. In the log file I found:

Called IsVistaOrNewer()...
    'winmgmts' object initialized...
    Version:6.1
    MajorVersion:6
Ensuring we can write to the data directory (using icacls) to  yzhang:
    Executing batch file 'rad3DB60.bat'...
    processed file: C:\Program Files (x86)\PostgreSQL\9.3\data
Successfully processed 1 files; Failed processing 0 files

    Executing batch file 'rad3DB60.bat'...
    The files belonging to this database system will be owned by user
"yzhang".
This user must also own the server process.

The database cluster will be initialized with locale "English_United
States.1252".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory C:/Program Files
(x86)/PostgreSQL/9.3/data ... initdb: could not change permissions of
directory "C:/Program Files (x86)/PostgreSQL/9.3/data": Permission denied

Called Die(Failed to initialise the database cluster with initdb)...
Failed to initialise the database cluster with initdb

Script stderr:
 Program ended with an error exit code

Error running cscript //NoLogo "C:\Program Files
(x86)\PostgreSQL\9.3/installer/server/initcluster.vbs" "NT
AUTHORITY\NetworkService" "postgres" "****" "C:\Program Files
(x86)\PostgreSQL\9.3" "C:\Program Files (x86)\PostgreSQL\9.3\data" 5432
"English, United States" 1 : Program ended with an error exit code
Problem running post-install step. Installation may not complete correctly
 The database cluster initialisation failed.

Re: BUG #9531: Failed to install

From
Sandeep Thakkar
Date:
Hi

Any other command line option you are using? Could you please attach the
log here.. The one which got produced with --enable_acledit 1 option.


On Tue, Mar 11, 2014 at 10:00 PM, <yzhang@trinityusa.com> wrote:

> The following bug has been logged on the website:
>
> Bug reference:      9531
> Logged by:          Yong Zhang
> Email address:      yzhang@trinityusa.com
> PostgreSQL version: 9.3.3
> Operating system:   Windows 7 Ultimate SP1 64-bit
> Description:
>
> I failed to install 9.3.3.1, both 32-bit and 64-bit versions. I even tried
> with switch "--enable_acledit 1". Got exactly the same result. I also tried
> 9.1 and 9.2. They are the same. In the log file I found:
>
> Called IsVistaOrNewer()...
>     'winmgmts' object initialized...
>     Version:6.1
>     MajorVersion:6
> Ensuring we can write to the data directory (using icacls) to  yzhang:
>     Executing batch file 'rad3DB60.bat'...
>     processed file: C:\Program Files (x86)\PostgreSQL\9.3\data
> Successfully processed 1 files; Failed processing 0 files
>
>     Executing batch file 'rad3DB60.bat'...
>     The files belonging to this database system will be owned by user
> "yzhang".
> This user must also own the server process.
>
> The database cluster will be initialized with locale "English_United
> States.1252".
> The default text search configuration will be set to "english".
>
> Data page checksums are disabled.
>
> fixing permissions on existing directory C:/Program Files
> (x86)/PostgreSQL/9.3/data ... initdb: could not change permissions of
> directory "C:/Program Files (x86)/PostgreSQL/9.3/data": Permission denied
>
> Called Die(Failed to initialise the database cluster with initdb)...
> Failed to initialise the database cluster with initdb
>
> Script stderr:
>  Program ended with an error exit code
>
> Error running cscript //NoLogo "C:\Program Files
> (x86)\PostgreSQL\9.3/installer/server/initcluster.vbs" "NT
> AUTHORITY\NetworkService" "postgres" "****" "C:\Program Files
> (x86)\PostgreSQL\9.3" "C:\Program Files (x86)\PostgreSQL\9.3\data" 5432
> "English, United States" 1 : Program ended with an error exit code
> Problem running post-install step. Installation may not complete correctly
>  The database cluster initialisation failed.
>
>
>
> --
> Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-bugs
>



--
Sandeep Thakkar

Re: BUG #9531: Failed to install

From
"Yong Zhang"
Date:

Hello,

 

After I submitted the bug online yesterday I tried to install 9.1 with the data folder specified to a folder which is not in Program Files (x86). The result was a disaster – it changed the owner of my C:\ to postgres. So I had to go through lots trouble to restore my computer back to the working state.

 

I just tried to install 9.3 again with switch “–enable_acledit 1”. I didn’t use any other command line option. The log file is attached.

 

Is there a document of how to set up PostgreSQL server on Windows manually? I would like to extract the files on my machine and then manually set it up. It seems very dangerous to run the installer. I have two colleagues who had experienced the same issue – the installer changed the ownership of C:\. And it was really big deal for them to fix it. They are both running Windows 7 Ultimate SP1 64-bit, same as me.

 

 

Thanks,

 

Yong

 

From: Sandeep Thakkar [mailto:sandeep.thakkar@enterprisedb.com]
Sent: Wednesday, March 12, 2014 6:29 AM
To: Yong Zhang
Cc: pgsql-bugs@postgresql.org
Subject: Re: [BUGS] BUG #9531: Failed to install

 

Hi

 

Any other command line option you are using? Could you please attach the log here.. The one which got produced with --enable_acledit 1 option.

 

On Tue, Mar 11, 2014 at 10:00 PM, <yzhang@trinityusa.com> wrote:

The following bug has been logged on the website:

Bug reference:      9531
Logged by:          Yong Zhang
Email address:      yzhang@trinityusa.com
PostgreSQL version: 9.3.3
Operating system:   Windows 7 Ultimate SP1 64-bit
Description:

I failed to install 9.3.3.1, both 32-bit and 64-bit versions. I even tried
with switch "--enable_acledit 1". Got exactly the same result. I also tried
9.1 and 9.2. They are the same. In the log file I found:

Called IsVistaOrNewer()...
    'winmgmts' object initialized...
    Version:6.1
    MajorVersion:6
Ensuring we can write to the data directory (using icacls) to  yzhang:
    Executing batch file 'rad3DB60.bat'...
    processed file: C:\Program Files (x86)\PostgreSQL\9.3\data
Successfully processed 1 files; Failed processing 0 files

    Executing batch file 'rad3DB60.bat'...
    The files belonging to this database system will be owned by user
"yzhang".
This user must also own the server process.

The database cluster will be initialized with locale "English_United
States.1252".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory C:/Program Files
(x86)/PostgreSQL/9.3/data ... initdb: could not change permissions of
directory "C:/Program Files (x86)/PostgreSQL/9.3/data": Permission denied

Called Die(Failed to initialise the database cluster with initdb)...
Failed to initialise the database cluster with initdb

Script stderr:
 Program ended with an error exit code

Error running cscript //NoLogo "C:\Program Files
(x86)\PostgreSQL\9.3/installer/server/initcluster.vbs" "NT
AUTHORITY\NetworkService" "postgres" "****" "C:\Program Files
(x86)\PostgreSQL\9.3" "C:\Program Files (x86)\PostgreSQL\9.3\data" 5432
"English, United States" 1 : Program ended with an error exit code
Problem running post-install step. Installation may not complete correctly
 The database cluster initialisation failed.



--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



 

--

Sandeep Thakkar

 

Attachment

Re: BUG #9531: Failed to install

From
Dave Page
Date:
On Wed, Mar 12, 2014 at 2:52 PM, Yong Zhang <yzhang@trinityusa.com> wrote:
> Hello,
>
>
>
> After I submitted the bug online yesterday I tried to install 9.1 with th=
e
> data folder specified to a folder which is not in Program Files (x86). Th=
e
> result was a disaster =E2=80=93 it changed the owner of my C:\ to postgre=
s. So I had
> to go through lots trouble to restore my computer back to the working sta=
te.

I don't see any way that is possible. The installer only grants
permissions - it doesn't touch the ownership; that requires use of
commands/APIs that are not called anywhere in the installer as far as
I can see.

--=20
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: BUG #9531: Failed to install

From
Dave Page
Date:
On Thu, Mar 13, 2014 at 2:28 PM, Yong Zhang <yzhang@trinityusa.com> wrote:
> You're correct. The installer script doesn't try to change ownership directly. But it does it in an indirect way via
initdb.exe.Here is what I got when I ran initdb.exe in the command window: 
>
>
> "C:\Program Files (x86)\PostgreSQL\9.1\bin\initdb.exe" --pwfile="password.txt" --locale="English_United States"
--encoding=UTF-8-A trust -U postgres -D "C:\Program Files (x86)\PostgreSQL\9.1\data" 
> The files belonging to this database system will be owned by user "yzhang".
> This user must also own the server process.
>
> The database cluster will be initialized with locale English_United States.
> The default text search configuration will be set to "english".
>
> fixing permissions on existing directory C:/Program Files (x86)/PostgreSQL/9.1/data ... initdb: could not change
permissionsof directory "C:/Program Files (x86)/PostgreSQL/9.1/data": Permission denied 
>
> This is the exact error in the log file I got when I ran the installer. I don't understand why it tried to change the
ownershipof data folder to me. All it needs is the permissions! 
>

If you check the initdb source code, you'll see it just calls chmod,
not chown or any of it's related functions as far as I can see. That's
also implied by the message you quote above: could not change
*permissions* of directory.

I don't see anything in initdb OR the installer that can change
directory ownership on Windows.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: BUG #9531: Failed to install

From
"Yong Zhang"
Date:
WW91J3JlIGNvcnJlY3QuIFRoZSBpbnN0YWxsZXIgc2NyaXB0IGRvZXNuJ3QgdHJ5IHRvIGNoYW5n
ZSBvd25lcnNoaXAgZGlyZWN0bHkuIEJ1dCBpdCBkb2VzIGl0IGluIGFuIGluZGlyZWN0IHdheSB2
aWEgaW5pdGRiLmV4ZS4gSGVyZSBpcyB3aGF0IEkgZ290IHdoZW4gSSByYW4gaW5pdGRiLmV4ZSBp
biB0aGUgY29tbWFuZCB3aW5kb3c6DQoNCg0KIkM6XFByb2dyYW0gRmlsZXMgKHg4NilcUG9zdGdy
ZVNRTFw5LjFcYmluXGluaXRkYi5leGUiIC0tcHdmaWxlPSJwYXNzd29yZC50eHQiIC0tbG9jYWxl
PSJFbmdsaXNoX1VuaXRlZCBTdGF0ZXMiIC0tZW5jb2Rpbmc9VVRGLTggLUEgdHJ1c3QgLVUgcG9z
dGdyZXMgLUQgIkM6XFByb2dyYW0gRmlsZXMgKHg4NilcUG9zdGdyZVNRTFw5LjFcZGF0YSINClRo
ZSBmaWxlcyBiZWxvbmdpbmcgdG8gdGhpcyBkYXRhYmFzZSBzeXN0ZW0gd2lsbCBiZSBvd25lZCBi
eSB1c2VyICJ5emhhbmciLg0KVGhpcyB1c2VyIG11c3QgYWxzbyBvd24gdGhlIHNlcnZlciBwcm9j
ZXNzLg0KDQpUaGUgZGF0YWJhc2UgY2x1c3RlciB3aWxsIGJlIGluaXRpYWxpemVkIHdpdGggbG9j
YWxlIEVuZ2xpc2hfVW5pdGV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