Thread: pgAgent Steps Not Executed
pgAdmins,

I added a new step to a pgAgent job a couple days ago, but noticed it has not been executing. It is listed under the job's steps in the pgAdmin object browser, as shown in the attached screenshot. However, when I view the properties of the job itself, and select the "Steps" tab, the second step is *not* shown (also shown in the screen shot).
So in one place pgAdmin sees both steps, but in another it does not. I assume that pgagent is using whatever algorithm does not see the second, just like the Steps tab of the job properties.

FWIW, both steps appear for this query:
postgres=# select * from pgagent.pga_jobstep where jstjobid = 1;
-[ RECORD 1 ]-----------------------------------------------------------------------------------------------------------------------------------------------------------
jstid | 1
jstjobid | 1
jstname | Liberate Logical
jstdesc |
jstenabled | t
jstkind | b
jstcode | echo "foo"
jstconnstr |
jstdbname |
jstonerror | f
jscnextrun | [null]
-[ RECORD 2 ]-----------------------------------------------------------------------------------------------------------------------------------------------------------
jstid | 29
jstjobid | 1
jstname | Liberate Reporting
jstdesc |
jstenabled | t
jstkind | b
jstcode | echo "bar"
jstconnstr |
jstdbname |
jstonerror | f
jscnextrun | [null]
-[ RECORD 1 ]-----------------------------------------------------------------------------------------------------------------------------------------------------------
jstid | 1
jstjobid | 1
jstname | Liberate Logical
jstdesc |
jstenabled | t
jstkind | b
jstcode | echo "foo"
jstconnstr |
jstdbname |
jstonerror | f
jscnextrun | [null]
-[ RECORD 2 ]-----------------------------------------------------------------------------------------------------------------------------------------------------------
jstid | 29
jstjobid | 1
jstname | Liberate Reporting
jstdesc |
jstenabled | t
jstkind | b
jstcode | echo "bar"
jstconnstr |
jstdbname |
jstonerror | f
jscnextrun | [null]
Bug? I’m using pgAgent 3.0.1 built for the pgrpms repo and pgAdmin3 1.14.1 built for Mac OS X.
Thanks,
David
Attachment
Hi
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
On Sun, Jan 15, 2012 at 7:18 PM, David E. Wheeler <david@justatheory.com> wrote:
pgAdmins,I added a new step to a pgAgent job a couple days ago, but noticed it has not been executing. It is listed under the job's steps in the pgAdmin object browser, as shown in the attached screenshot. However, when I view the properties of the job itself, and select the "Steps" tab, the second step is *not* shown (also shown in the screen shot).So in one place pgAdmin sees both steps, but in another it does not. I assume that pgagent is using whatever algorithm does not see the second, just like the Steps tab of the job properties.FWIW, both steps appear for this query:postgres=# select * from pgagent.pga_jobstep where jstjobid = 1;
-[ RECORD 1 ]-----------------------------------------------------------------------------------------------------------------------------------------------------------
jstid | 1
jstjobid | 1
jstname | Liberate Logical
jstdesc |
jstenabled | t
jstkind | b
jstcode | echo "foo"
jstconnstr |
jstdbname |
jstonerror | f
jscnextrun | [null]
-[ RECORD 2 ]-----------------------------------------------------------------------------------------------------------------------------------------------------------
jstid | 29
jstjobid | 1
jstname | Liberate Reporting
jstdesc |
jstenabled | t
jstkind | b
jstcode | echo "bar"
jstconnstr |
jstdbname |
jstonerror | f
jscnextrun | [null]Bug? I’m using pgAgent 3.0.1 built for the pgrpms repo and pgAdmin3 1.14.1 built for Mac OS X.
Depends on what the first step is doing. You have On Error set to Fail, which will cause subsequent steps to be skipped if an error is detected. What do you see in the job step log for the first step?
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
On Jan 16, 2012, at 7:45 AM, Dave Page wrote: > Depends on what the first step is doing. You have On Error set to Fail, which will cause subsequent steps to be skippedif an error is detected. What do you see in the job step log for the first step? Success: postgres=# select * from pgagent.pga_jobsteplog where jslid = 284; -[ RECORD 1 ]------------------------------ jslid | 284 jsljlgid | 211 jsljstid | 1 jslstatus | s jslresult | 0 jslstart | 2012-01-13 01:06:05.286733+00 jslduration | 06:01:33.881374 jsloutput | In any event, I would expect both steps to appear in the Steps tab of the properties of the job itself. And they don’t. :-( David
On Jan 16, 2012, at 9:05 AM, David E. Wheeler wrote: > postgres=# select * from pgagent.pga_jobsteplog where jslid = 284; > -[ RECORD 1 ]------------------------------ > jslid | 284 > jsljlgid | 211 > jsljstid | 1 > jslstatus | s > jslresult | 0 > jslstart | 2012-01-13 01:06:05.286733+00 > jslduration | 06:01:33.881374 > jsloutput | I did just discover that the schedule had an end date set. This happens to me sometimes: I open the schedule’s propertiesin pgAdmin3, and the current date and time is put in as an end time default value. If I don’t notice and deleteit, it will be saved. It’s possible this happened to me while the first step was running, so that the second wouldnever be called. Realized this when *neither* step ran last night. That certainly feels like a bug to me: if I have the “End” field blank(NULL), it should remain blank unless I set it. > In any event, I would expect both steps to appear in the Steps tab of the properties of the job itself. And they don’t.:-( This is still an issue, though. Thanks, David
Can you get me a dump of the pgagent schema please? On Mon, Jan 16, 2012 at 6:16 PM, David E. Wheeler <david@justatheory.com> wrote: > On Jan 16, 2012, at 9:05 AM, David E. Wheeler wrote: > >> postgres=# select * from pgagent.pga_jobsteplog where jslid = 284; >> -[ RECORD 1 ]------------------------------ >> jslid | 284 >> jsljlgid | 211 >> jsljstid | 1 >> jslstatus | s >> jslresult | 0 >> jslstart | 2012-01-13 01:06:05.286733+00 >> jslduration | 06:01:33.881374 >> jsloutput | > > I did just discover that the schedule had an end date set. This happens to me sometimes: I open the schedule’s propertiesin pgAdmin3, and the current date and time is put in as an end time default value. If I don’t notice and deleteit, it will be saved. It’s possible this happened to me while the first step was running, so that the second wouldnever be called. > > Realized this when *neither* step ran last night. That certainly feels like a bug to me: if I have the “End” field blank(NULL), it should remain blank unless I set it. > >> In any event, I would expect both steps to appear in the Steps tab of the properties of the job itself. And they don’t.:-( > > This is still an issue, though. > > Thanks, > > David -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company
On Jan 17, 2012, at 2:47 AM, Dave Page wrote: > Can you get me a dump of the pgagent schema please? It’s the standard schema, I think. Attached. Best, David
Attachment
On Tue, Jan 17, 2012 at 5:15 PM, David E. Wheeler <david@justatheory.com> wrote: > On Jan 17, 2012, at 2:47 AM, Dave Page wrote: > >> Can you get me a dump of the pgagent schema please? > > It’s the standard schema, I think. Attached. I really wanted the data in it :-) -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company
On Jan 17, 2012, at 9:17 AM, Dave Page wrote: >> It’s the standard schema, I think. Attached. > > I really wanted the data in it :-) Oh, you didn’t say that. Will send privately in a mo. David
On Mon, Jan 16, 2012 at 6:16 PM, David E. Wheeler <david@justatheory.com> wrote: > On Jan 16, 2012, at 9:05 AM, David E. Wheeler wrote: > >> postgres=# select * from pgagent.pga_jobsteplog where jslid = 284; >> -[ RECORD 1 ]------------------------------ >> jslid | 284 >> jsljlgid | 211 >> jsljstid | 1 >> jslstatus | s >> jslresult | 0 >> jslstart | 2012-01-13 01:06:05.286733+00 >> jslduration | 06:01:33.881374 >> jsloutput | > > I did just discover that the schedule had an end date set. This happens to me sometimes: I open the schedule’s propertiesin pgAdmin3, and the current date and time is put in as an end time default value. If I don’t notice and deleteit, it will be saved. It’s possible this happened to me while the first step was running, so that the second wouldnever be called. > > Realized this when *neither* step ran last night. That certainly feels like a bug to me: if I have the “End” field blank(NULL), it should remain blank unless I set it. Agreed - I've committed a fix for this. >> In any event, I would expect both steps to appear in the Steps tab of the properties of the job itself. And they don’t.:-( > > This is still an issue, though. And that one (which by some fluke worked correctly on Windows, but not my Mac). Thanks! -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company
On Jan 18, 2012, at 6:34 AM, Dave Page wrote: >> Realized this when *neither* step ran last night. That certainly feels like a bug to me: if I have the “End” field blank(NULL), it should remain blank unless I set it. > > Agreed - I've committed a fix for this. > >>> In any event, I would expect both steps to appear in the Steps tab of the properties of the job itself. And they don’t.:-( >> >> This is still an issue, though. > > And that one (which by some fluke worked correctly on Windows, but not my Mac). Dave++ Thank you very much! David