Hi PG-Admin Supporters, maybe you could help me with this issue?
I am overseeing a few hundred/thousand postgres/pgagent installations and on one installation the pgAgent does not start with a message as a service on a Windows Server: ERROR: Couldn't register event handle. once the service is being started. Investigation showed that this is not an issue of logging in as postgres, neither is this a connection issue to the postgres DB, see more details at https://dba.stackexchange.com/questions/207067/pgagent-does- not-start-with-message-error-couldnt-register-event-handle It seems to me that pgAgent tries and fails to write something to the windows logger . To confirm/reject this hypothesis I decided to download the sources of pgAgent adjust the code a bit, and see it for myself. This is what I did: (1) I installed MS Visual Studio 2017 Community (MSVS) (2) I downloaded wxWidgets, compiled it with the MSVS in UTF, Debugging and Release, win32 Settings (to F:\pgbuild\wxWidgets-3.1.1) (3) I downloaded, extracted, cmake-gui'ed pgAgent-3.4.0-Source into F:\pgbuild\pgAgent-3.4.0-Source (4) I download the 9.6 32bit postgres and extracted it into F:\pgbuild\pgsql (5) I adjusted pgAgent MSVS solution configuration to include F:\pgbuild\wxWidgets-3.1.1\lib\vc_lib\mswud and F:\pgbuild\pgsql\lib (6) F:\pgbuild has also libiconv, libxml2, libxslt (7) I am able to compile pgAgent to the point that the executable is created (that dies if I run it), other targets (ALL_BUILD, INSTALL, etc.) cannot be built successfully with the following error: 1>------ Build started: Project: run, Configuration: Debug Win32 ------ 1>Generating pgagent--3.4.sql, pgagent.control 1>CUSTOMBUILD : CMake error : Error processing file: cmake/MakeExt.cmake 1>Done building project "run.vcxproj" -- FAILED. 2>------ Skipped Build: Project: INSTALL, Configuration: Debug Win32 ------ 2>Project not selected to build for this solution configuration 3>------ Skipped Build: Project: PACKAGE, Configuration: Debug Win32 ------ 3>Project not selected to build for this solution configuration ========== Build: 0 succeeded, 1 failed, 4 up-to-date, 2 skipped ========== After inspecting the run.vcxproj file, I realized that the compilation error was caused by the directory issues (adding "cd ..") solved the building issues for the "run" project. Running the application fails with the error: The application was unable to start correctly (0xc000007b). Click OK to close the application. Questions: (1) Any comment how to address the initial problem (ERROR: Couldn't register event handle.) (2) Any comments, how to get pgAgent running? Cheers, Arturas PS. The original message to pgsql-hackers mailing lists can be found at: http://www.postgresql-archive.org/pgAgent-does-not-start- with-message-ERROR-Couldn-t-register-event-handle-td6021519.html https://www.postgresql.org/message-id/CAAUL=chzjuqdb3xkouk3qf0uuk8+dx6ow2xmtfw2wupdhsa...@mail.gmail.com ---------- Forwarded message ---------- Date: Thu, May 31, 2018 at 8:54 PM Subject: Re: pgAgent: ERROR: Couldn't register event handle. Cc: "pgsql-hack...@postgresql.org" <pgsql-hack...@postgresql.org> On Tue, May 29, 2018 at 8:15 AM, Arturas Mazeika wrote: > I am overseeing a few hundred/thousand postgres/pgagent installations and > on one installation the pgAgent does not start with a message as a service > on a Windows Server: > > ERROR: Couldn't register event handle. I think that this isn't the right mailing list for pgAgent questions. Perhaps the pgAdmin mailing list is the right place, since pgagent is, IIRC, distributed from the pgAdmin site? -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company