I'm trying to install postgreSQL on my windows 10 computer for the first time. I got two errors at the end of the installation
1) a non-fatal error occured during cluster initialisation. please check the installation log in C:\users\abc\AppData\Local\Temp for details
2) problem running post-install step. Installation may not complete correctly.Failed to start the database-server.
I also tried a number of other (but very dated) solutions to similar problems users experienced such as moving my data directory outside of the Postgres directory entirely. Most of these solutions date back and don't seem to work anymore.
The one that seemed closest to working is [PostgreSQL Database Cluster Initialisation Failed Solution][1]
However, I can't find "postgres" as a user. I get an error saying: "An object named "postgres" cannot be found. Check the selected object types and location for accuracy and ensure that you typed the object name correctly, or remove this object from the selection."
Does anybody have any updated solutions/tips for this?
Please see the logs: I have added some more logs below this.
> Log started 09/08/2017 at 15:35:34
Preferred installation mode : qt
Trying to init installer in mode qt
Mode qt successfully initialized
Executing C:\Users\skum\AppData\Local\Temp/postgresql_installer_c42ee2159f/temp_check_comspec.bat
Script exit code: 0
Script output:
"test ok"
Script stderr:
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-9.6 Data Directory. Setting variable iDataDirectory to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-9.6 Service ID. Setting variable iServiceName to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-9.6 Service Account. Setting variable iServiceAccount to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-9.6 Super User. Setting variable iSuperuser to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-9.6 Branding. Setting variable iBranding to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-9.6 DisableStackBuilder. Setting variable iDisableStackBuilder to empty value
[15:35:38] Existing base directory: C:\Users\skum\postgres_inst
[15:35:38] Existing data directory:
[15:35:38] Using branding: PostgreSQL 9.6
[15:35:38] Using Super User: postgres and Service Account: NT AUTHORITY\NetworkService
[15:35:38] Using Service Name: postgresql-x64-9.6
Executing cscript //NoLogo "C:\Users\skum\AppData\Local\Temp\postgresql_installer_c42ee2159f\prerun_checks.vbs"
Script exit code: 0
Script output:
The scripting host appears to be functional.
Script stderr:
Executing C:\Users\skum\AppData\Local\Temp\postgresql_installer_c42ee2159f\vcredist_x64.exe /passive /norestart
Script exit code: 0
Script output:
Script stderr:
Executing C:\Users\skum\AppData\Local\Temp\postgresql_installer_c42ee2159f\vcredist_x86.exe /passive /norestart
Script exit code: 0
Script output:
Script stderr:
Executing C:\Users\skum\AppData\Local\Temp\postgresql_installer_c42ee2159f\getlocales.exe
Script exit code: 0
Logs Part 1:
Failed to ensure the data directory is accessible (C:\Users\skum\postgresqlData)
Executing batch file 'radB66AD.bat'...
The files belonging to this database system will be owned by user "skum".
This user must also own the server process.
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.
fixing permissions on existing directory C:/Users/skum/postgresqlData ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... windows
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok
Success. You can now start the database server using:
"C:\Users\skum\postgres_inst\bin\pg_ctl" -D "C:\Users\skum\postgresqlData" -l logfile start
Reading: C:\Users\skum\postgresqlData\postgresql.conf exists...
Writing: C:\Users\skum\postgresqlData\postgresql.conf exists...
Called AclCheck(C:\Users\skum\postgresqlData)
Called IsVistaOrNewer()...
'winmgmts' object initialized...
Version:10.
MajorVersion:10
Executing icacls to ensure the NT AUTHORITY\NetworkService account can read the path C:\Users\skum\postgresqlData
Executing batch file 'radB66AD.bat'...
'icacls' is not recognized as an internal or external command,
operable program or batch file.
Called IsVistaOrNewer()...
'winmgmts' object initialized...
Version:10.
MajorVersion:10
Granting service account access to the data directory (using icacls) to NT AUTHORITY\NetworkService:
Executing batch file 'radB66AD.bat'...
'icacls' is not recognized as an internal or external command,
operable program or batch file.
Failed to grant service account access to the data directory (C:\Users\skum\postgresqlData)
initcluster.vbs ran to completion
Script stderr:
Program ended with an error exit code
Error running cscript //NoLogo "C:\Users\skum\postgres_inst/installer/server/initcluster.vbs" "NT AUTHORITY\NetworkService" "postgres" "****" "C:\Users\skum\postgres_inst" "C:\Users\skum\postgresqlData" 5432 "DEFAULT" 0: Program ended with an error exit code
Configuring database server startup...
Executing cscript //NoLogo "C:\Users\skum\postgres_inst\installer\server\startupcfg.vbs" 9.6 "NT AUTHORITY\NetworkService" "****" "C:\Users\skum\postgres_inst" "C:\Users\skum\postgresqlData" "postgresql-x64-9.6"
Script exit code: 0
Script output:
startupcfg.vbs ran to completion
Script stderr:
Creating menu shortcuts...
Executing cscript //NoLogo "C:\Users\skum\postgres_inst\installer\server\createshortcuts.vbs" 9.6 "postgres" 5432 "PostgreSQL 9.6" "C:\Users\skum\postgres_inst" "C:\Users\skum\postgresqlData" "postgresql-x64-9.6"
Script exit code: 0
Script output:
Start FixupFile(C:\Users\skum\postgres_inst\scripts\serverctl.vbs)...
Opening file for reading...
Closing file (reading)...
Replacing placeholders...
Opening file for writing...
Closing file...
End FixupFile()...
Start FixupFile(C:\Users\skum\postgres_inst\scripts\runpsql.bat)...
Opening file for reading...
Closing file (reading)...
Replacing placeholders...
Opening file for writing...
Closing file...
End FixupFile()...
createshortcuts.vbs ran to completion
Script stderr:
Starting the database server...
Executing cscript //NoLogo "C:\Users\skum\postgres_inst\installer\server\startserver.vbs" postgresql-x64-9.6
Script exit code: 1
Script output:
Starting postgresql-x64-9.6
Failed to start the database server (2)
Script stderr:
Program ended with an error exit code
Error running cscript //NoLogo "C:\Users\skum\postgres_inst\installer\server\startserver.vbs" postgresql-x64-9.6: Program ended with an error exit code
Problem running post-install step. Installation may not complete correctly
Failed to start the database server.
Creating Uninstaller
Creating uninstaller 25%
Creating uninstaller 50%
Creating uninstaller 75%
Creating uninstaller 100%
Installation completed
Log finished 09/08/2017 at 15:41:35
Related
I am executing a remote batch file using PSExec64:
PSExec64.exe" \\A0987SERV "C:\\Test\\save_file.bat" -u user -p password
The remote batch file:
SET "PATH1=C:\temp_folder"
SET "OFF_LINE_PATH=\\10.121.11.2\data"
copy "%PATH1%\myfile.txt" "%OFF_LINE_PATH%\extract.txt"
Batch works if I launch it from the remote computer but when I launch it with PSExec, I get:
*** Could not find directory '\\10.121.11.2\data'
Please advise.
So, I came across the same issue as posted here, BUT my error log says something different (see below, please). I have been trying to install PostgreSQL 9.5.11 on Windows 10 (x64) using Enterprise DB interactive installer. But, no success (I am aware about the BigSQL installers but I prefer the Enterprise DB one :)).
I googled already and tried the suggested solutions here, here and here. However, no use. Can someone please help me to resolve this error?
Here is the lovely error message I am getting:
Log started 04/17/2018 at 11:28:34
Preferred installation mode : qt
Trying to init installer in mode qt
Mode qt successfully initialized
Executing C:\my_user\AppData\Local\Temp/postgresql_installer_676baef523/temp_check_comspec.bat
Script exit code: 0
Script output:
"test ok"
Script stderr:
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-9.5 Data Directory. Setting variable iDataDirectory to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-9.5 Base Directory. Setting variable iBaseDirectory to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-9.5 Service ID. Setting variable iServiceName to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-9.5 Service Account. Setting variable iServiceAccount to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-9.5 Super User. Setting variable iSuperuser to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-9.5 Branding. Setting variable iBranding to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-9.5 Version. Setting variable brandingVer to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-9.5 Shortcuts. Setting variable iShortcut to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-9.5 DisableStackBuilder. Setting variable iDisableStackBuilder to empty value
[11:28:39] Existing base directory:
[11:28:39] Existing data directory:
[11:28:39] Using branding: PostgreSQL 9.5
[11:28:39] Using Super User: postgres and Service Account: NT AUTHORITY\NetworkService
[11:28:39] Using Service Name: postgresql-x64-9.5
Executing cscript //NoLogo "C:\my_user\AppData\Local\Temp\postgresql_installer_676baef523\prerun_checks.vbs"
Script exit code: 1
Script output:
CScript Error: Loading script "C:\my_user\AppData\Local\Temp\postgresql_installer_676baef523\prerun_checks.vbs" failed (Access is denied. ).
Script stderr:
Program ended with an error exit code
Error running cscript //NoLogo "C:\my_user\AppData\Local\Temp\postgresql_installer_676baef523\prerun_checks.vbs": Program ended with an error exit code
I would like to use windows task scheduler to backup tables from a MySQL database every night. I created a .bat file that runs via the task scheduler. It creates the file but the file is empty. Here is the code:
"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqldump.exe" --host=localhost --protocol=tcp --user=root --password=password --set-gtid-purged=OFF --flush-privileges=TRUE --port=3306 --default-character-set=utf8 --skip-triggers "maintenance" "safe_main" > "D:\testDump2.sql"
This will create the file and name it appropriately but the file is empty. This happens even when I run the bat file as an admin.
However when I run the same line in Windows Powershell it will create the same file with content.
The end result needs to be an sql file with data every night. Any help would be appreciated.
I have been trying to install PostgreSQL 9.2 for the last couple of days. I guess I tried everything that I could find online but the service still will not start. I am currently running Windows 7 SP1. I used to have PostgreSQL 8.3 installed and working fine but a couple of weeks ago I decided to uninstall it. I thoroughly uninstalled it (delete the postgres user and the data file) and now every time I try to install any version I get this non-fatal error at the end of the setup when the loading of the database modules takes place.
I managed to see that the postgresql service does not start or as windows puts it starts then stops.
This is the relevant part of the log file of the installation:
Successfully processed 771 files; Failed processing 0 files
initcluster.vbs ran to completion
Script stderr:
Configuring database server startup...
Executing cscript //NoLogo "C:\Program Files (x86)\PostgreSQL\9.2\installer\server\startupcfg.vbs" 9.2 "NT AUTHORITY\NetworkService" "****" "C:\Program Files (x86)\PostgreSQL\9.2" "C:\Program Files (x86)\PostgreSQL\9.2\data" "postgresql-9.2"
Script exit code: 0
Script output:
startupcfg.vbs ran to completion
Script stderr:
Creating menu shortcuts...
Executing cscript //NoLogo "C:\Program Files (x86)\PostgreSQL\9.2\installer\server\createshortcuts.vbs" 9.2 "postgres" 5432 "PostgreSQL 9.2 (x86)" "C:\Program Files (x86)\PostgreSQL\9.2" "C:\Program Files (x86)\PostgreSQL\9.2\data" "postgresql-9.2"
Script exit code: 0
Script output:
Start FixupFile(C:\Program Files (x86)\PostgreSQL\9.2\scripts\serverctl.vbs)...
Opening file for reading...
Closing file (reading)...
Replacing placeholders...
Opening file for writing...
Closing file...
End FixupFile()...
Start FixupFile(C:\Program Files (x86)\PostgreSQL\9.2\scripts\runpsql.bat)...
Opening file for reading...
Closing file (reading)...
Replacing placeholders...
Opening file for writing...
Closing file...
End FixupFile()...
createshortcuts.vbs ran to completion
Script stderr:
Starting the database server...
Executing cscript //NoLogo "C:\Program Files (x86)\PostgreSQL\9.2\installer\server\startserver.vbs" postgresql-9.2
Script exit code: 0
Script output:
Starting postgresql-9.2
Service postgresql-9.2 started successfully
startserver.vbs ran to completion
Script stderr:
Loading additional SQL modules...
Executing cscript //NoLogo "C:\Program Files (x86)\PostgreSQL\9.2\installer\server\loadmodules.vbs" "postgres" "****" "C:\Program Files (x86)\PostgreSQL\9.2" "C:\Program Files (x86)\PostgreSQL\9.2\data" 5432
Script exit code: 2
Script output:
Installing the adminpack module in the postgres database...
Executing 'C:\Users\George\AppData\Local\Temp\radA5996.bat'...
psql: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
Failed to install the 'adminpack' module in the 'postgres' database
loadmodules.vbs ran to completion
Script stderr:
Program ended with an error exit code
Error running cscript //NoLogo "C:\Program Files (x86)\PostgreSQL\9.2\installer\server\loadmodules.vbs" "postgres" "****" "C:\Program Files (x86)\PostgreSQL\9.2" "C:\Program Files (x86)\PostgreSQL\9.2\data" 5432 : Program ended with an error exit code
[10:34:28] Write the data directory to the ini file...
[10:34:28] Write the port number, service ID, locale and superuser to the ini file...
[10:34:28] Write ServiceID(postgresql-9.2) to registry/ini...
[10:34:28] Write Superuser to ini file and windows registry...
[10:34:28] Write Service Account to ini file and windows registry...
[10:34:28] Write the server description to the ini file...
[10:34:28] Write the server branding to the ini file...
[10:34:28] Write the 'whether stack-builder is disabled or not' to the ini file...
[10:34:29] Finished running post-installation/upgrade tasks.
Creating Uninstaller
Creating uninstaller 25%
Creating uninstaller 50%
Creating uninstaller 75%
Creating uninstaller 100%
Installation completed
I had the same problem. At one point it needs to get a package via internet connection. This is not right because the install package s/b able to install without a connection but that's how it is. Your firewall is blocking the install. Here's what you need to do:
Shut Down Windows Firewall (Control Panel\All Control Panel Items\Windows Firewall\Customize Settings)
If you use this great program shut down Firewall Control (Exit from task bar or Use Task Mgr to kill UI & Service - 2 items)
For downloading Selected Packages:
Shut Down Key Protection Services:
Shut Down Base Filtering (Leaves you unprotected! - Dependencies will.restart when BFE is restarted)
Base Filtering Engine
IKE and AuthIP IPsec Keying Modules
IPsec Policy Agent
ICS
...
Don't forget to restart all protections.
I faced similar issues of Pg 9.2.4 installer on Win7 x64. It turned out that
'adminpack' module did not load due to stopped postgres service. It starts and then
terminates almost immediately. You may check this running Pg service manually to see if it
can load. If it cant this may be from missing config files from "data" directory. initdb
command cant create valid cluster and copy corresponding *.conf files. I tried to dig into
details and the installer has complicated checks of user permissions which could fail in your (and my) case.
Just try installing Pg from zip binaries. It took only the following commands (less than
20 minutes). Original article.
1) Create "postgres" windows user (with no admin rights) and granted it full privileges on
your Pg folder and "data" folder. To do this from command line run "cmd" as administrator (press Ctrl-Shift-Enter instead of Enter to run "cmd") and issue: "net user postgres
/add". Then right click on your Pg folder (and "data" folder if it is outside) and grant all permissions to "postgres".
2) Install Microsoft Visual C++ 20xx Redistributable Package which comes with one click Pg
installer (vcredist_x64.exe from Users\"your user"\AppData\Local\Temp\postgresql_installer_**** - folder created by one click Pg installer on first run).
3) Unzip Pg binaries to your Pg folder and "cmd" as administrator to its bin directory.
4) Run to init cluster: initdb -U postgres -A password -E utf8 -W -D "path to your Pg folder"\data
5) Run to install windows service: pg_ctl register -N "postgresql" -U ".\postgres" -D "path to your Pg folder/data" -w
6) Open windows services list and open "postgresql" service properties. Then set password for windows user postgres there. Try starting your new Pg service. If it starts then everything should be ok.
7) Open bin\pgAdmin3, connect to local server and open postgres database and its metadata. You should see a complaint about missing admin services and a propose to correct this. Just press Ok - 'adminpack' should be installed.
Install postgres only from windows account written in english. For example installation from user "Аня" always fail.
Solution is to shutdown the windows firewall before installing. After the installation you can enable the windows firewall.
Try installing outside of "C:\Program Files" which has special permissions on Windows.
We had similar issues and simply by installing into C:\Postres92 everything works right out of the box.
I had the same problem, caused by restricted access rights in the Program Files directory, due to the fact that the data directory was C:\Program Files (x86)\PostgreSQL\9.2\data
Changing the data directory to C:\ProgramData\PostgreSQL\9.2\data resolved the problem.
I haven't been able to re-install PostgreSQL + PostGIS properly on our virtual server.
Installing PostgreSQL the following error occurs about the end of the process:
"A non-fatal error occurred whilst loading database modules. Please check the installation log in C:...\Temp for details."
Here is what the log says:
Loading additional SQL modules...
Executing cscript //NoLogo "C:\Programme\PostgreSQL\9.0\installer\server\loadmodules.vbs" "postgres" "****" "C:\Programme\PostgreSQL\9.0" "C:\Programme\PostgreSQL\9.0\data" 5432
Script exit code: 2
Script output:
Installing the adminpack module in the postgres database...
Executing 'C:\DOKUME~1\Kiesow\LOKALE~1\Temp\rad3C00F.bat'...
Couldn't find the output file...
Failed to install the 'adminpack' module in the 'postgres' database
loadmodules.vbs ran to completion
Script stderr:
Program ended with an error exit code
Error running cscript //NoLogo "C:\Programme\PostgreSQL\9.0\installer\server\loadmodules.vbs" "postgres" "****" "C:\Programme\PostgreSQL\9.0" "C:\Programme\PostgreSQL\9.0\data" 5432 : Program ended with an error exit code
Afterwards installation completes, I can start pgAdmin, log in and create new databases. Everything looks fine until I try to add PostGIS, using the stack builder wizard. Again the installation is almost finished, when:
"Database creation failed."
"Would you like to view the error log " "create_templatepostgis_db_error.txt'?"
This error log doesn't exist. I might ignore the error and create the template db manually, which works. But I cannot use types like 'geometry', so I think, PostGIS is not yet usable.
Maybe anyone of you has got an idea of what I could have done wrong? Any hints? Can anybody help me to interpret the error log?
I use Windows XP, PostgreSQL 9.0 32bit (same with 8.4), PostGIS 1.5.
Postgres 8.3 + PostGIS was installed on this system earlier, but I uninstalled, deleted the data directory and let the installation wizard create a new posgres windows user.
Did a few reboots, too.
And I did choose a locale instead of [Default locale] at Postgres installation.
This is another part of the log I am suspicios of. It is right in the beginning. Maybe this helps:
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-9.0 Data Directory. Setting variable iDataDirectory to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-9.0 Base Directory. Setting variable iBaseDirectory to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-9.0 Service ID. Setting variable iServiceName to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-9.0 Service Account. Setting variable iServiceAccount to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-9.0 Super User. Setting variable iSuperuser to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-9.0 Branding. Setting variable iBranding to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-9.0 Version. Setting variable brandingVer to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-9.0 Shortcuts. Setting variable iShortcut to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-9.0 DisableStackBuilder. Setting variable iDisableStackBuilder to empty value
[15:44:31] Existing base directory:
[15:44:31] Existing data directory:
[15:44:31] Using branding: PostgreSQL 9.0
[15:44:31] Using Super User: postgres and Service Account: postgres
[15:44:31] Using Service Name: postgresql-9.0
Executing cscript //NoLogo "C:\Dokumente und Einstellungen\Kiesow\Lokale Einstellungen\Temp\prerun_checks.vbs"
Script exit code: 0
Script output:
The scripting host appears to be functional.
Script stderr:
Executing cscript //NoLogo "C:\Dokumente und Einstellungen\Kiesow\Lokale Einstellungen\Temp\postgresql_installer\installruntimes.vbs" "C:\Dokumente und Einstellungen\Kiesow\Lokale Einstellungen\Temp\postgresql_installer\vcredist_x86.exe"
Script exit code: 3010
Script output:
Executing the runtime installer: C:\Dokumente und Einstellungen\Kiesow\Lokale Einstellungen\Temp\postgresql_installer\vcredist_x86.exe
The runtime package exited with error code: 3010
From a command prompt, run this single command:
C:\Programme\PostgreSQL\9.0\bin\psql.exe -p 5432 -U postgres -W -f C:\Programme\PostgreSQL\9.0\share\contrib\adminpack.sql postgres
Its output may be more informative. Running the above is all the .vbs is doing, incidentally.
The reason for prompting this error message was due to because of localhost is pointing to some other machine.
disable firewall and antivirus and try installing it again.