cancel
Showing results for 
Search instead for 
Did you mean: 

PostgreSQL Installer fails at Initializing the database cluster. Help.

Highlighted
Adventurer

PostgreSQL Installer fails at Initializing the database cluster. Help.

Can someone help with this.  We have tried  intalling the postgresql-10.1-3-windows-x64.exe for Windows 7 Pro 64 bit as many ways as we can think.

 

It allways goes through all of its steps until the very end.  It then hangs on the  Initializing the database cluster, and a rad0313f.bat batch file opens up.  It has the following contents:

@ECHO OFF
CHCP 1252
icacls "C:\Program Files\PostgreSQL\10\data" /grant "SWAI\tdfm1":(NP)(RX) > "C:\Users\TDFM1\AppData\Local\Temp\rad446D3.tmp" 2>&1
EXIT /B %ERRORLEVEL%

 

26 REPLIES 26
Highlighted
EDB Team Member

Re: PostgreSQL Installer fails at Initializing the database cluster. Help.

Are you running the install as a user with administrator privileges?
Highlighted
Adventurer

Re: PostgreSQL Installer fails at Initializing the database cluster. Help.

Yes, I have full privaleges.  For some reason, access to the database cluster is being denied.

 

Highlighted
Adventurer

Re: PostgreSQL Installer fails at Initializing the database cluster. Help.

I tried again and just kept closing the batch files that seemd to fail.  PGAdmin is creatted but without any data cluster.  Any ideas?

This was in the log file:

 

Initialising the database cluster (this may take a few minutes)...
Executing cscript //NoLogo "C:\Program Files\PostgreSQL\10/installer/server/initcluster.vbs" "NT AUTHORITY\NetworkService" "postgres" "****" "C:\Program Files\PostgreSQL\10" "C:\Program Files\PostgreSQL\10\data" 5432 "English,UnitedStates" 0
Script exit code: 0

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

Called CreateDirectory(C:\Program Files\PostgreSQL\10\data)...
Called CreateDirectory(C:\Program Files\PostgreSQL\10)...
WScript.Network initialized...
strParentOfDataDirC:\Program Files\PostgreSQL\10
logged in userSWAI\tdfm1
Called AclCheck(C:\Program Files\PostgreSQL\10\data)
Called IsVistaOrNewer()...
'winmgmts' object initialized...
Version:6.1
MajorVersion:6
Executing icacls to ensure the SWAI\tdfm1 account can read the path C:\Program Files\PostgreSQL\10\data
Executing batch file 'rad0313F.bat'...
Output file does not exists...
Called IsVistaOrNewer()...
'winmgmts' object initialized...
Version:6.1
MajorVersion:6
Ensuring we can write to the data directory (using icacls) to SWAI\tdfm1:
Executing batch file 'rad0313F.bat'...
Output file does not exists...
Executing batch file 'rad0313F.bat'...
Output file does not exists...
Reading: objConfFile is nothing...
Writing: objConfFile is nothing...
Called AclCheck(C:\Program Files\PostgreSQL\10\data)
Called IsVistaOrNewer()...
'winmgmts' object initialized...
Version:6.1
MajorVersion:6
Executing icacls to ensure the NT AUTHORITY\NetworkService account can read the path C:\Program Files\PostgreSQL\10\data
Executing batch file 'rad0313F.bat'...
Output file does not exists...
Called IsVistaOrNewer()...
'winmgmts' object initialized...
Version:6.1
MajorVersion:6
Granting service account access to the data directory (using icacls) to NT AUTHORITY\NetworkService:
Executing batch file 'rad0313F.bat'...
Output file does not exists...
initcluster.vbs ran to completion

Script stderr:

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

Script output:
startupcfg.vbs ran to completion

Highlighted
Moderator

Re: PostgreSQL Installer fails at Initializing the database cluster. Help.

Hi,

If you encounter an error during the installation process on a Windows system, exit the installation, and ensure that your version of Windows is up-to-date.  After applying any  outstanding operating system updates, re-invoke the PostgreSQL installer.

If you still facing the same issue then kindly share the latest installation log files from %TEMP% directory.

In addition to the above could you please also make sure that the TEMP directory have proper permission so that user can read, write and execute.

Highlighted
Adventurer

Re: PostgreSQL Installer fails at Initializing the database cluster. Help.

somehow my reply got lost.

I updated Windows, and made sure that both c:\Temp and the %Temp% had permissions.  However, the permissions in the %Temp% were greyed out.  I also could not access the user profile from a PC where the C:\drive was shared, but could get into Users.

 

I reinstalled and it again failed in the 3 batch files where icacls is called.  They open in order and I shut them down.  After that I get two popup error messages.

 

Failed to load SQL modules into the database cluster

 

Problem running post-install step. Installation may not complet correctly.

Error reading file C:/Program Files/PostgreSQL/10/dat/postgresqul.conf

 

I will attempt to post the log file in a separate reply.

 

Highlighted
Adventurer

Re: PostgreSQL Installer fails at Initializing the database cluster. Help.

I did everything, and posted a reply.  somehow it ended up as a reply to the original message.

Highlighted
Moderator

Re: PostgreSQL Installer fails at Initializing the database cluster. Help.

Hi,

 

Thank you for the update.

 

Could you please try resending the response as we are not able to get the response shared by you.

Try uploading and sharing the download link for the bitrock installation log files on the http://uploads.enterprisedb.com/

 

Highlighted
Adventurer

Re: PostgreSQL Installer fails at Initializing the database cluster. Help.

Here is the log file:

Log started 02/06/2018 at 14:15:22
Preferred installation mode : qt
Trying to init installer in mode qt
Mode qt successfully initialized
Executing cscript //NoLogo "C:\Users\TDFM1\AppData\Local\Temp\postgresql_installer_324885683f\prerun_checks.vbs"
Script exit code: 0

Script output:
 The scripting host appears to be functional.

Script stderr:
 

Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-10 Base Directory. Setting variable iBaseDirectory to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-10 Branding. Setting variable iBranding to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-10 Version. Setting variable brandingVer to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-10 Shortcuts. Setting variable iShortcut to empty value
[14:15:27] Using branding: PostgreSQL 10
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-10 SB_Version. Setting variable sb_version to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-10 pgAdmin_Version. Setting variable pgadmin_version to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-10 CLT_Version. Setting variable clt_version to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-10 Data Directory. Setting variable server_data_dir to empty value
Executing C:\Users\TDFM1\AppData\Local\Temp/postgresql_installer_324885683f/temp_check_comspec.bat 
Script exit code: 0

Script output:
 "test ok"

Script stderr:
 

Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-10 Data Directory. Setting variable iDataDirectory to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-10 Base Directory. Setting variable iBaseDirectory to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-10 Service ID. Setting variable iServiceName to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-10 Service Account. Setting variable iServiceAccount to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-10 Super User. Setting variable iSuperuser to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-10 Branding. Setting variable iBranding to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-10 Version. Setting variable brandingVer to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-10 Shortcuts. Setting variable iShortcut to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-10 DisableStackBuilder. Setting variable iDisableStackBuilder to empty value
[14:15:28] Existing base directory: 
[14:15:28] Existing data directory: 
[14:15:28] Using branding: PostgreSQL 10
[14:15:28] Using Super User: postgres and Service Account: NT AUTHORITY\NetworkService
[14:15:28] Using Service Name: postgresql-x64-10
Executing C:\Users\TDFM1\AppData\Local\Temp\postgresql_installer_324885683f\vcredist_x86.exe /passive /norestart
Script exit code: 0

Script output:
 

Script stderr:
 

Executing C:\Users\TDFM1\AppData\Local\Temp\postgresql_installer_324885683f\vcredist_x64.exe /passive /norestart
Script exit code: 0

Script output:
 

Script stderr:
 

Executing C:\Users\TDFM1\AppData\Local\Temp\postgresql_installer_324885683f\getlocales.exe 
Script exit code: 0

Script output:
 AfrikaansxxCOMMAxxxxSPxxSouthxxSPxxAfrica=Afrikaans, South Africa
list of all languages.
V
isiZuluxxCOMMAxxxxSPxxSouthxxSPxxAfrica=isiZulu, South Africa

Script stderr:
 

Preparing to Install
Preparing to Install
Directory already exists: C:\Program Files\PostgreSQL\10\installer
Unpacking files
Unpacking C:\Program Files\PostgreSQL\10\installer\prerun_checks.vbs
Unpacking C:\Program Files\PostgreSQL\10\installer\vcredist_x86.exe
Directory already exists: C:\Program Files\PostgreSQL\10\installer
Unpacking files
Unpacking C:\Program Files\PostgreSQL\10\installer\vcredist_x64.exe
Directory already exists: C:\Program Files\PostgreSQL\10
Directory already exists: C:\Program Files\PostgreSQL\10\bin
Directory already exists: C:\Program Files\PostgreSQL\10\doc
Directory already exists: C:\Program Files\PostgreSQL\10\doc\contrib
Directory already exists: C:\Program Files\PostgreSQL\10\doc\postgresql
Directory already exists: C:\Program Files\PostgreSQL\10\doc\postgresql\html
Directory already exists: C:\Program Files\PostgreSQL\10\doc\extension
Directory already exists: C:\Program Files\PostgreSQL\10\include
Directory already exists: C:\Program Files\PostgreSQL\10\include\libxml
Directory already exists: C:\Program Files\PostgreSQL\10\include\server
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\utils
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\replication
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\storage
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\fe_utils
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\executor
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\datatype
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\foreign
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\catalog
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\access
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\tsearch
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\tsearch\dicts
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\lib
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\mb
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\port
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\port\win32
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\port\win32\netinet
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\port\win32\arpa
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\port\win32\sys
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\port\win32_msvc
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\port\win32_msvc\sys
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\port\atomics
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\optimizer
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\regex
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\bootstrap
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\tcop
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\statistics
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\snowball
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\snowball\libstemmer
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\parser
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\libpq
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\common
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\postmaster
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\rewrite
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\commands
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\nodes
Directory already exists: C:\Program Files\PostgreSQL\10\include\server\portability
Directory already exists: C:\Program Files\PostgreSQL\10\include\internal
Directory already exists: C:\Program Files\PostgreSQL\10\include\internal\libpq
Directory already exists: C:\Program Files\PostgreSQL\10\include\informix
Directory already exists: C:\Program Files\PostgreSQL\10\include\informix\esql
Directory already exists: C:\Program Files\PostgreSQL\10\include\libxslt
Directory already exists: C:\Program Files\PostgreSQL\10\include\openssl
Directory already exists: C:\Program Files\PostgreSQL\10\include\libpq
Directory already exists: C:\Program Files\PostgreSQL\10\installer
Directory already exists: C:\Program Files\PostgreSQL\10\installer\server
Directory already exists: C:\Program Files\PostgreSQL\10\scripts
Directory already exists: C:\Program Files\PostgreSQL\10\scripts\images
Directory already exists: C:\Program Files\PostgreSQL\10\share
Directory already exists: C:\Program Files\PostgreSQL\10\share\contrib
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\pt_BR
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\pt_BR\LC_MESSAGES
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\ru
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\ru\LC_MESSAGES
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\de
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\de\LC_MESSAGES
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\nb
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\nb\LC_MESSAGES
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\tr
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\tr\LC_MESSAGES
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\ja
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\ja\LC_MESSAGES
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\he
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\he\LC_MESSAGES
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\ro
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\ro\LC_MESSAGES
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\es
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\es\LC_MESSAGES
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\fr
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\fr\LC_MESSAGES
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\it
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\it\LC_MESSAGES
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\sv
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\sv\LC_MESSAGES
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\zh_CN
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\zh_CN\LC_MESSAGES
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\ta
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\ta\LC_MESSAGES
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\cs
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\cs\LC_MESSAGES
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\zh_TW
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\zh_TW\LC_MESSAGES
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\ko
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\ko\LC_MESSAGES
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\pl
Directory already exists: C:\Program Files\PostgreSQL\10\share\locale\pl\LC_MESSAGES
Directory already exists: C:\Program Files\PostgreSQL\10\share\timezonesets
Directory already exists: C:\Program Files\PostgreSQL\10\share\timezone
Directory already exists: C:\Program Files\PostgreSQL\10\share\timezone\Mexico
Directory already exists: C:\Program Files\PostgreSQL\10\share\timezone\America
Directory already exists: C:\Program Files\PostgreSQL\10\share\timezone\America\North_Dakota
Directory already exists: C:\Program Files\PostgreSQL\10\share\timezone\America\Kentucky
Directory already exists: C:\Program Files\PostgreSQL\10\share\timezone\America\Indiana
Directory already exists: C:\Program Files\PostgreSQL\10\share\timezone\America\Argentina
Directory already exists: C:\Program Files\PostgreSQL\10\share\timezone\Arctic
Directory already exists: C:\Program Files\PostgreSQL\10\share\timezone\Europe
Directory already exists: C:\Program Files\PostgreSQL\10\share\timezone\Chile
Directory already exists: C:\Program Files\PostgreSQL\10\share\timezone\Pacific
Directory already exists: C:\Program Files\PostgreSQL\10\share\timezone\Etc
Directory already exists: C:\Program Files\PostgreSQL\10\share\timezone\Canada
Directory already exists: C:\Program Files\PostgreSQL\10\share\timezone\Australia
Directory already exists: C:\Program Files\PostgreSQL\10\share\timezone\Africa
Directory already exists: C:\Program Files\PostgreSQL\10\share\timezone\Atlantic
Directory already exists: C:\Program Files\PostgreSQL\10\share\timezone\Antarctica
Directory already exists: C:\Program Files\PostgreSQL\10\share\timezone\Brazil
Directory already exists: C:\Program Files\PostgreSQL\10\share\timezone\Indian
Directory already exists: C:\Program Files\PostgreSQL\10\share\timezone\Asia
Directory already exists: C:\Program Files\PostgreSQL\10\share\timezone\US
Directory already exists: C:\Program Files\PostgreSQL\10\share\tsearch_data
Directory already exists: C:\Program Files\PostgreSQL\10\share\extension
Unpacking files
Unpacking C:\Program Files\PostgreSQL\10\
to doc and include....
Un packs many many many files. deleted due to limit.
[14:22:43] Running the post-installation/upgrade actions: [14:22:43] Write the base directory to the ini file... [14:22:43] Write the version number to the ini file... Initialising the database cluster (this may take a few minutes)... Executing cscript //NoLogo "C:\Program Files\PostgreSQL\10/installer/server/initcluster.vbs" "NT AUTHORITY\NetworkService" "postgres" "****" "C:\Program Files\PostgreSQL\10" "C:\Program Files\PostgreSQL\10\data" 5432 "DEFAULT" 0 Script exit code: 0 Script output: WScript.Shell Initialized... Scripting.FileSystemObject initialized... Called CreateDirectory(C:\Program Files\PostgreSQL\10\data)... Called CreateDirectory(C:\Program Files\PostgreSQL\10)... WScript.Network initialized... strParentOfDataDirC:\Program Files\PostgreSQL\10 logged in userSWAI\tdfm1 Called AclCheck(C:\Program Files\PostgreSQL\10\data) Called IsVistaOrNewer()... 'winmgmts' object initialized... Version:6.1 MajorVersion:6 Executing icacls to ensure the SWAI\tdfm1 account can read the path C:\Program Files\PostgreSQL\10\data Executing batch file 'radAC469.bat'... Output file does not exists... Called IsVistaOrNewer()... 'winmgmts' object initialized... Version:6.1 MajorVersion:6 Ensuring we can write to the data directory (using icacls) to SWAI\tdfm1: Executing batch file 'radAC469.bat'... Output file does not exists... Executing batch file 'radAC469.bat'... Output file does not exists... Reading: objConfFile is nothing... Writing: objConfFile is nothing... Called AclCheck(C:\Program Files\PostgreSQL\10\data) Called IsVistaOrNewer()... 'winmgmts' object initialized... Version:6.1 MajorVersion:6 Executing icacls to ensure the NT AUTHORITY\NetworkService account can read the path C:\Program Files\PostgreSQL\10\data Executing batch file 'radAC469.bat'... Output file does not exists... Called IsVistaOrNewer()... 'winmgmts' object initialized... Version:6.1 MajorVersion:6 Granting service account access to the data directory (using icacls) to NT AUTHORITY\NetworkService: Executing batch file 'radAC469.bat'... Output file does not exists... initcluster.vbs ran to completion Script stderr: Configuring database server startup... Executing cscript //NoLogo "C:\Program Files\PostgreSQL\10\installer\server\startupcfg.vbs" 10 "NT AUTHORITY\NetworkService" "****" "C:\Program Files\PostgreSQL\10" "C:\Program Files\PostgreSQL\10\data" "postgresql-x64-10" Script exit code: 0 Script output: startupcfg.vbs ran to completion Script stderr: Creating menu shortcuts... Executing cscript //NoLogo "C:\Program Files\PostgreSQL\10\installer\server\createshortcuts_server.vbs" 10 "postgres" 5432 "PostgreSQL 10" "C:\Program Files\PostgreSQL\10" "C:\Program Files\PostgreSQL\10\data" "postgresql-x64-10" Script exit code: 0 Script output: Start FixupFile(C:\Program Files\PostgreSQL\10\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\10\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 cscript //NoLogo "C:\Program Files\PostgreSQL\10\installer\server\startserver.vbs" postgresql-x64-10 Script exit code: 0 Script output: startserver.vbs ran to completion Script stderr: [14:23:38] Installing the adminpack module in the postgres database... Executing C:\Program Files\PostgreSQL\10\bin\psql.exe -c "CREATE EXTENSION adminpack" -d postgres Script exit code: 2 Script output: Script stderr: psql: could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? 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 5432? Failed to load SQL modules into the database cluster. [14:23:46] Write the data directory to the ini file... [14:23:46] Write the port number, service ID, locale and superuser to the ini file... [14:23:46] Write ServiceID(postgresql-x64-10) to registry/ini... Problem running post-install step. Installation may not complete correctly Error reading file C:/Program Files/PostgreSQL/10/data/postgresql.conf [14:24:11] Delete the temporary scripts directory... Creating menu shortcuts... Executing cscript //NoLogo "C:\Program Files\PostgreSQL\10\installer\server\createshortcuts_clt.vbs" "PostgreSQL 10" "C:\Program Files\PostgreSQL\10" Script exit code: 0 Script output: Start FixupFile(C:\Program Files\PostgreSQL\10\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: [14:24:12] Write the server description to the ini file... [14:24:12] Write the server branding to the ini file... Creating Uninstaller Creating uninstaller 25% Creating uninstaller 50% Creating uninstaller 75% Creating uninstaller 100% Installation completed Log finished 02/06/2018 at 14:24:17 Executing C:\Program Files\PostgreSQL\10/bin/stackbuilder.exe Script exit code: unknown signal Script output: Script stderr: child killed: unknown signal Error running C:\Program Files\PostgreSQL\10/bin/stackbuilder.exe : child killed: unknown signal

 

Highlighted
Adventurer

Re: PostgreSQL Installer fails at Initializing the database cluster. Help.

Moderator

Re: PostgreSQL Installer fails at Initializing the database cluster. Help.

Hi,

From the shared log files it seems that initcluster script ran successfully and also able to start the cluster and stopped after sometime. Could you please check if data directory "C:\Program Files\PostgreSQL\10\data" is exist or not. If its exist then share the log files to from log folder to identify the issue. Also check the permission of the data directory if its properly set.

In addition to the above troubleshooting could you please try changing the temp directory as follows,

1> Try changing the TEMP directory

For Example,
Try to launch the installer from cmd by setting the manual TEMP location,
c:\>mkdir mytemp
c:\>cd mytemp
c:\mytemp>set TEMP=c:\mytemp
c:\mytemp>
c:\mytemp>echo %TEMP%
c:\mytemp
c:\mytemp>c:\postgresql-9.6.3-2-windows-x64.exe

Check if the installer is able to complete the installation or not.

Highlighted
Adventurer

Re: PostgreSQL Installer fails at Initializing the database cluster. Help.

Just to let you know. 

I can run the PgAMIN program but it has no cluster attached.

The C:\Program Files\PostgreSQL\10\data  directory does exist.  The installation creates a pg_log file within it, which is empty.

 

It seems that somehow the server can't communicate with the data folder, so all of the checks on the data cluster using the icacals 

Here is one of the batch files (radE2EC7.bat) that fails:

 

@ECHO OFF
CHCP 1252
icacls "C:\TD1_SHR\PostGreSQL" /T /C /grant "NT AUTHORITY\NetworkService":(OI)(CI)(F) > "C:\Users\TDFM1\AppData\Local\Temp\rad9B37A.tmp" 2>&1
EXIT /B %ERRORLEVEL%

 

TDFM1 is an administrator for the PC, and we are running logged on to the TDFM1 account.

The C:\USERS\TDFM1\  folder is not shared.   Its security settings provide full control to the System, TDFM1, and Administrators user names. No other users show up.

 

This is also true for the C:\Users\TDFM1\AppData\Local\Temp folder.

 

When PGADMIN communicates with the data cluster does it do so as an external user?

Could this be a sharing problem? How do I check whether the Port 5432 is somehow blocked?

 

I will try what you suggest. 

Should I uninstall everyting first?

Does "postgresql-9.6.3-2-windows-x64.exe"  need to be copied to the C:\ or can I call it from where it is currently stored?

 

 

Highlighted
Adventurer

Re: PostgreSQL Installer fails at Initializing the database cluster. Help.

Also, when I open PGADMIN, there is no server shown.  

When I then open a cmd.exe window and issue the following, it does not show port 5432 to be open.

C:\Users\TDFM1>netstat -an |find /i "listening" > c:\netstatresults.txt

results are:

TCP 0.0.0.0:135 0.0.0.0:0 LISTENING
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING
TCP 0.0.0.0:623 0.0.0.0:0 LISTENING
TCP 0.0.0.0:3029 0.0.0.0:0 LISTENING
TCP 0.0.0.0:3389 0.0.0.0:0 LISTENING
TCP 0.0.0.0:5053 0.0.0.0:0 LISTENING
TCP 0.0.0.0:5054 0.0.0.0:0 LISTENING
TCP 0.0.0.0:8678 0.0.0.0:0 LISTENING
TCP 0.0.0.0:8679 0.0.0.0:0 LISTENING
TCP 0.0.0.0:16992 0.0.0.0:0 LISTENING
TCP 0.0.0.0:22350 0.0.0.0:0 LISTENING
TCP 0.0.0.0:43210 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49152 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49153 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49154 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49155 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49183 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49184 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49230 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49242 0.0.0.0:0 LISTENING
TCP 127.0.0.1:5939 0.0.0.0:0 LISTENING
TCP 127.0.0.1:42000 0.0.0.0:0 LISTENING
TCP 127.0.0.1:42001 0.0.0.0:0 LISTENING
TCP 127.0.0.1:43227 0.0.0.0:0 LISTENING
TCP 127.0.0.1:49348 0.0.0.0:0 LISTENING
TCP 127.0.0.1:54531 0.0.0.0:0 LISTENING
TCP 192.168.6.75:139 0.0.0.0:0 LISTENING
TCP [::]:135 [::]:0 LISTENING
TCP [::]:445 [::]:0 LISTENING
TCP [::]:623 [::]:0 LISTENING
TCP [::]:3029 [::]:0 LISTENING
TCP [::]:3389 [::]:0 LISTENING
TCP [::]:5053 [::]:0 LISTENING
TCP [::]:16992 [::]:0 LISTENING
TCP [::]:22350 [::]:0 LISTENING
TCP [::]:49152 [::]:0 LISTENING
TCP [::]:49153 [::]:0 LISTENING
TCP [::]:49154 [::]:0 LISTENING
TCP [::]:49155 [::]:0 LISTENING
TCP [::]:49184 [::]:0 LISTENING
TCP [::]:49230 [::]:0 LISTENING
TCP [::]:49242 [::]:0 LISTENING
TCP [::1]:49347 [::]:0 LISTENING

Highlighted
Level 3 Adventurer

Re: PostgreSQL Installer fails at Initializing the database cluster. Help.

Hi jabunch,

 

Hope you are doing good.

 

PostgreSql installs a service on the system when you install postgreSQL on windows. Please check for the service with the name postgresql in the Services management console. If the postgresSQL service is not running could you please start the service manually and then check if the server appears on pgAdmin. Please let us know how it goes.

 

Thanks,

Swagata

Highlighted
Adventurer

Re: PostgreSQL Installer fails at Initializing the database cluster. Help.

So, I followed the instructions on creating a mylib folder, setting the
%TEMP% and starting the installer from c:\.
It failed in the same way as my other attempts to install. batch files
open due to errors and two error boxes appear.

The postgresql service is not running and does not exist, even when I look
at all services using msconfig

When I start PGADMIN , it opens but there are no servers on the far left in Browser->Servers Pane.
the

Highlighted
Community Manager

Re: PostgreSQL Installer fails at Initializing the database cluster. Help.

Please note: This post is now being handled by a private support option to ensure appropriate attention.

Further communications are pending. 

 

Other comments from the PGR community are still welcome to be added here.

PGR Administration

Highlighted
Level 3 Traveller

Re: PostgreSQL Installer fails at Initializing the database cluster. Help.

Was this ever resolved? I am having the same issue at the moment with PostgreSQL 10.3

Highlighted
Moderator

Re: PostgreSQL Installer fails at Initializing the database cluster. Help.

Hi Brucelee,

Hope you are doing good !

Regarding the previous issue, we are still collecting information from the "jabunch" for troubleshooting.

As per the logs shared by "jabunch", indicates that server was started successfully but it doesn't look like it was started. The service start/stop details should be logged into event logs, as you are facing same issue so if possible could you please share the event logs located at Event Viewer-> Windows logs -> Application"

You may also try running "C:\Program Files\PostgreSQL\10\installer\server\startserver.vbs" postgresql-x64-10 to see if the service is started successfully.

Highlighted
Adventurer

Re: PostgreSQL Installer fails at Initializing the database cluster. Help.

I had a similar issue, it was resolved for me after changing the password in the setup wizard. It seems having curled braces or special characters in the password is causing unexpected/faulty behaviour in scripts executed by the setup. 

 

I had '§' and '{' in my initial password and it gave the same error. I used a simpler password without special characters during the setup and it worked just fine. Changed the password afterwards. 

Highlighted
Level 3 Traveller

Re: PostgreSQL Installer fails at Initializing the database cluster. Help.

Hello, I've a similar issue did you were able to resolve the issue ?

Highlighted
EDB Team Member

Re: PostgreSQL Installer fails at Initializing the database cluster. Help.

Hi @linkmichon,

 

Looks like you are also facing the issue with post installation steps for installing the postgres on Windows server.

 

The cluster initialization fails at the post-installation steps, this could happen due to below reasons:

 

1) Check whether any anti-virus software or other software such security software is running which could be blocking the execution of the vb script of the post installation step.
2) Use the admin user to install the postgres and make sure you have privileges on the data directory location.

 

Please check above and try the installation again and get back to us in case of any issues/queries.

 

Regards,

Sudhir

Highlighted
Adventurer

Re: PostgreSQL Installer fails at Initializing the database cluster. Help.

This seems to be a prevelant issue with many different versions of the database and lots of people providing lots of different answers, however none of them have worked for me. I am trying to install postgresql-12.0-1-windows-x64.exe.  I have tried changing the location of my data folder, I have checked %COMSPEC%, I have disabled AVAST, I have tried manually changing the permissions on my data folder but no luck.  Here is I believe the pertinent section of the log file:

 

[02:44:33] Running the post-installation/upgrade actions:
[02:44:33] Write the base directory to the ini file...
[02:44:33] Write the version number to the ini file...
Initialising the database cluster (this may take a few minutes)...
Executing cscript //NoLogo "C:\Program Files\PostgreSQL\12/installer/server/initcluster.vbs" "NT AUTHORITY\NetworkService" "postgres" "****" "C:\Users\lehrian\AppData\Local\Temp/postgresql_installer_0339009b14" "C:\Program Files\PostgreSQL\12" "C:\Program Files\PostgreSQL\12\data" 5432 "DEFAULT" 0
Script exit code: 1

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

Called CreateDirectory(C:\Program Files\PostgreSQL\12\data)...
Called CreateDirectory(C:\Program Files\PostgreSQL\12)...
Called ClearAcl (C:\Program Files\PostgreSQL\12\data)...
Executing batch file 'radF5BB8.bat'...
Called Die(Failed to reset the ACL (C:\Program Files\PostgreSQL\12\data))...
Failed to reset the ACL (C:\Program Files\PostgreSQL\12\data)

Script stderr:
Program ended with an error exit code

Error running cscript //NoLogo "C:\Program Files\PostgreSQL\12/installer/server/initcluster.vbs" "NT AUTHORITY\NetworkService" "postgres" "****" "C:\Users\lehrian\AppData\Local\Temp/postgresql_installer_0339009b14" "C:\Program Files\PostgreSQL\12" "C:\Program Files\PostgreSQL\12\data" 5432 "DEFAULT" 0: Program ended with an error exit code
Problem running post-install step. Installation may not complete correctly
The database cluster initialisation failed.
Executing icacls "C:\Users\lehrian\AppData\Local\Temp/postgresql_installer_1b52e140ee" /inheritance:r
Script exit code: 0

 

radF5BB8.bat is failing.  The contents of the bat file are:  

 

@ECHO OFF
CHCP 1252
icacls "C:\Program Files\PostgreSQL\12\data > "C:\Users\lehrian\AppData\Local\Temp\rad2ABF0.tmp" 2>&1
EXIT /B %ERRORLEVEL%

 

I notice there is a " missing from after data.  I believe this is causing this script to fail and the rest of initcluster.vbs to die. 

 

The method call in initcluster.vbs that generates this file is DoCmd and I have included it here.  I believe the error is on the bolded line.  The single " should be triple like """.  This will add the closing " to the command.  As this file gets overwritten ever time I run the installer I can't test to see that this actually fixes the issue so I still don't have PostgreSQL installed :-(  Any ideas how to get the installation to complete?  

 

' Execute a command
Function DoCmd(strCmd)
Dim objBatchFile
Set objBatchFile = objTempFolder.CreateTextFile(strBatchFile, True)
objBatchFile.WriteLine "@ECHO OFF"
objBatchFile.WriteLine "CHCP " & objShell.RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage\ACP")
objBatchFile.WriteLine strCmd & " > """ & strOutputFile & """ 2>&1"
objBatchFile.WriteLine "EXIT /B %ERRORLEVEL%"
objBatchFile.Close
WScript.Echo " Executing batch file '" & strBatchFile & "'..."
DoCmd = objShell.Run(objTempFolder.Path & "\" & strBatchFile, 0, True)
If objFso.FileExists(objTempFolder.Path & "\" & strBatchFile) = True Then
objFso.DeleteFile objTempFolder.Path & "\" & strBatchFile, True
Else
WScript.Echo " Batch file '" & strBatchFile & "' does not exist..."
End If
If objFso.FileExists(strOutputFile) = True Then
Dim objOutputFile
Set objOutputFile = objFso.OpenTextFile(strOutputFile, ForReading)
WScript.Echo " " & objOutputFile.ReadAll
objOutputFile.Close
objFso.DeleteFile strOutputFile, True
Else
WScript.Echo " Output file does not exists..."
End If
End Function

Highlighted
Adventurer

Re: PostgreSQL Installer fails at Initializing the database cluster. Help.

Well that didn't solve my problem.  I was able to replace the initcluster.vbs with my edited version that had the three " in it and the radE53CC.bat file looked better but I still got the failure.  Here is the pertinent section of the log file.

 

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

Called CreateDirectory(C:\Users\lehrian\Documents\PostgresData)...
Called CreateDirectory(C:\Users\lehrian\Documents)...
Called ClearAcl (C:\Users\lehrian\Documents\PostgresData)...
Executing batch file 'radE53CC.bat'...
Called Die(Failed to reset the ACL (C:\Users\lehrian\Documents\PostgresData))...
Failed to reset the ACL (C:\Users\lehrian\Documents\PostgresData)

Script stderr:
Program ended with an error exit code

Error running cscript //NoLogo "C:\Program Files\PostgreSQL\12/installer/server/initcluster.vbs" "NT AUTHORITY\NetworkService" "postgres" "****" "C:\Users\lehrian\AppData\Local\Temp/postgresql_installer_6836f804fd" "C:\Program Files\PostgreSQL\12" "C:\Users\lehrian\Documents\PostgresData" 5432 "DEFAULT" 0: Program ended with an error exit code
Problem running post-install step. Installation may not complete correctly
The database cluster initialisation failed.
Executing icacls "C:\Users\lehrian\AppData\Local\Temp/postgresql_installer_420debc0cc" /inheritance:r
Script exit code: 0

 

So I saw another post where you suggested running the command manually.  Here is the command I ran:

 

C:\Users\lehrian\AppData\Local\Temp>"C:\Program Files\PostgreSQL\12/installer/server/initcluster.vbs" "NT AUTHORITY\NetworkService" "postgres" "123iop" "C:\Users\lehrian\AppData\Local\Temp/postgresql_installer_0339009b14" "C:\Program Files\PostgreSQL\12" "C:\Users\lehrian\Documents\PostgresData" 5432 "DEFAULT" 0

 

I changed the data file to not be under Program Files as I know that can sometimes be dicey.  I don't think I mentioned I'm on Windows 10 and there are no pending updates.  

 

I got the same error as was in the log file:

 

Called Die(Failed to reset the ACL (C:\Users\lehrian\Documents\PostgresData))...

 

So I am now completely stumped.  Any ideas?  

Highlighted
Adventurer

Re: PostgreSQL Installer fails at Initializing the database cluster. Help.

Wow.  Well I finally got it to work by manually initializing the database cluster.  I installed PostgreSQL into C:\PostgreSQL and not under Program Files.  I then ran the command:

 

initdb -D c:\PostgreSQL\Data

 

and at first it failed with a Permission denied.  So I manually changed the permission on the C:\PostgreSQL folder to give the Users group Full Control.  Then I ran the command again and it worked!  I then used the command that it told me:

 

pg_ctl -D ^"c^:^\PostgreSql^\Data^" -l logfile start

 

and the server started.  I was able to use pgAdmin 4 and see the cluster and database.  I then shut down pgAdmin 4 server and ran the installation program again and it finally completed successfully.  Though I still don't see a PostgreSQL service so I'm not sure what will happen when I reboot, but at least I have made some progress.  I have to say, this has not been the easiest database server I have installed.  

Highlighted
EDB Team Member

Re: PostgreSQL Installer fails at Initializing the database cluster. Help.

Hi dlehrian,

 

Glad that you were able to proceed on this task by changing the permissions and the location.

Earlier you did mentioned about, the change in location for the data directory and the necessary permissions.

So those possibilities were ruled out at that point of instance.

Can you share the bitrock installer logs and the database logs.

Highlighted
Adventurer

Re: PostgreSQL Installer fails at Initializing the database cluster. Help.

Yeah, that was odd as that was one of the first suggestions I came across.  It said to give Full Control to Users and then run the installer again.  I tried that and it didn't work.  I also tried putting the data files in my Documents folder and I tried installing everything under C:\PostgreSQL but I didn't get it to work until I ran the cluster initialization manually.  

 

So regarding log files, do you want the log from one of the earlier ones that failed or from the last one that succeeded?  I see the bitrock_installer.log files in the %temp% folder.  Where are the database log files you are looking for?  

Highlighted
Adventurer

Re: PostgreSQL Installer fails at Initializing the database cluster. Help.

We finally gave up, and switched PCs.  Not really an acceptable solution but we had to live with it.  Sorry to hear that it is still a problem with newer releases.

 
JAB