Fwd: pgAgent: ERROR: Couldn't register event handle.

From: Arturas Mazeika <mazeika(at)gmail(dot)com>
To: pgadmin-support(at)lists(dot)postgresql(dot)org
Subject: Fwd: pgAgent: ERROR: Couldn't register event handle.
Date: 2018-06-11 13:35:34
Message-ID: CAAUL=cFvdnR-ycgB9BjOdvCisS7S=CDBRmW3i6LjDSEDhE6S6g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support pgsql-hackers

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+DX6OW2XMTFW2wUpDHSADow@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-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)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

In response to

Browse pgadmin-support by date

  From Date Subject
Next Message Michael Zsolt 2018-06-11 14:02:53 Fwd: Windows 10 - pg4 Query Initialization Issue
Previous Message Dave Page 2018-06-08 08:20:53 Re: pgAdmin4 - Browser command

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2018-06-11 13:49:41 Re: Performance regression with PostgreSQL 11 and partitioning
Previous Message Robert Haas 2018-06-11 13:27:17 Re: [PATCH v16] GSSAPI encryption support