cancel
Showing results for 
Search instead for 
Did you mean: 

Postgresql 11 failing to Install on Windows

SOLVED
Highlighted
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
Highlighted
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!!!

View solution in original post

Tags (2)
30 REPLIES 30
Highlighted
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. 

Highlighted
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!

Highlighted
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.
Highlighted
Level 2 Adventurer

Re: Postgresql 11 failing to Install on Windows

Ranjan,

 

The files have been uploaded. Thanks!

Highlighted
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. 

Highlighted
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!

Highlighted
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.

 

 

Highlighted
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

Level 2 Adventurer

Re: Postgresql 11 failing to Install on Windows

Ranjan and Slonkar,

 

I have taken a total of 36 screen shots of my installation process and of all the dialog boxes that appered when I ran Slonkar's command. Additionally, I zipped up all of my temp files generated during the process. I have uploaded all 37 of these files to the link Ranjan provided me above.

 

Please let me know if you have any trouble receiving them.

 

Thanks!

Highlighted
Level 3 Adventurer

Re: Postgresql 11 failing to Install on Windows

Hi gschra11,

 

Thanks for the detail out, we received the information you shared.

 

Have tried the reinstallation, just ensure to remove the existing data directory created before going with reinstallation because we can see an error saying data directory is not empty. 

Highlighted
Level 2 Adventurer

Re: Postgresql 11 failing to Install on Windows

Yep, I remove the data folder after uninstallation and before reinstallation each time.

 

Additionally, installing to a different, non-default folder didn't fix the problem, either.

 

Thanks!

Highlighted
EDB Team Member

Re: Postgresql 11 failing to Install on Windows

Hi gschra11,

 

We are escalating this issue to our engineering team. 

We will update you as soon as we hear back from them.

 

Thank you for being patience.

Regards,
Dhananjay
Highlighted
EDB Team Member

Re: Postgresql 11 failing to Install on Windows

Hi gschra11,

 

Can you try executing the installer on the administrator command prompt with "--enable_acledit 1"  switch and share the bitrock installation log with us to anlysis further on this.

Highlighted
Level 2 Adventurer

Re: Postgresql 11 failing to Install on Windows

Kapil,

 

I have executed the command you sent me and uploaded the file to the link that Ranjan provided me earlier. Please let me know that you received the file and if you need anything else.

 

Thanks!

Highlighted
EDB Team Member

Re: Postgresql 11 failing to Install on Windows

Hello, 

 

Hope you are doing good. 

 

I have verified logs uploaded, Here i see the Message "Service postgresql-x64-11 started successfully" on bitrock log file. I am suspecting some process is blocking psql program. Or Permission issues on data directory. I am kindly requesting you to please follow below steps and update us , 

 

1. Uninstall Postgresql if it was already installed, And install on New Data Directory with Different location(try with other than C drive if possible), Give Full Access on Data Directory to Users, Then start installation.

2. Please trun off blockers like Windows Defender or Firewall or Any Powerbrocker for windows and make sure all are disabled during installtion.

3. Start installtion follow steps as you followed for installation earlier, Then if you get failed message "Failed to load modules" , instead of closing Dialog box, Check whether postgresql services are running or not in windows services, If services are running, Please fire psql command with all Connection options and check connectivity, Ex:below

 

<Binary_path>/psql.exe -d postgres -h localhost -p 5432 -U postgres

<Binary_path>/psql.exe -d postgres -h <External-IP> -p 5432 -U postgres

 

4. Please update us If services are not running when got "Failed to load Modules" dialogue, We will discuss this internally and update you soon.

 

 

 

Please let us know if you need any help further.

 

Regards,

Siva.

 

 

 

 

 

 

 

Highlighted
Level 2 Adventurer

Re: Postgresql 11 failing to Install on Windows

Hi, Siva,

 

I have completed your requested tasks and have uploaded the resulting bitrock_installer.log to the link. Please let me know that you received it.

 

I installed per the command you sent me last time with the --enable_acledit 1 switch and with Windows Defender disabled.

 

I also installed to a different folder that I let the installer create.

 

The installation still failed and the PostgreSQL service was NOT running at the time I got the error message, so I was unable to execute the PSQL command.

 

Please let me know if you need anything else from me.

 

Thanks!

Highlighted
EDB Team Member

Re: Postgresql 11 failing to Install on Windows

Hello, 

 

As i said in last communication,  Could you please Follow my steps, Please do not execute any on cmd terminal. 

 

I have verified logs uploaded, Here i see the Message "Service postgresql-x64-11 started successfully" on bitrock log file. And Error reading postgresql.conf file(Same as earlier). Below steps are same as earlier with Minor differences. 

 

NOTE: if you try with new user , Please add this user to Administrators and Power Users groups and give full access to Empty data directory and start installation on it. 

 

1. Can you please create a new data directory other than C drive and give full permissions to users and administrators. 

2. Please trun off blockers like Windows Defender or Firewall or Any Powerbrocker for windows and make sure all are disabled during installtion.
3. Install with Adminstrator privileges, After installation , Please check service status, if service is running please fire below commands and check.

<Binary_path>/psql.exe -d postgres -h localhost -p 5432 -U postgres
<Binary_path>/psql.exe -d postgres -h <External-IP> -p 5432 -U postgres

4. If services are not running, check If initdb creates new cluster, check pg_logs for any error while starting cluster., 

5. Please update us If services are not running when got "Failed to load Modules" dialogue, We will escalate this issue to Enginerring team. 

 

Please let us know if you need any help further., 

Regards,
Siva.

 

 

Highlighted
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!!!

View solution in original post

Tags (2)
Highlighted
EDB Team Member

Re: Postgresql 11 failing to Install on Windows

Hi  gschra11,

 

Thank you for the update.

 

We are glad to hear that your problem has been solved. 

 

Warm Regards,

Dhananjay

Regards,
Dhananjay
Highlighted
EDB Team Member

Re: Postgresql 11 failing to Install on Windows

Hi gschra11,

 

The error which your getting in the logs was mainly causes by the antivrus or firewall issue, however we have noticed that from past working experience on windows some of the services are interfering with postgresql installation on windows machines.

 

We have noticed some service problem for other user as well in his environment "BeyondTrust PowerBroker for Windows Service" is somehow interfering with postgresql installation. It was causing double quotes to be removed from cscript command and hence  installation was failing.They stopped "BeyondTrust PowerBroker for Windows Service" and the postgresql installation completed without any  error.

 

So in our previous response we requested to check above services is interfering with postgresql installation but in your case other service like "Dell SecureWorks Red Cloak" was causing the issue.

 

Glad to hear that your problem has been resolved. 

Highlighted
Level 3 Traveller

Re: Postgresql 11 failing to Install on Windows

Hi

 

I have tried all the steps but still not able to install pg11 on win 10 - Dell.

Kindly help.

 

Thanks

Highlighted
EDB Team Member

Re: Postgresql 11 failing to Install on Windows

Hi Dheeraj,

 

Could you please provide the permissions to veiw/download the bitrock installer files you have shared with us, when opening those files it says "permission denided" error and also I would recommend you to update on this thread, instead of replying to. 

Highlighted
Level 3 Traveller

Re: Postgresql 11 failing to Install on Windows

I have the same problem, how did you realize that there is a hidden program background on the server? Please help me I am really stuck! 

 

Thank you

Highlighted
EDB Team Member

Re: Postgresql 11 failing to Install on Windows

Hello @asya236 

 

I am suspecting that some other programs might stop you to proceeding with installation. i.e Antivirus programs, or firewall blockings , Dell Secure services or etc.. or else there would be some wrong configuration in setup. 

 

If you face same issue, Could you please attach bitrock installer log file. So that we will verify that what is causing installation. 

 

Please let me know if you need anymore details. 

 

Regards

Siva.

Highlighted
EDB Team Member

Re: Postgresql 11 failing to Install on Windows

Hello @asya236 

 

I am suspecting that some other programs might stop you to proceeding with installation. i.e Antivirus programs, or firewall blockings , Dell Secure services or etc.. or else there would be some wrong configuration in setup. 

If you face same issue, Could you please attach bitrock installer log file. So that we will verify that what is causing installation. 

 

Please let me know if you need anymore details. 

Regards

Siva.

Highlighted
Level 3 Traveller

Re: Postgresql 11 failing to Install on Windows

Hello Siva

I do not have any antivirus.
I have tried installation after deactivating the firewall, it didn't help.
Lastly, I checked the control panel - uninstall program and could not find Dell
SecureWorks Red Cloak.

Please help with an alternative method.

Thanks
Highlighted
EDB Team Member

Re: Postgresql 11 failing to Install on Windows

Hi @dheerajtuteja , 

 

Then it seems to have some configuration problem. i.e From bitrock installer log file, The below message is recorded

 

" Executing batch file 'rad01621.bat'...
The program "postgres" was found by "C:/Program Files/PostgreSQL/11/bin/initdb.exe"
but was not the same version as initdb.
Check your installation."

 

Error description: The version of postgres.exe and version of initdb.exe is different in installation location. i.e Before installtion,  please clean the directory if anything present  where you are installing postgres software(basically C:\program files\PostgreSQL\11). And check if any Environmental variables set in your machine points to old versions of postgresql. 

 

Environment Variables in Windows: Right click on my computer --> Properties -->Advanced System settings-->Click on Environmental Variables and check PATH.

 

Please check below steps. 

 

1. Whenever you uninstall, please uninstall with "uninstall-postgresql.exe" which is present on "C:\Program Files\PostgreSQL\11" Location. and remove everything under "C:\Program Files\PostgreSQL\11" if anything left and then try.

2. If you are trying to installing 11.2 then please try with 11.4(which is latest) and check results.

3. Please proceed with steps which i suggested, Which might help you to overcome error.

4. During installation ending, If you still see the error popup, Please run below commands on cmd and crosscheck versions. Because installation is failing due to mismatch of below files versions. 

"c:\Program Files\PostgreSQL\11\bin\postgres.exe" --version
"c:\Program Files\PostgreSQL\11\bin\initdb.exe" --version

 

Please let us know if you face any issues still.

Regards

Siva.

 

Highlighted
Level 3 Traveller

Re: Postgresql 11 failing to Install on Windows

Hello Siva
 
I have tried this as well.
Unfortunately, the same error.
 
Best, DT
Highlighted
EDB Team Member

Re: Postgresql 11 failing to Install on Windows

Hi Dheerajtuteja,

 

Please could you share the exact each steps which you are performing with the screenshot and alos let us know from where you have downleded the installtion file.