EnterpriseDB / edb-installers

PostgreSQL installers packaged by EDB
23 stars 7 forks source link

PostgreSQL installer does not work over a WinRM session. #150

Open Resident-Alien opened 2 weeks ago

Resident-Alien commented 2 weeks ago

With both PSRemoting and or Invoke-Command the PostgreSQL installer fails at the same place every time:


The database cluster will be initialized with locale "English_United States.1252". The default text search configuration will be set to "english".

Data page checksums are disabled. initdb: error: could not open file "C:\Users\%username%\AppData\Local\Temp/postgresql_installer_db2b356bbd\rad92FA3.tmp" for reading: Permission denied

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 C:\Windows\System32\cscript //NoLogo "C:\Program Files\PostgreSQL\16/installer/server/initcluster.vbs" "NT AUTHORITY\NetworkService" "postgres" "****" "C:\Users\%username%\AppData\Local\Temp/postgresql_installer_db2b356bbd" "C:\Program Files\PostgreSQL\16" "C:\Program Files\PostgreSQL\16\data" 5432 "DEFAULT" 1: Program ended with an error exit code Problem running post-install step. Installation may not complete correctly The database cluster initialisation failed. Problem running post-install step. Installation may not complete correctly The database cluster initialisation failed. Setting variable whoami from C:\Windows\System32\whoami Script exit code: 0


I thought this was a permissions issue, but when you remote into a windows server via WinRM your security context is set at your users highest level. I am a domain admin thus when I remote in my user is a domain admin, no need to elevate. The command works fine if you are local on the server and run in an elevated command prompt.

This affects both winget and just running the installer manually in the ps remote session. Is the installer just not able to be pushed to remote servers? Oddly enough Chocolately does seem to work without issue but they are always way behind and you can't rely on them if you need constant updates.

sandeep-edb commented 1 week ago

Hi, are you installing on a domain controller? Can you specify the installer version? Also if you can please share the installation log (created in TEMP)?