pgAgent problem - always runs jobs at every poll

From: "Andy Tilley" <andy(dot)tilley(at)bi-basics(dot)com>
To: <pgadmin-support(at)postgresql(dot)org>
Subject: pgAgent problem - always runs jobs at every poll
Date: 2009-02-20 19:28:23
Message-ID: 055f01c99391$65e5a6a0$31b0f3e0$@tilley@bi-basics.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

Hi there,

I'm having an issue with pgAgent which I'm sure is related to this bug:

http://archives.postgresql.org/pgadmin-support/2007-11/msg00098.php

I'm on Solaris x86, using pgAdmin 1.8.0 (the latest available build for this
OS)

When I start pgagent, I get this error though:

DEBUG: Database sanity check

DEBUG: Clearing zombies

18:56:08: Error: Cannot get the hostname (error 0: Error 0)

DEBUG: Checking for jobs to run

I've looked through the source, and it's probably here that it's failing.

int MainRestartLoop(DBconn *serviceConn)

.

wxString hostname = wxGetFullHostName();

.

Any idea as to why the hostname is not being returned? This is the cause of
the problem, I think.

Essentially, the SQL being issued is this:

SELECT J.jobid

FROM pgagent.pga_job J

WHERE jobenabled

AND jobagentid IS NULL

AND jobnextrun <= now()

AND jobhostagent = '' OR jobhostagent = ''

ORDER BY jobnextrun

So it ALWAYS returns the jobs, regardless of whether they're enabled or not.
Hence, they run at every single poll!

Many thanks

Andy Tilley

Browse pgadmin-support by date

  From Date Subject
Next Message Dave Page 2009-02-20 19:33:59 Re: pgAdmin no Job node
Previous Message Dave Page 2009-02-20 15:50:28 Re: pgAdmin no Job node