AWS Thinkbox Discussion Forums

Job error not very visible in Monitor

Hey guys,

I’ve got a weird problem. Please see screenshot below.

Essentially, I’m failing a job via a post-script when certain criteria is met (ie. when something goes horribly wrong). The code I’m using the fail the job is

RepositoryUtils.FailJob(job)

Where RepositoryUtils is a short-hand for Deadline.Scripting.RepositoryUtils, and job is acquired via

deadlinePlugin = args[0]
job = deadlinePlugin.GetJob()

If you have a look at the job’s error count, it is still listed as 0. And the visual group (batch name) is still happy blue.

Is this because I’m failing the job in a post-script, and Deadline thinks that’s not super important? Or does it have to do with the command(s) I’m using? More importantly, is there anything I can change in the script to make this more visible in the Monitor?

It’s worth mentioning that the FailJob() command triggers my event listener, so everything besides the way the Monitor is reading the situation seems to work as expected.

Should I perhaps trigger FailTasks() in addition to FailJob()?

Ideal outcome:

  • Batch name goes red
  • Failed task count is greater than 0

Edit: Hmm, maybe deadlinePlugin.FailRender() is more correct? In addition to what I have, that is

Ok, so this adds to the error count, but does not change the batch group colour:

RepositoryUtils.FailJob(job)
deadlinePlugin.FailRender(‘Error message’)

Note that I had to fail the job before the render, otherwise the job just kept going (and failing)

Hello!

You cannot fail completed jobs, you’ll notice that this is not possible via the Monitor UI either. You can only fail a job if it has incomplete tasks in it.

Looks like if you use FailTasks() you can fail the job.

from Deadline.Scripting import *

def __main__():
    job = RepositoryUtils.GetJob("5c6cbb7c6b3eed60ccd13052", True)
    tasks = RepositoryUtils.GetJobTasks(job, True)
    RepositoryUtils.FailTasks(job, tasks.TaskCollectionTasks)

Regards,

Charles

Thanks, failing all the tasks definitely makes it more visible in that the progress bar (summary in the Monitor) displays a larger percentage of red/failed.

However, if I fail the task manually in the Monitor the group/batch also turns red. If I have batches collapsed (which I often do), its super handy to have the top node go red as opposed to just the one job underneath it.

Hope that makes sense.

I’m just going to bump this once in case anyone has any insight to share.

What I would ultimately like to do is emulate the method that the Monitor calls when you manually fail a job. But as far as I can see, that’s all bundled up in compiled modules, and not accessible to myself.

In summary: Manually failing a job sets all the right visual cues in the Monitor, while failing via script does not. The job still fails, and triggers event hooks, but looks misleadingly active when browsing the Monitor

Privacy | Site terms | Cookie preferences