cancel
Showing results for 
Search instead for 
Did you mean: 

Error while installation PostgresSQL

SOLVED
Level 2 Adventurer

Error while installation PostgresSQL

Hi there,

 

Just starting with PostgresSQL. And got hurdel at first step "installation". While installation it is showing some error "the database cluster initialisation failed postgresql". 

I have no previous experience on it but still I have checked all directory and data paths, they are correct. Followed all tenets by putting setup in C: OR run as Admin. But no luck.

Can I ask for some help please? 

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
EDB Team Member

Re: Error while installation PostgresSQL

Hi Shobhit,

 

Can you share more details on the Version of the installation.Not clear what are the steps that have been followed.

Seems you are doing so on Windows.

Have you had the appropriate permissions and ownership for installing the software.The Administrator with the full privilges.

 

 
 

View solution in original post

8 REPLIES 8
Highlighted
EDB Team Member

Re: Error while installation PostgresSQL

Hi Shobhit,

 

Can you share more details on the Version of the installation.Not clear what are the steps that have been followed.

Seems you are doing so on Windows.

Have you had the appropriate permissions and ownership for installing the software.The Administrator with the full privilges.

 

 
 

View solution in original post

Level 2 Adventurer

Re: Error while installation PostgresSQL

Hi Rahul,

Yes this is windows 8 &  64 bit. And I have administrative rights in my machine and I tried two versions of Postgres 12 & 11.

Regards

EDB Team Member

Re: Error while installation PostgresSQL

Hi @shobhit_bbd,

 

The error shared by you, states that the installation completed, however, the DB cluster initialization failed.

 

Could you please check the below things :

 

- The permissions are set correctly on the data directory.
- No antivirus is running on the server as it might cause the issue.
- Create the DB cluster manually using the initdb utility.

 

Also, could you please share the installation logs with us for the analysis.

 

Regards,

Sudhir

Level 3 Traveller

Re: Error while installation PostgresSQL

 

 

c:\bin\PostgreSQL12\bin>initdb.exe -U "postgres" -W -D"C:\DB\PostgreSQL\"
initdb: ошибка: Программа "postgres" найдена в "c:\bin\PostgreSQL12\bin/initdb.exe",
но её версия отличается от версии initdb.
Проверьте правильность установки СУБД.

 

Error: Program "postgres" find in ..... but his version different version from initdb. 

 

Its a back translate from russian. How to fix this behavoir?  Instalator pack dowanload from official site, exe and zip variant.  Error identical :(

 

 

 

Level 2 Adventurer

Re: Error while installation PostgresSQL

Hi Sudhir, Please find the installation log below. I have removed all startups lines and leaving only few last process finalization in which I can see some process failures. Doing this due to text limitation here. Thanks Shobhit ......................................

@slonkar wrote:

Hi @shobhit_bbd,

 

The error shared by you, states that the installation completed, however, the DB cluster initialization failed.

 

Could you please check the below things :

 

- The permissions are set correctly on the data directory.
- No antivirus is running on the server as it might cause the issue.
- Create the DB cluster manually using the initdb utility.

 

Also, could you please share the installation logs with us for the analysis.

 

Regards,

Sudhir


Script output: processed file: C:\Users\ssrivastava\AppData\Local\Temp/postgresql_installer_ea7e7b5a21 Successfully processed 1 files; Failed processing 0 files Script stderr: Executing icacls "C:\Users\ssrivastava\AppData\Local\Temp/postgresql_installer_ea7e7b5a21" /T /Q /grant "CORP\ssrivastava:(OI)(CI)F" Script exit code: 0 Script output: Successfully processed 1 files; Failed processing 0 files Script stderr: [10:20:25] Running the post-installation/upgrade actions: [10:20:25] Write the base directory to the ini file... [10:20:25] 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\11/installer/server/initcluster.vbs" "NT AUTHORITY\NetworkService" "postgres" "****" "C:\Users\ssrivastava\AppData\Local\Temp/postgresql_installer_ea7e7b5a21" "C:\Program Files\PostgreSQL\11" "C:\Program Files\PostgreSQL\11\data" 5432 "DEFAULT" 0 Script exit code: 1 Script output: WScript.Shell Initialized... Scripting.FileSystemObject initialized... Called CreateDirectory(C:\Program Files\PostgreSQL\11\data)... Called CreateDirectory(C:\Program Files\PostgreSQL\11)... Called ClearAcl (C:\Program Files\PostgreSQL\11\data)... Executing batch file 'rad724BA.bat'... Output file does not exists... Removing inherited ACLs on (C:\Program Files\PostgreSQL\11\data) Executing batch file 'rad724BA.bat'... 'icacls' is not recognized as an internal or external command, operable program or batch file. Failed to remove inherited ACLs on (C:\Program Files\PostgreSQL\11\data) WScript.Network initialized... strParentOfDataDirC:\Program Files\PostgreSQL\11 logged in userCORP\ssrivastava Called AclCheck(C:\Program Files\PostgreSQL\11\data) Called IsVistaOrNewer()... 'winmgmts' object initialized... Version:6.3 MajorVersion:6 Executing icacls to ensure the CORP\ssrivastava account can read the path C:\Program Files\PostgreSQL\11\data Executing batch file 'rad724BA.bat'... 'icacls' is not recognized as an internal or external command, operable program or batch file. Called IsVistaOrNewer()... 'winmgmts' object initialized... Version:6.3 MajorVersion:6 Ensuring we can write to the data directory (using icacls) to CORP\ssrivastava: Executing batch file 'rad724BA.bat'... 'icacls' is not recognized as an internal or external command, operable program or batch file. Failed to ensure the data directory is accessible (C:\Program Files\PostgreSQL\11\data) Called IsVistaOrNewer()... 'winmgmts' object initialized... Version:6.3 MajorVersion:6 Granting full access to (NT AUTHORITY\NetworkService) on (C:\Program Files\PostgreSQL\11\data) Executing batch file 'rad724BA.bat'... 'icacls' is not recognized as an internal or external command, operable program or batch file. Failed to grant access to (NT AUTHORITY\NetworkService) on (C:\Program Files\PostgreSQL\11\data) Called IsVistaOrNewer()... 'winmgmts' object initialized... Version:6.3 MajorVersion:6 Granting full access to CREATOR OWNER on (C:\Program Files\PostgreSQL\11\data) Executing batch file 'rad724BA.bat'... 'icacls' is not recognized as an internal or external command, operable program or batch file. Failed to grant access to CREATOR OWNER on (C:\Program Files\PostgreSQL\11\data) Called IsVistaOrNewer()... 'winmgmts' object initialized... Version:6.3 MajorVersion:6 Granting full access to SYSTEM on (C:\Program Files\PostgreSQL\11\data) Executing batch file 'rad724BA.bat'... 'icacls' is not recognized as an internal or external command, operable program or batch file. Failed to grant access to SYSTEM on (C:\Program Files\PostgreSQL\11\data) Called IsVistaOrNewer()... 'winmgmts' object initialized... Version:6.3 MajorVersion:6 Granting full access to Administrators on (C:\Program Files\PostgreSQL\11\data) Executing batch file 'rad724BA.bat'... 'icacls' is not recognized as an internal or external command, operable program or batch file. Failed to grant access to Administrators on (C:\Program Files\PostgreSQL\11\data) Executing batch file 'rad724BA.bat'... The files belonging to this database system will be owned by user "ssrivastava". This user must also own the server process. The database cluster will be initialized with locale "English_United Kingdom.1252". The default text search configuration will be set to "english". Data page checksums are disabled. fixing permissions on existing directory C:/Program Files/PostgreSQL/11/data ... initdb: could not change permissions of directory "C:/Program Files/PostgreSQL/11/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\PostgreSQL\11/installer/server/initcluster.vbs" "NT AUTHORITY\NetworkService" "postgres" "****" "C:\Users\ssrivastava\AppData\Local\Temp/postgresql_installer_ea7e7b5a21" "C:\Program Files\PostgreSQL\11" "C:\Program Files\PostgreSQL\11\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\ssrivastava\AppData\Local\Temp/postgresql_installer_69fedc639b" /inheritance:r Script exit code: 0 Script output: processed file: C:\Users\ssrivastava\AppData\Local\Temp/postgresql_installer_69fedc639b Successfully processed 1 files; Failed processing 0 files Script stderr: Executing icacls "C:\Users\ssrivastava\AppData\Local\Temp/postgresql_installer_69fedc639b" /T /Q /grant "CORP\ssrivastava:(OI)(CI)F" Script exit code: 0 Script output: Successfully processed 1 files; Failed processing 0 files Script stderr: [10:22:50] Delete the temporary scripts directory... Executing icacls "C:\Users\ssrivastava\AppData\Local\Temp/postgresql_installer_065c9debf5" /inheritance:r Script exit code: 0 Script output: processed file: C:\Users\ssrivastava\AppData\Local\Temp/postgresql_installer_065c9debf5 Successfully processed 1 files; Failed processing 0 files Script stderr: Executing icacls "C:\Users\ssrivastava\AppData\Local\Temp/postgresql_installer_065c9debf5" /T /Q /grant "CORP\ssrivastava:(OI)(CI)F" Script exit code: 0 Script output: Successfully processed 1 files; Failed processing 0 files Script stderr: Executing icacls "C:\Users\ssrivastava\AppData\Local\Temp/postgresql_installer_ced62def11" /inheritance:r Script exit code: 0 Script output: processed file: C:\Users\ssrivastava\AppData\Local\Temp/postgresql_installer_ced62def11 Successfully processed 1 files; Failed processing 0 files Script stderr: Executing icacls "C:\Users\ssrivastava\AppData\Local\Temp/postgresql_installer_ced62def11" /T /Q /grant "CORP\ssrivastava:(OI)(CI)F" Script exit code: 0 Script output: Successfully processed 1 files; Failed processing 0 files Script stderr: Creating menu shortcuts... Executing cscript //NoLogo "C:\Program Files\PostgreSQL\11\installer\server\createshortcuts_clt.vbs" "PostgreSQL 11" "C:\Program Files\PostgreSQL\11" Script exit code: 0 Script output: Start FixupFile(C:\Program Files\PostgreSQL\11\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: [10:22:53] Write the server description to the ini file... [10:22:53] Write the server branding to the ini file... Creating Uninstaller Creating uninstaller 25% Creating uninstaller 50% Creating uninstaller 75% Creating uninstaller 100% Installation completed
EDB Team Member

Re: Error while installation PostgresSQL

Hi @shobhit_bbd,

 

Thanks for sharing the installation logs, from the logs it looks like the permission issue for the data directory while running the initdb.

 

fixing permissions on existing directory C:/Program Files/PostgreSQL/11/data ... initdb: could not change permissions of directory "C:/Program Files/PostgreSQL/11/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\PostgreSQL\11/installer/server/initcluster.vbs" "NT AUTHORITY\NetworkService" "postgres" "****" "C:\Users\ssrivastava\AppData\Local\Temp/postgresql_installer_ea7e7b5a21" "C:\Program Files\PostgreSQL\11" "C:\Program Files\PostgreSQL\11\data" 5432 "DEFAULT" 0: Program ended with an error exit code Problem running post-install step.

The installer will set permissions on the install directory but not on parent directories of it, so make sure to grant the access permissions to the PostgreSQL service account on the parent directory as well.

 

For more information refer the section I'm getting permissions errors when installing/running initdb in the below link :

 

https://wiki.postgresql.org/wiki/Running_%26_Installing_PostgreSQL_On_Native_Windows

 

Regards,
Sudhir

Level 3 Traveller

Re: Error while installation PostgresSQL

I have the same problem... nothing working... that is impossible to install PostgreSQL at my PC.
EDB Team Member

Re: Error while installation PostgresSQL

Hi @Filemonjr1,

 

Can you please share the installation logs and let us know where do you getting the issue.

 

Is it the installation step or post-installation step (such as initdb ) which is failing.

 

Regards,

Sudhir