Event plugins not offering traceback.

Hey,

I’m currently writing a facility event plugin and noticed that if there are any syntax errrors in the plugin, Deadline won’t output any sort of traceback letting the user know what crashed and why. The only way I’ve known if the event plugin errored, is if the Job Reports lack any entry for that event plugin. To get around this issue, I’ve been doing:

import traceback try: sys.path.append("\\\\ladev\\bb\\site-packages") from bb.pipeline import Pipeline p = Pipeline() ClientUtils.LogText("successfully imported.") except: exc_type, exc_value, exc_traceback = sys.exc_info() print "*** print_tb:" traceback.print_tb(exc_traceback, limit=1, file=sys.stdout) print "*** print_exception:" traceback.print_exception(exc_type, exc_value, exc_traceback, limit=2, file=sys.stdout) print "*** print_exc:" traceback.print_exc() print "*** format_exc, first and last line:" formatted_lines = traceback.format_exc().splitlines() print formatted_lines[0] print formatted_lines[-1] print "*** format_exception:" print repr(traceback.format_exception(exc_type, exc_value, exc_traceback)) print "*** extract_tb:" print repr(traceback.extract_tb(exc_traceback)) print "*** format_tb:" print repr(traceback.format_tb(exc_traceback)) print "*** tb_lineno:", exc_traceback.tb_lineno

However, this gets a bit messy and isn’t exactly ideal for debugging the event plugin. Is there anything available in the Deadline events api that handles errors without the need to parse the traceback?

Hello,

I am going to have one of our scripting gurus look this over and give you a better response tomorrow.

Hey Brett,

Which version of Deadline are you running? There should be output indicating an error when it happens, I’m getting the following in the Monitor console when running into a syntax error on a submission event:

2014-03-11 17:49:56: Events plugin 'TestEvent' could not be loaded from the repository because: Error executing event plugin script "C:\DeadlineRepository_6\events\TestEvent\TestEvent.py": Python Error: SyntaxError : ('invalid syntax', ('none', 40, 25, " fdhsldkfgj 430596 ;asdfk a- ' '\n")) (Python.Runtime.PythonException) 2014-03-11 17:49:56: Stack Trace: 2014-03-11 17:49:56: 2014-03-11 17:49:56: (Deadline.Events.DeadlineEventPluginException)

Is that not the case for you? Also, this is mostly out of curiosity, but is there anything that your exception handler prints out that a simple “print traceback.format_exc()” doesn’t? I find that that function already does a pretty good job of formatting any relevant traceback/exception info into a string on its own.

I’m currently using 6.1

It looks like I misspoke originally because I am now seeing tracebacks. I believe my issue was during a broken import at the beginning of the script. I wasn’t seeing any job reports for the event’s task if something was broken on import.