AWS Thinkbox Discussion Forums

Running command from post job script

Hi there:

When running a command(python executable script) from post job script I get the following error -

import subprocess
scriptExecutionStr = ‘/prod/Deadline/scripts/PrePostJobScripts/sequence_to_video_with_numbering’
subprocess.check_call(scriptExecutionStr,shell=True)

=======================================================
Error

Post job script “/prod/Deadline/scripts/PrePostJobScripts/rmNukeTmpFiles_test.py”: CalledProcessError : Command '/prod/Deadline/scripts/PrePostJobScripts/sequence_to_video_with_numbering ’ returned non-zero exit status 1 (FranticX.Scripting.PythonNetException)
File “none”, line 103, in main
File “/opt/Thinkbox/Deadline7/bin/python/lib/python2.7/subprocess.py”, line 540, in check_call
raise CalledProcessError(retcode, cmd)

at Deadline.Plugins.ScriptPlugin.RenderScript (Deadline.Jobs.Job job, System.String scriptFilename, Boolean preJobScript, System.String& outMessage, FranticX.Processes.AbortLevel& abortLevel) [0x00000] in :0

=======================================================
Type

RenderPluginException

=======================================================
Stack Trace

at Deadline.Plugins.Plugin.RenderScript (Deadline.Jobs.Job job, System.String scriptFilename, Boolean preJobScript) [0x00000] in :0
at Deadline.Slaves.SlaveRenderThread.RenderCurrentTask (Deadline.IO.TaskLogWriter tlw) [0x00000] in :0

From the look of this, it’s the script that you’re calling that’s having trouble. It’s returning a non-zero exit code (zero means everything works in 99% of cases) which causes subprocess to throw an exception and your rmNukeTmpFiles_test.py isn’t catching it.

The handling an exception section on this page gives a little primer on exception handling in Python. Ideally you’d catch that exception on write yourself a nice little entry in the log to explain what blew up. Just like Deadline did!

Or figure out what’s causing your other script to fail. But you might have to go down the exception handling path for that.

Privacy | Site terms | Cookie preferences