Re: BUG #16957: initdb.exe initialize a database cluster has stopped working - Mailing list pgsql-bugs

From sadaqat
Subject Re: BUG #16957: initdb.exe initialize a database cluster has stopped working
Date
Msg-id CA+7WMyVQit10H9MSgwqWZ1wmOHhUnKDpq6h_Sa=o6GscjntMSw@mail.gmail.com
Whole thread Raw
In response to Re: BUG #16957: initdb.exe initialize a database cluster has stopped working  (Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>)
List pgsql-bugs
Hi Sandeep ,

Thanks for the response , the vc++ redistributables are already installed in the system . 
When I failed to install using the binary zip files then I downloaded the gui installer of official postgresql from their website , which downloaded all the required 
visual c++ redistributables to the system , but that official gui installer still failed giving the same error. 
I am sharing with you the temp log file of official gui installer of postgresql.  May be it is of some help. 

...
...
upacking...
unpacking..
Unpacking C:\Program Files\PostgreSQL\13\lib\postgres.lib
Unpacking C:\Program Files\PostgreSQL\13\lib\wxmsw31ud_core.lib
Unpacking C:\Program Files\PostgreSQL\13\installer\vcredist_x86.exe
Unpacking C:\Program Files\PostgreSQL\13\installer\vcredist_x64.exe
Setting variable whoami from C:\WINDOWS\System32\whoami
Script exit code: 0

Script output:
 {userame}\{userame}

Script stderr:
 

Executing C:\WINDOWS\System32\icacls "C:\Users\{userame}\AppData\Local\Temp/postgresql_installer_4e4790a761" /inheritance:r
Script exit code: 0

Script output:
 processed file: C:\Users\{userame}\AppData\Local\Temp/postgresql_installer_4e4790a761
Successfully processed 1 files; Failed processing 0 files

Script stderr:
 

Executing C:\WINDOWS\System32\icacls "C:\Users\{userame}\AppData\Local\Temp/postgresql_installer_4e4790a761" /T /Q /grant "{userame}\{userame}:(OI)(CI)F"
Script exit code: 0

Script output:
 Successfully processed 1 files; Failed processing 0 files

Script stderr:
 

[08:23:33] Running the post-installation/upgrade actions:
[08:23:33] Write the base directory to the ini file...
[08:23:33] Write the version number to the ini file...
Initialising the database cluster (this may take a few minutes)...
Executing C:\WINDOWS\System32\cscript //NoLogo "C:\Program Files\PostgreSQL\13/installer/server/initcluster.vbs" "NT AUTHORITY\NetworkService" "postgres" "****" "C:\Users\{userame}\AppData\Local\Temp/postgresql_installer_4e4790a761" "C:\Program Files\PostgreSQL\13" "C:\Program Files\PostgreSQL\13\data" 5433 "DEFAULT" 0
Script exit code: 0

Script output:
 WScript.Shell Initialized...
Scripting.FileSystemObject initialized...

Called CreateDirectory(C:\Program Files\PostgreSQL\13\data)...
Called CreateDirectory(C:\Program Files\PostgreSQL\13)...
Called ClearAcl (C:\Program Files\PostgreSQL\13\data)...
    Executing batch file 'rad001AC.bat'...
    C:\Program Files\PostgreSQL\13\data NT SERVICE\TrustedInstaller:(I)(F)
                                    NT SERVICE\TrustedInstaller:(I)(CI)(IO)(F)
                                    NT AUTHORITY\SYSTEM:(I)(F)
                                    NT AUTHORITY\SYSTEM:(I)(OI)(CI)(IO)(F)
                                    BUILTIN\{userame}s:(I)(F)
                                    BUILTIN\{userame}s:(I)(OI)(CI)(IO)(F)
                                    BUILTIN\Users:(I)(RX)
                                    BUILTIN\Users:(I)(OI)(CI)(IO)(GR,GE)
                                    CREATOR OWNER:(I)(OI)(CI)(IO)(F)
                                    APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(I)(RX)
                                    APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(I)(OI)(CI)(IO)(GR,GE)
                                    APPLICATION PACKAGE AUTHORITY\ALL RESTRICTED APPLICATION PACKAGES:(I)(RX)
                                    APPLICATION PACKAGE AUTHORITY\ALL RESTRICTED APPLICATION PACKAGES:(I)(OI)(CI)(IO)(GR,GE)

Successfully processed 1 files; Failed processing 0 files

Removing inherited ACLs on (C:\Program Files\PostgreSQL\13\data)
    Executing batch file 'rad001AC.bat'...
    processed file: C:\Program Files\PostgreSQL\13\data
Successfully processed 1 files; Failed processing 0 files

WScript.Network initialized...
strParentOfDataDirC:\Program Files\PostgreSQL\13
logged in user{userame}\{userame}
Called AclCheck(C:\Program Files\PostgreSQL\13\data)
Called IsVistaOrNewer()...
    'winmgmts' object initialized...
    Version:10.
    MajorVersion:10
Executing icacls to ensure the {userame}\{userame} account can read the path C:\Program Files\PostgreSQL\13\data
    Executing batch file 'rad001AC.bat'...
    processed file: C:\Program Files\PostgreSQL\13\data
Successfully processed 1 files; Failed processing 0 files

Called IsVistaOrNewer()...
    'winmgmts' object initialized...
    Version:10.
    MajorVersion:10
Ensuring we can write to the data directory (using icacls) to  {userame}\{userame}:
    Executing batch file 'rad001AC.bat'...
    processed file: C:\Program Files\PostgreSQL\13\data
Successfully processed 1 files; Failed processing 0 files

Called IsVistaOrNewer()...
    'winmgmts' object initialized...
    Version:10.
    MajorVersion:10
Granting full access to (NT AUTHORITY\NetworkService) on (C:\Program Files\PostgreSQL\13\data)
    Executing batch file 'rad001AC.bat'...
    processed file: C:\Program Files\PostgreSQL\13\data
Successfully processed 1 files; Failed processing 0 files

Called IsVistaOrNewer()...
    'winmgmts' object initialized...
    Version:10.
    MajorVersion:10
Granting full access to CREATOR OWNER on (C:\Program Files\PostgreSQL\13\data)
    Executing batch file 'rad001AC.bat'...
    processed file: C:\Program Files\PostgreSQL\13\data
Successfully processed 1 files; Failed processing 0 files

Called IsVistaOrNewer()...
    'winmgmts' object initialized...
    Version:10.
    MajorVersion:10
Granting full access to SYSTEM on (C:\Program Files\PostgreSQL\13\data)
    Executing batch file 'rad001AC.bat'...
    processed file: C:\Program Files\PostgreSQL\13\data
Successfully processed 1 files; Failed processing 0 files

Called IsVistaOrNewer()...
    'winmgmts' object initialized...
    Version:10.
    MajorVersion:10
Granting full access to {userame}s on (C:\Program Files\PostgreSQL\13\data)
    Executing batch file 'rad001AC.bat'...
    processed file: C:\Program Files\PostgreSQL\13\data
Successfully processed 1 files; Failed processing 0 files

    Executing batch file 'rad001AC.bat'...
Reading:    objConfFile is nothing...
Writing:    objConfFile is nothing...
Called AclCheck(C:\Program Files\PostgreSQL\13\data)
Called IsVistaOrNewer()...
    'winmgmts' object initialized...
    Version:10.
    MajorVersion:10
Executing icacls to ensure the NT AUTHORITY\NetworkService account can read the path C:\Program Files\PostgreSQL\13\data
    Executing batch file 'rad001AC.bat'...
    processed file: C:\Program Files\PostgreSQL\13\data
Successfully processed 1 files; Failed processing 0 files

Called IsVistaOrNewer()...
    'winmgmts' object initialized...
    Version:10.
    MajorVersion:10
Granting service account access to the data directory (using icacls) to NT AUTHORITY\NetworkService:
    Executing batch file 'rad001AC.bat'...
    processed file: C:\Program Files\PostgreSQL\13\data
processed file: C:\Program Files\PostgreSQL\13\data\log
Successfully processed 2 files; Failed processing 0 files

initcluster.vbs ran to completion

Script stderr:
 

Configuring database server startup...
Executing C:\WINDOWS\System32\cscript //NoLogo "C:\Program Files\PostgreSQL\13\installer\server\startupcfg.vbs" 13 "NT AUTHORITY\NetworkService" "****" "C:\Program Files\PostgreSQL\13" "C:\Program Files\PostgreSQL\13\data" "postgresql-x64-13"
Script exit code: 0

Script output:
 startupcfg.vbs ran to completion

Script stderr:
 

Creating menu shortcuts...
Executing C:\WINDOWS\System32\cscript //NoLogo "C:\Program Files\PostgreSQL\13\installer\server\createshortcuts_server.vbs" 13 "postgres" 5433 "PostgreSQL 13" "C:\Program Files\PostgreSQL\13" "C:\Program Files\PostgreSQL\13\data" "postgresql-x64-13"
Script exit code: 0

Script output:
 Start FixupFile(C:\Program Files\PostgreSQL\13\scripts\serverctl.vbs)...
   Opening file for reading...
   Closing file (reading)...
   Replacing placeholders...
   Opening file for writing...
   Closing file...
  End FixupFile()...
Start FixupFile(C:\Program Files\PostgreSQL\13\scripts\runpsql.bat)...
   Opening file for reading...
   Closing file (reading)...
   Replacing placeholders...
   Opening file for writing...
   Closing file...
  End FixupFile()...
createshortcuts_server.vbs ran to completion

Script stderr:
 

Starting the database server...
Executing C:\WINDOWS\System32\cscript //NoLogo "C:\Program Files\PostgreSQL\13\installer\server\startserver.vbs" postgresql-x64-13
Script exit code: 0

Script output:
 startserver.vbs ran to completion

Script stderr:
 

[08:24:07] Installing the adminpack module in the postgres database...
Executing C:\Program Files\PostgreSQL\13\bin\psql.exe -c "CREATE EXTENSION adminpack" -d postgres
Script exit code: 2

Script output:
 

Script stderr:
 psql: error: could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5433?
could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5433?

Failed to load SQL modules into the database cluster.
[08:28:26] Write the data directory to the ini file...
[08:28:26] Write the port number, service ID, locale and superuser to the ini file...
[08:28:26] Write ServiceID(postgresql-x64-13) to registry/ini...
Problem running post-install step. Installation may not complete correctly
 Error reading file C:/Program Files/PostgreSQL/13/data/postgresql.conf
Setting variable whoami from C:\WINDOWS\System32\whoami
Script exit code: 0

Script output:
 {userame}\{userame}

Script stderr:
 

Executing C:\WINDOWS\System32\icacls "C:\Users\{userame}\AppData\Local\Temp/postgresql_installer_2fbe7cd101" /inheritance:r
Script exit code: 0

Script output:
 processed file: C:\Users\{userame}\AppData\Local\Temp/postgresql_installer_2fbe7cd101
Successfully processed 1 files; Failed processing 0 files

Script stderr:
 

Executing C:\WINDOWS\System32\icacls "C:\Users\{userame}\AppData\Local\Temp/postgresql_installer_2fbe7cd101" /T /Q /grant "{userame}\{userame}:(OI)(CI)F"
Script exit code: 0

Script output:
 Successfully processed 1 files; Failed processing 0 files

Script stderr:
 

Creating menu shortcuts...
Executing C:\WINDOWS\System32\cscript //NoLogo "C:\Program Files\PostgreSQL\13\installer\server\createshortcuts_clt.vbs" "PostgreSQL 13" "C:\Program Files\PostgreSQL\13"
Script exit code: 0

Script output:
 Start FixupFile(C:\Program Files\PostgreSQL\13\scripts\runpsql.bat)...
   Opening file for reading...
   Closing file (reading)...
   Replacing placeholders...
   Opening file for writing...
   Closing file...
  End FixupFile()...
createshortcuts_clt.vbs ran to completion

Script stderr:
 

[08:28:42] Write the server description to the ini file...
[08:28:42] Write the server branding to the ini file...
Creating Uninstaller
Creating uninstaller 25%
Creating uninstaller 50%
Creating uninstaller 75%
Creating uninstaller 100%
Installation completed





On Sun, Apr 11, 2021 at 9:18 AM Sandeep Thakkar <sandeep.thakkar@enterprisedb.com> wrote:
Hi

That DLL seems associated with Visual C++. Can you try installing https://aka.ms/vs/16/release/vc_redist.x64.exe and then check again if the initdb is working fine?


On Sat, Apr 10, 2021 at 2:59 AM PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:

Bug reference:      16957
Logged by:          ahmed il
Email address:      sadaqatcustom@gmail.com
PostgreSQL version: 13.2
Operating system:   windows 2016 server
Description:       

I am trying to install postgresql binary zip file to my windows machines
using a batch file , it gets install on some machines but shows
followig error in windows evet log in some of the machies. Pls help

Event Log Windows:
Faulting application name: initdb.exe, version: 13.0.1.20314, time stamp:
0x5faa5f0f
Faulting module name: ucrtbase.dll, version: 10.0.14393.3659, time stamp:
0x5e9140a1
Exception code: 0xc0000409
Fault offset: 0x000000000006c9e8
Faulting process id: 0x579c
Faulting application start time: 0x01d72d5bc0a912a0
Faulting application path: C:\pgsql\bin\initdb.exe
Faulting module path: C:\WINDOWS\System32\ucrtbase.dll
Report Id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Faulting package full name:
Faulting package-relative application ID:

After this i tried the official installer of postgresql and it gave me same
this error in windows event log

Faulting application name: initdb.exe, version: 13.0.1.20314, time stamp:
0x5faa5f0f
Faulting module name: ucrtbase.dll, version: 10.0.14393.3659, time stamp:
0x5e9140a1
Exception code: 0xc0000409
Fault offset: 0x000000000006c9e8
Faulting process id: 0xde00
Faulting application start time: 0x01d72d717352a9d5
Faulting application path: C:\pgsql\bin\initdb.exe
Faulting module path: C:\WINDOWS\System32\ucrtbase.dll
Report Id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Faulting package full name:
Faulting package-relative application ID:

pls help



--
Sandeep Thakkar


pgsql-bugs by date:

Previous
From: Sandeep Thakkar
Date:
Subject: Re: BUG #16957: initdb.exe initialize a database cluster has stopped working
Next
From: Fujii Masao
Date:
Subject: Re: BUG #16931: source code problem about commit_ts