cancel
Showing results for 
Search instead for 
Did you mean: 

Postgresql Installer Updates fail in non-interactive/silent mode

Ab
Adventurer

Postgresql Installer Updates fail in non-interactive/silent mode

Hello All,

 

Starting with the latest release of the EnterpriseDB Postgresql interactive installer, it appears silent/non-interactive mode no longer works. To be clear, I am refering to the Interactive installer available here and not the EDB Postgres Enterprise or EDB Postgres Strandard installers.

 

Previously my team could apply updates using the following command line options:

--mode unattended --create_shortcuts 0 --unattendedmodeui none --install_runtimes 0

 

Currently the only workaround we have is to switch to using minimalWithDialogs and setting the --prefix and --datadir options. We have tested on Windows 10 and Windows Server 2012 R2 with Postgres 9.4.22 and Postgres 9.6.13. In the case of 9.6.13 an additional error/warning dialog displays that must be clicked through.

 

Is this a known issue that will be addressed in the next release of the EnterpriseDB Postgres installer? Is there a better place/mechanisim to report this issue?

 

7 REPLIES 7
Highlighted
EDB Team Member

Re: Postgresql Installer Updates fail in non-interactive/silent mode

Hi Ab,

 

We have tested your scenario in our local machine on both Windows 10 and Windows Server 2012 R2 with Postgres 9.4.22 and Postgres 9.6.13 with the following command and it works for us without any issues.

 

--mode unattended --create_shortcuts 0 --unattendedmodeui none --install_runtimes 0

 

Please find the attached screenshot for your reference.

 

We have also used the below command and it worked for both 9.4.22 and Postgres 9.6.13 we haven’t received any error.

 

--mode unattended --create_shortcuts 0 --unattendedmodeui none --install_runtimes 0 --datadir "C:\Program Files\PostgreSQL\9.6\data" --prefix "C:\Program Files\PostgreSQL\9.6\" --serverport 5433

 

Could you please share the bit rock installer log from temp location and also exact error which you are facing.

Ab
Adventurer

Re: Postgresql Installer Updates fail in non-interactive/silent mode

Hello kapil,

See the below screenshot from my attempt this morning to apply Postgres 9.4.22 update on Windows 2K12 over a Postgres 9.4.18 installation.

Error-display.pngError Postgres 9.4 on 2K12

Below is the output from the bitrock_installer log on the failed attempt:

Log started 05/23/2019 at 09:20:12
Preferred installation mode : unattended
Trying to init installer in mode unattended
Mode unattended successfully initialized
Executing C:\Users\pgadmin\AppData\Local\Temp/postgresql_installer_bf1f6e9c65/temp_check_comspec.bat 
Script exit code: 0

Script output:
 "test ok"

Script stderr:
 

The chosen installation directory exists and is non-empty. Please choose a different directory

I'm working on getting the same for Postgres 9.6.13 and should have something shortly.

EDB Team Member

Re: Postgresql Installer Updates fail in non-interactive/silent mode

Hi Ab,

 

Form the below error from the bitrock installer and screenshot it says that installation directory exist and is non-empty before installing you should make sure that your postgres installation directory must be empty or choose a different directory where their should be nothing and it should be empty.

 

The chosen installation directory exists and is non-empty. Please choose a different directory

Hope this helps you.

Ab
Adventurer

Re: Postgresql Installer Updates fail in non-interactive/silent mode

Hello kapil,

 

The error displayed is the problem. We are attempting to update existing installations of Postgres 9.4 and 9.6 to the latest. We didn't receieve the error from our testing for releases prior to 9.4.22 and 9.6.13.

 

Going forward my team is going use the pre-built Windows binaries and provide an installer ourselves. Not a big lift for us but others may be a little suprised if they use the Bitrock installer in silent mode.

 

Thanks

EDB Team Member

Re: Postgresql Installer Updates fail in non-interactive/silent mode

Hi Ab,

 

Again I have tested this in my local machine it works on windows 7, 10 and 2012 R2 machines for PostgreSQL 9.4.22 and 9.6.13 version without any issues and I can successfully updated the minor latest patch for both version PostgreSQL 9.4.22 and 9.6.13 version.

 

Please find the attached screen shot for your reference.

 

Screenshot 2019-05-25 at 2.52.03 PM.png

 

I think, issue is machine spceific issue because we are not seeing any issues with Bitrock installer in silent mode,  and also could you please provide the exact steps which you are trying to perform on the windows machine.

Ab
Adventurer

Re: Postgresql Installer Updates fail in non-interactive/silent mode

Hi kapil,

 

Sorry to take so long to get back to you. It looks like the issue is if installation of Postgresql prior to 9.4.22 and 9.6.13 use values for --prefix and --datadir that aren't the default values, the error is thrown.

 

Here are my steps to reproduce using Postgresql 9.4.18/Postgresql 9.4.22 64-bit on a clean Windows Server 2012 R2 x64 VM.

1. Install Visual C++ 2013 x64 and Visual C++ 2013 x86 runtimes.

2. Ensure all Windows Updates are applied.

3. Install Postgresql 9.4.18 with the following command line:

postgresql-9.4.18-1-windows-x64.exe --prefix "C:\Postgresql-9.4" --datadir "C:\Postgresql-data\9.4" --install_runtimes 0 --create_shortcuts 0 --mode unattended --unattendedmodeui none 

4. Attempt to install Postgresql 9.4.22 with the following command line:

postgresql-9.4.22-1-windows-x64.exe --install_runtimes -0 --create_shortcuts 0 --mode unattended --unattendedmodeui none

5. An error dialog will display stating: The chosen installation directory exists and is non-empty. Please choose a diffrent directory. After about 5 seconds the dialog will close itself.

EDB Team Member

Re: Postgresql Installer Updates fail in non-interactive/silent mode

Hi Ab,

 

The difference of behavior between default folder and other folder you have noticed is expected behaviour, the reason is the default location "C:\Program Files\PostgreSQL\9.4" as the appropriate permissions and it is secured and permission for this folder will not be changed, so basically it is a secure and as appropriate permission for this folder we allow to install the PostgreSQL on default location if it is empty or non-empty.

 

For non-default directoreis like "C:\Postgresql-data\9.4" we are not sure what permission has been set by the user and has appropriate permissions or not and also due to insecure we doesn't allow to install the PostgreSQL on non-default location if it is non-empty. So we forcefully ask the user to remove the exiting directory and create a folder in location which is secure and has appropriate permissions.

 

Hope this helps you.