Job Retry Not working

avatar
(anonymous user)
Product: PowerShell Universal
Version: 4.1.2


Quick question, how does the “retry limit” on jobs work? I’m assuming there 's something simple i’m missing, but my goal is just retry the same job because it failed or it timed out on the handshake. I’ve got a simple 1 line testing script that fails (as expected) but i cant get the job to retry. Is there something else i need to do / set / update to actually get the retry to trigger?



846c33d2a6c4a418992bc6102f9f2f9df4551093

846c33d2a6c4a418992bc6102f9f2f9df4551093.png

All Comments (4)

avatar

I tried this myself and it seems to work. The retried jobs show up as nested jobs of the original one.



38a47a876c233133e05da150409c6b932fa650d4
My script just does this.

throw "Bad"


Adam Driscoll
PowerShell Expert and Developer at Devolutions

38a47a876c233133e05da150409c6b932fa650d4.png

avatar

No kidding! Did you do anything other than just set the retry limit value? lol my script failed 2 days ago and i dont have anything for retries…

I suppose my test isn’t truly a one liner, but am i just over coding it with the try catch or something?

09415e7601e6c137de40fb8a90a7c1f4b03678a4


My trigger scripts for other failed jobs seem to be working just fine, but the Lou.ps1 job just never had any retries or nested jobs.



5afb8f34b1dd3748c316fb8ebc0c57e8ff487052
*Edit – updated pic and notes to show no nested jobs

5afb8f34b1dd3748c316fb8ebc0c57e8ff487052.png

09415e7601e6c137de40fb8a90a7c1f4b03678a4.png

avatar

We are dealing with the same thing, we can’t get retries to work.

A foreign_key error (SQL Server backend) is thrown when a job fails and anything but 0 is specified for retry limit.

avatar

Quick updates and a couple followup questions –

Updating to 4.1.4 got the retries working. One odd thing i noticed is that only my first retry (set to 3 retries) is nesting in the original “parent” failed job. Each retry seems to be nesting in it’s own, new job.

(original failed job)


86a348d503fdf01464c5a59ad81bb393c8fcb3cf
Looking at all of the jobs, it looks like all of the retries are triggering from a manual run, however the only job that i manually ran was 2329 – the original job that trigged all 3 retries


673501181c4e5b7690cf7e2e05b0535d31f468a9
My use case here is an employee separation processes. I have one parent script that invokes about 7 sub scripts (that process different sep processes on different applicaitons). The parent script waits for all 7 sub scripts to finish, pulls any pipeline output , throws it all into json and logs it. In the event that one of the sub script fails, I do want that sub script to retry (for as many retries as specified), but if those retries dont all nest under the originally failed job, I wont be able to track all of the retried jobs to find any available pipeline output

thoughts?

673501181c4e5b7690cf7e2e05b0535d31f468a9.png

86a348d503fdf01464c5a59ad81bb393c8fcb3cf.png