Standalone Python API Getting Failed Jobs and Tasks Reports

Hi, @Justin_B and Fellow Members,

I am exploring Deadline’s Standalone Python API Query. The goal is to get the de-duplicated details of failed jobs/tasks along with jobID, jobName, submitting user, etc.

In doing so with the help of these docs I made some headway and managed to put the web server as well as the Python connection object.

con = Connect()
con.SetAuthetnticationCredentials

The “con” object and the “con.TaskReports” are giving these methods for me,

con

'AuthenticationModeEnabled',
'Balancer',
'EnableAuthentication',
'Groups',
'JobReports',
'Jobs',
'LimitGroups',
'MappedPaths',
'MaximumPriority',
'Plugins',
'Pools',
'Pulse',
'Repository',
'SetAuthenticationCredentials',
'Slaves',
'SlavesRenderingJob',
'TaskReports',
'Tasks',
'Users'

con.TaskReports

'GetAllTaskErrorReportsContents',
'GetAllTaskLogReportsContents',
'GetAllTaskReports',
'GetAllTaskReportsContents',
'GetAllTaskRequeueReportsContents',
'GetTaskErrorReports',
'GetTaskLogReports',
'GetTaskRequeueReports'
'connectionProperties'

Wanted to know if there are any methods to directly get a list of failed job IDs. Instead of getting all jobs and iterating them to know which of those have “failed” tasks etc.

Is there a way to get the list of failed jobs and for a given failed job get the list of failed tasks? And for those failed tasks get the unique “Title” information that provides the list/summary of details as to why a given job is failed.

Also, along the lines, sometimes the failed Task/TaskReport shows the “Title” as “Error: Renderer returned non-zero error code, 1. Check the log for more information.” - How can we add the custom log parsing/regex and feed/substitute the matched error string for the “Title” value instead of “Error: Renderer returned non-zero error code, 1. Check the log for more information.

Thanks,
Bhavik
Fractal Picture

This page has all the standalone API functions, and you’ll want GetJobsInState so you can pull only failed jobs.

So such luck for fetching tasks however, that’ll need to be looped through.

And there’s nothing to replace the title with. If you’re getting “Error: Renderer returned non-zero error code, 1. Check the log for more information.”, Deadline failed the tasks because of the non-zero exit code, not because a regex got matched.

Thanks, @Justin_B Yes, Thanks for the link to specific API functions, and “GetJobsInState” will surely be helpful as a first pass. But looking at the docs couldn’t figure out the difference between " GetJobsInState" vs " GetJobsInStates" (s), can you please let me know if there’s a difference between the two? and what is it?

Also, it is sad but good to know looping through the tasks will be the only way to check each one of those if they failed or not.

Sorry In case I was not clear in my initial post, we want the actual error message to appear in the “Title” for the given Task’s report in this case say it is “list index out of range” instead of “Check the log for more information.” message, so wanted to know if is that something doable? and how?

Thanks,
Bhavik
Fractal Picture