pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: abhishekzararia@gmail.com
Subject:  BUG #18827: PostgreSQL 17.4-1 Installation – Database Cluster Initialization Failed Due to Execution Policy
Date: Thu, 27 Feb 2025 19:08:18 +0000
Message-ID: <18827-321d50a337732028@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      18827
Logged by:          Abhishek Zararia
Email address:      abhishekzararia@gmail.com
PostgreSQL version: 17.4
Operating system:   Microsoft Windows 10
Description:        

Dear Support Team,

While installing PostgreSQL 17.4-1, I encountered the following error during
database cluster initialization:
***************************************
Error running C:\windows\System32\cmd.exe /c
"C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy
Bypass -File "C:\Program
Files\PostgreSQL\17/installer/server/initcluster.ps1" "NT
AUTHORITY\NetworkService" "postgres" "****"
"C:\Users\<User>\AppData\Local\Temp/postgresql_installer_f3480bc391"
"C:\Program Files\PostgreSQL\17" "C:\Program Files\PostgreSQL\17\data" 5432
"DEFAULT" 0: File C:\Program
Files\PostgreSQL\17\installer\server\initcluster.ps1 cannot be loaded. The
file C:\Program 
Files\PostgreSQL\17\installer\server\initcluster.ps1 is not digitally
signed. You cannot run this script on the 
current system. For more information about running scripts and setting
execution policy, see about_Execution_Policies 
at https:/go.microsoft.com/fwlink/?LinkID=135170.
    &#43; CategoryInfo          : SecurityError: (:) [],
ParentContainsErrorRecordException
    &#43; FullyQualifiedErrorId : UnauthorizedAccess
Problem running post-install step. Installation may not complete correctly
 The database cluster initialisation failed.
***************************************

Upon investigation, I found that my System Execution Policy
(Get-ExecutionPolicy -List) had "MachinePolicy" set to "AllSigned", which
caused the installation to fail due to script signature enforcement.

When I changed "MachinePolicy" to "Undefined", the installation proceeded
successfully, and the PostgreSQL service started without issues.

Could you confirm if this is the expected behavior in PostgreSQL 17.4-1? I
did not encounter this issue in previous PostgreSQL versions. Was this
change intentional, or is it an overlooked error?

Awaiting your response.

Best regards,
Abhishek Zararia



Message-ID: <18827-321d50a337732028@postgresql.org>
Permalink:  ../18827-321d50a337732028@postgresql.org/
Also on:    postgresql.org/message-id/18827-321d50a337732028@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, abhishekzararia@gmail.com
  Subject: Re:  BUG #18827: PostgreSQL 17.4-1 Installation – Database Cluster Initialization Failed Due to Execution Policy
  In-Reply-To: <18827-321d50a337732028@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox