pgadmin-org / pgagent

pgAgent - A job scheduler for PostgreSQL
https://www.pgadmin.org/
Other
103 stars 41 forks source link

pgagent_11 not work #26

Closed PeterEgorov closed 1 year ago

PeterEgorov commented 2 years ago

I download https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7.8-x86_64/pgagent_11-4.0.0-4.rhel7.x86_64.rpm and install it on CentOS Linux release 7.8.2003 (Core)

but pagent not working

postgresql.log: 2022-10-03 17:01:45 MSK postgres 127.0.0.1(45240) 6696 ERROR: unterminated quoted string at or near "'" at character 80 2022-10-03 17:01:45 MSK postgres 127.0.0.1(45240) 6696 STATEMENT: INSERT INTO pgagent.pga_jobagent (jagpid, jagstation) SELECT pg_backend_pid(), ' 2022-10-03 17:01:45 MSK postgres 127.0.0.1(45242) 6701 ERROR: unterminated quoted string at or near "'" at character 80 2022-10-03 17:01:45 MSK postgres 127.0.0.1(45242) 6701 STATEMENT: INSERT INTO pgagent.pga_jobagent (jagpid, jagstation) SELECT pg_backend_pid(), '

pgagent_11.log: Mon Oct 3 17:01:55 2022 WARNING: Couldn't create the primary connection [Attempt #6]

dpage commented 2 years ago

That output is a somewhat contradictory. The PostgreSQL log indicates pgAgent is connected, but is running syntactically invalid queries, whilst the agent log shows an error message that will only be given if the connection to PostgreSQL failed entirely.

I will note that the failure to create the primary connection error will occur with the way the pgAgent RPMs from yum.postgresql.org are configured. They will configure pgAgent to run under a user account which has no access to the PostgreSQL server by default. We don't control that packaging, but their issue tracker can be found at https://redmine.postgresql.org/projects/pgrpms/.

Did you modify either the pgAgent systemd unit file or service configuration following installation, or make changes to the PostgreSQL hba/ident configuration to allow it to connect? If so, what were those changes?

devrimgunduz commented 1 year ago

Hi,

@dpage : Actually the deamon runs as pgagent user, but the default user to connect to the database is postgres, per /etc/pgagent/pgagent_11.conf .

@PeterEgorov can you please use a use a recent version? 4.0.0 is an old release, and RHEL 7 has 4.2.1 already which includes a few packaging fixes as well.

Thanks!

akshay-joshi commented 1 year ago

Hi @PeterEgorov

Can you please use/test on 4.2.2 and update us?

akshay-joshi commented 1 year ago

No response from the author, hence closing it.