[SOLVED] PostgreSQL: "The database cluster initialisation failed"
Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Junior Member
    Join Date
    Jul 2008
    Posts
    6

    Default [SOLVED] PostgreSQL: "The database cluster initialisation failed"

    Posting this because no other posted solutions on this forum worked for me. Might help some others

    Relevent specs:
    - Win 7 Pro x64 SP1, Avira Antivir, Windows Firewall

    Problem:
    - Cannot install PostgreSQL via HM2 bundle
    Code:
    Connection to DB failed: --> could not connect to server: Connection refused "
    - Cannot install PostgreSQL 8.3/8.4/9.0/9.1 via official website:
    Code:
    Ensuring we can write to the data directory (using icacls) to  w0ng:
        Executing batch file 'rad612AE.bat'...
        processed file: C:\PostgreSQL\data
    Successfully processed 1 files; Failed processing 0 files
    
    Failed to ensure the data directory is accessible (C:\PostgreSQL\data)
        Executing batch file 'rad612AE.bat'...
        The files belonging to this database system will be owned by user "w0ng".
    This user must also own the server process.
    
    The database cluster will be initialized with locale English_Australia.1252.
    The default text search configuration will be set to "english".
    
    fixing permissions on existing directory C:/PostgreSQL/data ... ok
    creating subdirectories ... ok
    selecting default max_connections ... The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    10
    selecting default shared_buffers ... The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    400kB
    creating configuration files ... ok
    creating template1 database in C:/PostgreSQL/data/base/1 ... The system cannot find the path specified.
    child process exited with exit code 1
    initdb: removing contents of data directory "C:/PostgreSQL/data"
    
    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:\PostgreSQL/installer/server/initcluster.vbs" "postgres" "postgres" "****" "C:\PostgreSQL" "C:\PostgreSQL\data" 5432 "DEFAULT" : Program ended with an error exit code
    Problem running post-install step. Installation may not complete correctly
     The database cluster initialisation failed.
    Troubleshooting:
    - Run install as admin -> same problem
    - Disable AV + Firewall + Windows Defender -> same problem
    - Edit C:\Windows\System32\drivers\etc\hosts -> reboot -> same problem
    - Uninstalled AV -> same problem
    - Disabled UAC -> same problem
    - services.msc -> restart Secondary Logon Service -> same problem
    - Installed to c:\postgresql and c:\pgdata for data directory -> same problem
    - create folder C:\pgdata -> Properties -> Security -> Edit... -> Add... -> "postgres" -> OK -> Full Control -> same problem
    - manually running initdb -D C:\pgdata -> same problem
    - runas /user:postgres cmd.exe -> initdb -D C:\pgdata -> initdb successful, but when trying to "Start Server" -> "The system cannot find the path specified." -> checked services.msc -> no postgresql service was created during installation

    Solution:
    - Uninstall PostgreSQL
    - net user postgres /delete
    - Control Panel -> User Accounts -> Configure advanced user profile properties -> delete all "Unknown User" instances that seem to be left from postgres
    - compmgmt.msc -> Local Users and Groups -> Users -> New User... -> User name: postgres, Password: postgrespass -> Create
    - compmgmt.msc -> Local Users and Groups -> Users -> postgres -> Member of -> Add... -> Administrators -> OK
    - copy postgresql-8.4.9-1-windows.exe to C:\
    - runas /user:postgres cmd.exe -> cd \ -> postgresql-8.4.9-1-windows.exe -> installed successfully without errors. Checked data folder and confirmed files created successfully.

    - compmgmt.msc -> Local Users and Groups -> Users -> postgres -> Member of -> Administrators -> Remove
    - compmgmt.msc -> Local Users and Groups -> Users -> postgres -> Member of -> Add... -> Power Users -> OK
    - Installed HM2 -> created db successfully
    - Restarted computer -> HM2 runs properly (i.e. just to check postgresql service starts automatically)

    Kind of annoying that no one else seems to have had this specific problem with postgresql on the HM forums.

    Oh, related troubleshooting step that might help others. I had an earlier problem of *.vbs files being associated with vim instead of Windows Scripting Host when trying to install another program. So if youre getting Visual C++ errors even though you've got Visual C++ 2005/2008/2010 redistributables installed, try registering vbscript.dll:

    - regsvr32 %systemroot%\system32\vbscript.dll

  2. #2
    Junior Member
    Join Date
    Jan 2013
    Posts
    1

    Default

    Awesome post!! Struggled with this for ages and no other forums has answers...
    Yours was the only solution that worked!

    Thanks Heaps.

  3. #3
    Junior Member
    Join Date
    Mar 2013
    Posts
    2

    Default

    I registered to let you know that I had trouble installing PostgreSQL and this solved it for me. Thanks

  4. #4
    *** HM3! *** fozzy71's Avatar
    Join Date
    Jun 2005
    Location
    HM Support
    Posts
    32,793

    Default

    Thank you for letting us know it solved your problems. I had forgotten about this thread and this reminded me to bookmark it for future reference.

  5. #5
    Junior Member
    Join Date
    Mar 2013
    Posts
    2

    Default

    I got this error message when I first tried to log in using the new user account in Win7, but that was easily solved by switching accounts and logging in once.

  6. #6
    You're out! udbrky's Avatar
    Join Date
    Jul 2008
    Posts
    20,898

    Default

    Thank you for the information. Postgresql installations can be very difficult, and can lead to a lot of searching and trial and error. I am bookmarking this to help others in the future.
    Regards udbrky (Chris)

  7. #7
    Junior Member
    Join Date
    May 2014
    Posts
    1

    Default

    Many thanks. this solve my problem and i wonder how dificult is to find the solution searching all over internet.
    I repeate all steps related here on a Windows Server 2008 R2 Standard and it works.

    Now I must find how to replicate this steps into a PowerShell script, but this is another history.

    REally thank you very much indeed.

    Susana

  8. #8
    You're out! udbrky's Avatar
    Join Date
    Jul 2008
    Posts
    20,898

    Default

    Thank you for letting us know this is resolved.

    Good luck at the tables,

    Please let us know if we can help with anything else.
    Regards udbrky (Chris)

  9. #9
    Member
    Join Date
    Aug 2012
    Location
    Lisbon, Portugal
    Posts
    65

    Default

    What is this mean, I canīt understand...Thanks!

    - copy postgresql-8.4.9-1-windows.exe to C:\

  10. #10
    You're out! udbrky's Avatar
    Join Date
    Jul 2008
    Posts
    20,898

    Default

    Please see the post in your thread I just made.
    Regards udbrky (Chris)

Similar Threads

  1. Replies: 1
    Last Post: 07-15-2011, 09:32 PM
  2. Replies: 2
    Last Post: 12-16-2010, 03:11 AM
  3. Replies: 4
    Last Post: 07-18-2010, 06:21 AM
  4. HUD wont start "failed to create empty document msg"
    By SteveDaRake in forum Manager General
    Replies: 2
    Last Post: 04-30-2010, 08:56 PM
  5. Replies: 7
    Last Post: 08-23-2008, 12:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •