cancel
Showing results for 
Search instead for 
Did you mean: 

Postgresql 11 failing to Install on Windows

SOLVED
Level 2 Adventurer

Postgresql 11 failing to Install on Windows

Hello, all. First Post. Please excuse any missteps.

 

I have installed PostgreSQL 11.1 on many servers at this point but today I am stumped. I cannot get it to install on a Windows 2016 Server machine. The error message I get at the end of installation always is: "Failed to load SQL Modules into database Cluster."

 

I have read several posts here with the same error message and have tried all solutions mentioned. Among the posts I have reviewed are:

 

PostgreSQL-install-failing-on-Windows-Server-2008-R2

install-failing-on-Windows-Server-2016

Installer-fails-at-Initializing-the-database-cluster/m-p/1056

Installation-fails-with-Windows-10/m-p/1317

 

I even ran a PostgreSQL 11.1 installer from BigSQL. It failed as well, throwing the same error.

 

So as to help you avoid reading all of the above posts, I have tried all of the following:

1. Always running the installation executable as administrator.

2. Installing to non-default folders directly on the C Drive. (e.g. C:\postgres)

3. Creating both the installation and the Data folders first, assigning them full read/write permissions to "NETWORK SERVICE," then running the Installation Executable pointing to those created folders.

4. Added exceptions to all PostgreSQL files and folders to the Virus Scanner. (Windows Defender)

5. Completely disabed Windows Defender.

6. Created a new administrator user and ran the Installation Executable as that user.

7. Same as 3 above, but now with "Users."

8. Searched for, but didn't find the Service that blocked PostgreSQL installed as mentioned in one of the above posts.

9. Ran "chkdsk" to make sure I didn't have any orphaned security descriptors.

10. Manually ran the command in an Adminstrator-Level Command-Prompt: cscript //NoLogo "C:\Program Files\PostgreSQL\11/installer/server/initcluster.vbs" "NT AUTHORITY\NetworkService" "postgres" "****" "C:\Program Files\PostgreSQL\11" "C:\Program Files\PostgreSQL\11\data" 5432 "DEFAULT" 0 (Note: Password masked)

11. Verified that my PATH Environmental Variables were correct for %TEMP%, %WINDIR% and %ComSpec%

12. ...And yes, I restarted my server. :-)

 

What am I missing???

 

The only error in my installation log is the following:

[12:13:32] Installing the adminpack module in the postgres database...
Executing C:\Program Files\PostgreSQL\11\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.
[12:14:32] Write the data directory to the ini file...
[12:14:32] Write the port number, service ID, locale and superuser to the ini file...
[12:14:33] Write ServiceID(postgresql-x64-11) to registry/ini...
Problem running post-install step. Installation may not complete correctly
 Error reading file C:/Program Files/PostgreSQL/11/data/postgresql.conf
[12:14:33] Delete the temporary scripts directory...
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:
 

[12:14:34] Write the server description to the ini file...
[12:14:34] 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 01/09/2019 at 12:14:43

Additionally, the Data Folder always ends up with a Log folder inside of it, but nothing else, regardless of where the Data folder was created.

 

What other information would you like from me? Is there anything else I should try?

 

Thanks!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Level 2 Adventurer

Re: Postgresql 11 failing to Install on Windows

Hello, all,

 

Well, I found the problem this morning.

 

Turns out there was a "hidden" Administrator program running in the background on the server that I didn't have access to and couldn't even tell was running. A program called Dell SecureWorks Red Cloak was preventing the installation scripts from running properly. Once we got rid of that program, installation worked flawlessly. I'm up and running!

 

I'm sorry this took as much of your time and efforts that it did... I started scrutinizing every little process and service that Windows was running just to see if there was any way something was running that was interferring with PostgreSQL, and it turns out that is exactly what happened.

 

That said, I do very much appreciate your time and efforts in helping me out. Speaks volumes about the community and support behind the product and makes me feel much better about deploying it knowing there is such a dedicated group behind it. Thank you!!!

Tags (2)
28 REPLIES 28
Level 3 Adventurer

Re: Postgresql 11 failing to Install on Windows

Hi gschra11,

 

From the error, it looks like a firewall blocking connection on port 5432 for PostgreSQL service.

 

Please skip the firewall setting for port 5432 and try again. Let us know if any further assistance is needed. 

Level 2 Adventurer

Re: Postgresql 11 failing to Install on Windows

Port 5432 is open for both UDP and TCP on incoming and outgoing connections. Verified with the server that the port is open.
Highlighted
Level 2 Adventurer

Re: Postgresql 11 failing to Install on Windows

I was able to grab a bunch of log files from the failed installation. They are very verbose and I am unable to post here. Is there a link I can use to upload them to for review?

 

Thanks!

Level 3 Adventurer

Re: Postgresql 11 failing to Install on Windows

Hi gschra11,

 

Thanks for the updates.

Please upload the file to below link and notify once you upload it.

 

 
Let us know if you face any issues.
Level 2 Adventurer

Re: Postgresql 11 failing to Install on Windows

Ranjan,

 

The files have been uploaded. Thanks!

Level 3 Adventurer

Re: Postgresql 11 failing to Install on Windows

Hi gschra11,

 

Thanks for uploading files.

From the log file we can see that psql is failing to connect to the database for creating some extensions which are causing failure of post-installation steps.

 

Below are the general troubleshooting areas for above issue :

  1. PostgreSQL isn't running
  2. PostgreSQL isn't listening for TCP/IP connections (listen_addresses in postgresql.conf)
  3. PostgreSQL is only listening on IPv4 (0.0.0.0 or 127.0.0.1) and you're connecting on IPv6 (::1) or vice versa. This seems to be an issue on some older Mac OS X versions that have weird IPv6 socket behavior, and on some older Windows versions.
  4. PostgreSQL is listening on a different port to the one you're connecting on
  5. (unlikely) there's an iptables rule blocking loopback connections

Can you please recheck on above points, also share the steps (screenshots) you are following and where it is causing failure message.

Also, kindly confirm is postgresql running after you getting failure message (which is for post-installation steps) 

 

Meanwhile, we will investigate this at our end. Let us know for further updates. 

Level 2 Adventurer

Re: Postgresql 11 failing to Install on Windows

Hi, Ranjan,

 

In response to your inquiries:

1. PostgreSQL is definitely not running and will not run. The Service is in Windows Services, but when I try to run it, I get a dialog box that states that the Service started and then immediately stopped. The Windows Event Viewer indicates that PostgreSQL didn't start because it couldn't access the server configuration file "C:/Programs Files/PostgreSQL/11/data/postgresql.conf": No such file or directory. The Directory "C:\Program Files\PostgreSQL\11\data" is completely empty except for the "Log" folder, which is also completely empty.

2. True. PostgreSQL isn't running.

3. PostgreSQL isn't running.

4. PostgreSQL isn't running.

5. I checked the hosts files and confirmed that there are no settings that impact the loopback adapter.

 

This is where I am getting an error message:

1st error.PNG

 

This is the second dialog box that appears immediately after the first:

2nd error.PNG

 

I then get the installer telling me that everything installed...

3rd message.PNG

 

But the Service doesn't ever start...

4th dialog.PNG

 

...and the Data folder is empty:

5th windows.PNG

 

PostgreSQL isn't running after the installation completes.

 

Thanks!

Level 3 Adventurer

Re: Postgresql 11 failing to Install on Windows

Hi gschra11,

 

We went through logs you shared and it says that installation completed and cluster started. However, as it is failing to create the data directory contents for the cluster, service getting stopped and unable to connect to the database. Not sure data directory clean out/unable to write directory contents (is any permission issues)

 

We are investigating this, meanwhile, try to change the data directory location as a workaround and test.

 

 

EDB Team Member

Re: Postgresql 11 failing to Install on Windows

Hi @gschra11,

 

I can see that postgres is installed, however, it is failing the post installation steps.

 

I don’t see the logs for the cluster initialization in bitrock_installer.log. Could you please try the installation again and share the screenshots for all the steps (with which packages are selected for installation) and share the bitrock_installer logs.

 

Also, if it sill fails could you please execute the below command using the same user you are trying to install the postgres and share the results with us.

 

 "C:\Program Files\PostgreSQL\11/installer/server/initcluster.vbs" "NT AUTHORITY\NetworkService" "postgres" "****" "C:\Program Files\PostgreSQL\11" "C:\Program Files\PostgreSQL\11\data" 5432 "DEFAULT" 0

 

Please get back to us if you still face the issues.

 

Regards,

Sudhir