AWS Thinkbox Discussion Forums

dependency handling crash

We get crashes like this in our dependency scripts on occasion:

2014-09-14 15:27:42: Error running dependency script: /mnt/s2/exchange/software/managed/pythonScripts/site-packages/scl/deadline/scriptDependency.py
2014-09-14 15:27:42: Python Error: NullReferenceException : Object reference not set to an instance of an object
2014-09-14 15:27:42: at Deadline.Scripting.RepositoryUtils.GetJobTasks (Deadline.Jobs.Job job, Boolean invalidate) [0x00000] in :0
2014-09-14 15:27:42: at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
2014-09-14 15:27:42: at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0 (Python.Runtime.PythonException)
2014-09-14 15:27:42: Stack Trace:
2014-09-14 15:27:42: File “none”, line 337, in main
2014-09-14 15:27:42: File “none”, line 311, in handleJobDependencies
2014-09-14 15:27:42: File “none”, line 265, in getFrameLists

The script looks like this:

# this is the error from line 265
def getFrameLists( oJob, vTaskIDs ):
    # collect all the frame lists for each of the tasks
    vJobTasks = RepositoryUtils.GetJobTasks  ( oJob, False )
...
# this is the error from line 311:
def handleJobDependencies(sJobID, vTaskIDs):
    ClientUtils.LogText("Running Scanline handleJobDependencies checker %s for JobID: %s TaskIDs: %s" % (__version__, sJobID,vTaskIDs))
    # convert to ints (and sort just in case)
    oJob = RepositoryUtils.GetJob  ( sJobID, False )   
    vTaskIDs = sorted(map(lambda x: int(x), vTaskIDs))
    
    # get all the frames for each task we need:
    dictTaskList = getFrameLists( oJob, vTaskIDs )
...
# the main function is (line 337):
def __main__(sJobID, vTaskIDs):
    return handleJobDependencies(sJobID, vTaskIDs)

If the job no longer exists in the repository, RepositoryUtils.GetJob() will return None, so the following change should prevent this error from occurring:

    # convert to ints (and sort just in case)
    oJob = RepositoryUtils.GetJob  ( sJobID, False )
    if oJob:
        vTaskIDs = sorted(map(lambda x: int(x), vTaskIDs))
        
        # get all the frames for each task we need:
        dictTaskList = getFrameLists( oJob, vTaskIDs )

Cheers,
Ryan

I’ll add the change, thanks. (Although, its a bit odd that a job would get deleted between pulse triggering the check, and the check starting? We usually don’t delete jobs unless they are complete or weeks old)

Privacy | Site terms | Cookie preferences