AWS Thinkbox Discussion Forums

[Linux] Trying to inspect DeadlinePlugin tanks job

This will probably wind up being low-priority, but I tried running type(self.InitializeProcessCallback) in a plugin’s init, and it exploded.

[code] Scheduler Thread - Synchronizing job files
Scheduler Thread - Synchronization time for job files: 34 μs
Scheduler Thread - Synchronizing plugin files
Scheduler Thread - Synchronization time for plugin files: 11.02 ms
Constructor: PythonCustom
0: Task timeout is disabled.
0: Loaded job: Untitled (50ac314d962ccc2f00639a89)
0: INFO: StartJob: initializing script plugin PythonCustom
0: INFO: PythonCustom :: init
Scheduler Thread - Render Thread 0 threw an error:
Scheduler Thread - An error occurred in function “GetDeadlinePlugin” the plugin script file /Volumes/newhome/ruschn/Thinkbox/Deadline6/slave/ws-082/plugins/PythonCustom.py: Python Error: GCHandle value cannot be zero (System.ArgumentException)
Stack Trace:
at System.Runtime.InteropServices.GCHandle.op_Explicit (IntPtr value) [0x00000] in :0
at Python.Runtime.ManagedType.GetManagedObject (IntPtr ob) [0x00000] in :0
at Python.Runtime.Converter.ToManagedValue (IntPtr value, System.Type obType, System.Object& result, Boolean setError) [0x00000] in :0
at Python.Runtime.Converter.ToManaged (IntPtr value, System.Type type, System.Object& result, Boolean setError) [0x00000] in :0
at Python.Runtime.MethodBinder.Bind (IntPtr inst, IntPtr args, IntPtr kw, System.Reflection.MethodBase info, System.Reflection.MethodInfo[] methodinfo) [0x00000] in :0
at Python.Runtime.MethodBinder.Invoke (IntPtr inst, IntPtr args, IntPtr kw, System.Reflection.MethodBase info, System.Reflection.MethodInfo[] methodinfo) [0x00000] in :0
at Python.Runtime.MethodBinder.Invoke (IntPtr inst, IntPtr args, IntPtr kw) [0x00000] in :0
at Python.Runtime.DelegateObject.tp_call (IntPtr ob, IntPtr args, IntPtr kw) [0x00000] in :0
at (wrapper native-to-managed) Python.Runtime.DelegateObject:tp_call (intptr,intptr,intptr)
at (wrapper managed-to-native) Python.Runtime.Runtime:PyObject_Call (intptr,intptr,intptr)
at Python.Runtime.MetaType.tp_call (IntPtr tp, IntPtr args, IntPtr kw) [0x00000] in :0
at (wrapper native-to-managed) Python.Runtime.MetaType:tp_call (intptr,intptr,intptr)
at (wrapper managed-to-native) Python.Runtime.Runtime:PyObject_Call (intptr,intptr,intptr)
at Python.Runtime.PyObject.Invoke (Python.Runtime.PyObject[] args) [0x00000] in :0
at Python.Runtime.PyObject.InvokeMethod (System.String name, Python.Runtime.PyObject[] args) [0x00000] in :0
at FranticX.Scripting.PythonNetScriptEngine.CallFunction (System.String functionName, Python.Runtime.PyTuple args) [0x00000] in :0

Exception Details
ArgumentException – GCHandle value cannot be zero
Exception.Source: mscorlib
Exception.TargetSite: GCHandle op_Explicit(IntPtr)
Exception.Data: ( )
Exception.StackTrace:
at System.Runtime.InteropServices.GCHandle.op_Explicit (IntPtr value) [0x00000] in :0
at Python.Runtime.ManagedType.GetManagedObject (IntPtr ob) [0x00000] in :0
at Python.Runtime.Converter.ToManagedValue (IntPtr value, System.Type obType, System.Object& result, Boolean setError) [0x00000] in :0
at Python.Runtime.Converter.ToManaged (IntPtr value, System.Type type, System.Object& result, Boolean setError) [0x00000] in :0
at Python.Runtime.MethodBinder.Bind (IntPtr inst, IntPtr args, IntPtr kw, System.Reflection.MethodBase info, System.Reflection.MethodInfo[] methodinfo) [0x00000] in :0
at Python.Runtime.MethodBinder.Invoke (IntPtr inst, IntPtr args, IntPtr kw, System.Reflection.MethodBase info, System.Reflection.MethodInfo[] methodinfo) [0x00000] in :0
at Python.Runtime.MethodBinder.Invoke (IntPtr inst, IntPtr args, IntPtr kw) [0x00000] in :0
at Python.Runtime.DelegateObject.tp_call (IntPtr ob, IntPtr args, IntPtr kw) [0x00000] in :0
at (wrapper native-to-managed) Python.Runtime.DelegateObject:tp_call (intptr,intptr,intptr)
at (wrapper managed-to-native) Python.Runtime.Runtime:PyObject_Call (intptr,intptr,intptr)
at Python.Runtime.MetaType.tp_call (IntPtr tp, IntPtr args, IntPtr kw) [0x00000] in :0
at (wrapper native-to-managed) Python.Runtime.MetaType:tp_call (intptr,intptr,intptr)
at (wrapper managed-to-native) Python.Runtime.Runtime:PyObject_Call (intptr,intptr,intptr)
at Python.Runtime.PyObject.Invoke (Python.Runtime.PyObject[] args) [0x00000] in :0
at Python.Runtime.PyObject.InvokeMethod (System.String name, Python.Runtime.PyObject[] args) [0x00000] in :0
at FranticX.Scripting.PythonNetScriptEngine.CallFunction (System.String functionName, Python.Runtime.PyTuple args) [0x00000] in :0

Exception – Python Error: GCHandle value cannot be zero (System.ArgumentException)
Stack Trace:
at System.Runtime.InteropServices.GCHandle.op_Explicit (IntPtr value) [0x00000] in :0
at Python.Runtime.ManagedType.GetManagedObject (IntPtr ob) [0x00000] in :0
at Python.Runtime.Converter.ToManagedValue (IntPtr value, System.Type obType, System.Object& result, Boolean setError) [0x00000] in :0
at Python.Runtime.Converter.ToManaged (IntPtr value, System.Type type, System.Object& result, Boolean setError) [0x00000] in :0
at Python.Runtime.MethodBinder.Bind (IntPtr inst, IntPtr args, IntPtr kw, System.Reflection.MethodBase info, System.Reflection.MethodInfo[] methodinfo) [0x00000] in :0
at Python.Runtime.MethodBinder.Invoke (IntPtr inst, IntPtr args, IntPtr kw, System.Reflection.MethodBase info, System.Reflection.MethodInfo[] methodinfo) [0x00000] in :0
at Python.Runtime.MethodBinder.Invoke (IntPtr inst, IntPtr args, IntPtr kw) [0x00000] in :0
at Python.Runtime.DelegateObject.tp_call (IntPtr ob, IntPtr args, IntPtr kw) [0x00000] in :0
at (wrapper native-to-managed) Python.Runtime.DelegateObject:tp_call (intptr,intptr,intptr)
at (wrapper managed-to-native) Python.Runtime.Runtime:PyObject_Call (intptr,intptr,intptr)
at Python.Runtime.MetaType.tp_call (IntPtr tp, IntPtr args, IntPtr kw) [0x00000] in :0
at (wrapper native-to-managed) Python.Runtime.MetaType:tp_call (intptr,intptr,intptr)
at (wrapper managed-to-native) Python.Runtime.Runtime:PyObject_Call (intptr,intptr,intptr)
at Python.Runtime.PyObject.Invoke (Python.Runtime.PyObject[] args) [0x00000] in :0
at Python.Runtime.PyObject.InvokeMethod (System.String name, Python.Runtime.PyObject[] args) [0x00000] in :0
at FranticX.Scripting.PythonNetScriptEngine.CallFunction (System.String functionName, Python.Runtime.PyTuple args) [0x00000] in :0
Exception.Source: franticx
Exception.TargetSite: Void a(System.Exception)
Exception.Data: ( )
Exception.StackTrace:
at FranticX.Scripting.PythonNetScriptEngine.a (System.Exception A_0) [0x00000] in :0
at FranticX.Scripting.PythonNetScriptEngine.CallFunction (System.String functionName, Python.Runtime.PyTuple args) [0x00000] in :0
at FranticX.Scripting.PythonNetScriptEngine.CallFunction (System.String functionName) [0x00000] in :0
at Deadline.Scripting.DeadlineScriptEngine.CallFunction (System.String functionName) [0x00000] in :0
at Deadline.Scripting.DeadlineScriptManager.CallFunction (System.String scopeName, System.String functionName) [0x00000] in :0
at Deadline.Plugins.ScriptPlugin.StartJob (Deadline.Jobs.Job job) [0x00000] in :0

RenderPluginException – An error occurred in function “GetDeadlinePlugin” the plugin script file /Volumes/newhome/ruschn/Thinkbox/Deadline6/slave/ws-082/plugins/PythonCustom.py: Python Error: GCHandle value cannot be zero (System.ArgumentException)
Stack Trace:
at System.Runtime.InteropServices.GCHandle.op_Explicit (IntPtr value) [0x00000] in :0
at Python.Runtime.ManagedType.GetManagedObject (IntPtr ob) [0x00000] in :0
at Python.Runtime.Converter.ToManagedValue (IntPtr value, System.Type obType, System.Object& result, Boolean setError) [0x00000] in :0
at Python.Runtime.Converter.ToManaged (IntPtr value, System.Type type, System.Object& result, Boolean setError) [0x00000] in :0
at Python.Runtime.MethodBinder.Bind (IntPtr inst, IntPtr args, IntPtr kw, System.Reflection.MethodBase info, System.Reflection.MethodInfo[] methodinfo) [0x00000] in :0
at Python.Runtime.MethodBinder.Invoke (IntPtr inst, IntPtr args, IntPtr kw, System.Reflection.MethodBase info, System.Reflection.MethodInfo[] methodinfo) [0x00000] in :0
at Python.Runtime.MethodBinder.Invoke (IntPtr inst, IntPtr args, IntPtr kw) [0x00000] in :0
at Python.Runtime.DelegateObject.tp_call (IntPtr ob, IntPtr args, IntPtr kw) [0x00000] in :0
at (wrapper native-to-managed) Python.Runtime.DelegateObject:tp_call (intptr,intptr,intptr)
at (wrapper managed-to-native) Python.Runtime.Runtime:PyObject_Call (intptr,intptr,intptr)
at Python.Runtime.MetaType.tp_call (IntPtr tp, IntPtr args, IntPtr kw) [0x00000] in :0
at (wrapper native-to-managed) Python.Runtime.MetaType:tp_call (intptr,intptr,intptr)
at (wrapper managed-to-native) Python.Runtime.Runtime:PyObject_Call (intptr,intptr,intptr)
at Python.Runtime.PyObject.Invoke (Python.Runtime.PyObject[] args) [0x00000] in :0
at Python.Runtime.PyObject.InvokeMethod (System.String name, Python.Runtime.PyObject[] args) [0x00000] in :0
at FranticX.Scripting.PythonNetScriptEngine.CallFunction (System.String functionName, Python.Runtime.PyTuple args) [0x00000] in :0
RenderPluginException.Cause: JobError (2)
RenderPluginException.HasSlaveLog: True
Exception.Source: deadline
Exception.TargetSite: Void StartJob(Deadline.Jobs.Job)
Exception.Data: ( )
Exception.StackTrace:
at Deadline.Plugins.ScriptPlugin.StartJob (Deadline.Jobs.Job job) [0x00000] in :0
at Deadline.Plugins.Plugin.StartJob (Deadline.Jobs.Job job) [0x00000] in :0
at Deadline.Slaves.SlaveRenderThread.a (Deadline.IO.TaskLogWriter A_0) [0x00000] in :0

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<[/code]

Hmm, I can’t seem to reproduce this. Could you post the code?

I’m out of the office until Tuesday, but basically all I was doing is this:

[code]from Deadline.Plugins import *
from Deadline.Scripting import *

class PythonCustom(DeadlinePlugin):
def init(self):
LogInfo(type(self.InitializeProcessCallback)) # Crash
self.initializeProcessCallback += self.init

def init(self):
    pass[/code]

I’m guessing it has something to do with the way LogInfo casts (or doesn’t cast) objects for logging, but I didn’t really mess around with it anymore, as LogInfo(repr(self.InitializeProcessCallback)) worked fine.

LogInfo expects a string. This is what I was doing, and it worked fine:

LogInfo(str(type(self.InitializeProcessCallback)))

So we’ll probably just consider this a non-issue. :slight_smile:

That makes sense. However, I think it may be worth changing it so it deals with unexpected types in a less destructive way.

Privacy | Site terms | Cookie preferences