AWS Thinkbox Discussion Forums

RepositoryUtils is not defined

Hi there:

Hope you are doing well. I am getting the following error in running a post job script

error:- name ‘RepositoryUtils’ is not defined

I do have these modules loaded
from Deadline.Events import *
from Deadline.Scripting import *
from Deadline.Jobs import *
from Deadline.Statistics import *

Post job script “/prod/nomad-new/prod_tools/linux/ubuntu/utility/deadline10_3/PrePostJobScripts/mp4creation.py”: name ‘RepositoryUtils’ is not defined (FranticX.Scripting.PythonNetException)
File “/prod/nomad-new/prod_tools/linux/ubuntu/utility/deadline10_3/PrePostJobScripts/mp4creation.py”, line 68, in main
repPathMapping = RepositoryUtils.GetPathMappings()
at Python.Runtime.PythonException.ThrowLastAsClrException() in C:\thinkbox-conda\conda-bld\dotnet_pythonnet_1700771848705\work\src\runtime\PythonException.cs:line 53
at Python.Runtime.PyObject.Invoke(PyObject[] args) in C:\thinkbox-conda\conda-bld\dotnet_pythonnet_1700771848705\work\src\runtime\PythonTypes\PyObject.cs:line 750
at Python.Runtime.PyObject.InvokeMethod(String name, PyObject[] args) in C:\thinkbox-conda\conda-bld\dotnet_pythonnet_1700771848705\work\src\runtime\PythonTypes\PyObject.cs:line 818
at FranticX.Scripting.PythonNetScriptEngine.CallFunction(String moduleName, String functionName, Object[] args)
at Deadline.Plugins.PluginWrapper.RenderScript(String scriptFilename, Boolean preJobScript, String& outMessage, AbortLevel& abortLevel)

Regards
/Biju

Replace your * imports with explicit imports.

So this line:

from Deadline.Scripting import *

would become:

from Deadline.Scripting import RepositoryUtils

Hello,

Top of my GlobalJobPreload.py:

import sys
from Deadline.Scripting import RepositoryUtils

this definitely feels like a bug, code just fails to run with this issue:

   at Python.Runtime.PythonException.ThrowLastAsClrException() in C:\thinkbox-conda\conda-bld\dotnet_pythonnet_1709944764012\work\src\runtime\PythonException.cs:line 53
   at Python.Runtime.PyObject.Invoke(PyObject[] args) in C:\thinkbox-conda\conda-bld\dotnet_pythonnet_1709944764012\work\src\runtime\PythonTypes\PyObject.cs:line 750
   at Python.Runtime.PyObject.InvokeMethod(String name, PyObject[] args) in C:\thinkbox-conda\conda-bld\dotnet_pythonnet_1709944764012\work\src\runtime\PythonTypes\PyObject.cs:line 818
   at FranticX.Scripting.PythonNetScriptEngine.CallFunction(String moduleName, String functionName, Object[] args)
   at Deadline.Plugins.PluginWrapper.d()
   at Deadline.Plugins.PluginWrapper.StartJob(String& outMessage, AbortLevel& abortLevel)
GlobalJobPreLoad.py': name 'RepositoryUtils' is not defined (FranticX.Scripting.PythonNetException)

Deadline Client Version: 10.3.2.1 Release (1a66fe40f)
FranticX Client Version: 2.4.0.0 Release (49c26d0d8)
Repository Version: 10.3.2.1 (1a66fe40f)

Huh that’s weird. One possibility is that a dependency of RepositoryUtils cannot be loaded, causing the failure. Could you check your PYTHONPATH? Maybe the path to some of the .Net libraries is missing?

We do use the same Repository and Client versions without issue.

Where do the Deadline.Scripting libraries live?

Not completely sure, but I think they are compiled into dpython.exe.

I checked but nothing is overwriting the pythonpath as far as I can see.

Testing on my 10.3.2.1. setup using this GlobalJobPreLoad.py:

import sys
from Deadline.Scripting import RepositoryUtils

def __main__(deadlinePlugin):
    print("Your GlobalJobPreLoad.py is being run!")

and I get this in my Worker log (including all of the Start Job step):

2024-05-09 15:48:32:  0: Executing plugin command of type 'Start Job'
2024-05-09 15:48:32:  0: DEBUG: S3BackedCache Client is not installed.
2024-05-09 15:48:32:  0: INFO: Executing global asset transfer preload script 'C:\ProgramData\Thinkbox\Deadline10\workers\YWG-1800699952\plugins\6621468c28182aaeb0741a3f\GlobalAssetTransferPreLoad.py'
2024-05-09 15:48:32:  0: INFO: Looking for legacy (pre-10.0.26) AWS Portal File Transfer...
2024-05-09 15:48:32:  0: INFO: Looking for legacy (pre-10.0.26) File Transfer controller in C:/Program Files/Thinkbox/S3BackedCache/bin/task.py...
2024-05-09 15:48:32:  0: INFO: Could not find legacy (pre-10.0.26) AWS Portal File Transfer.
2024-05-09 15:48:32:  0: INFO: Legacy (pre-10.0.26) AWS Portal File Transfer is not installed on the system.
2024-05-09 15:48:32:  0: INFO: Executing global job preload script 'C:\ProgramData\Thinkbox\Deadline10\workers\YWG-1800699952\plugins\6621468c28182aaeb0741a3f\GlobalJobPreLoad.py'
2024-05-09 15:48:32:  0: PYTHON: Your GlobalJobPreLoad.py is being run!
2024-05-09 15:48:32:  0: Done executing plugin command of type 'Start Job'

Maybe dump your environment in the script before the imports are run? Maybe something is shadowing the ‘Deadline.Scripting’ namespace that doesn’t have RepositoryUtils?

Privacy | Site terms | Cookie preferences