nuke submit to Deadline not working when shotgun is loaded?

Heya Folks!

We’re trying to get shotgun up and running nicely at work and I’ve run into a bit of an odd error when I have the shotgun engine running in nuke and try to use one it’s writes, submit to deadline can’t find the repository or the submit to deadline script. What’s odd is that I’ve checked all of the environment variables that submit to deadline should need after the shotgun engine has been loaded and they all seem to be in place. I’m getting the following output from nuke when I try to run the submit to deadline script:

Traceback (most recent call last): File "\\192.168.0.250\SS_Shotgun\Pipeline\ss_nuke\DeadlineNukeClient.py", line 49, in main SubmitNukeToDeadline.SubmitToDeadline( path ) File "//192.168.0.200/repository/DeadlineRepository/submission/Nuke/Main\SubmitNukeToDeadline.py", line 1242, in SubmitToDeadline deadlineHome = CallDeadlineCommand( ["-GetCurrentUserHomeDirectory",] ) File "//192.168.0.200/repository/DeadlineRepository/submission/Nuke/Main\SubmitNukeToDeadline.py", line 535, in CallDeadlineCommand proc = subprocess.Popen(arguments, cwd=deadlineBin, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, startupinfo=startupinfo, env=environment) File "C:\Program Files\Nuke8.0v5\lib\subprocess.py", line 679, in __init__ errread, errwrite) File "C:\Program Files\Nuke8.0v5\lib\subprocess.py", line 896, in _execute_child startupinfo) TypeError: environment can only contain strings

What’s puzzling is that if I start nuke outside of shotgun then the submit works totally fine. If I launch nuke via shotgun the submit won’t work, likewise if I launch the shotgun engine from inside of nuke using the following it again won’t work.


-- bits in another file that are gonna get called in the nuke menu item

import sgtk

__all__ = ['start_engine']

def start_engine(project_path, engine_name):
    if sgtk.platform.current_engine():
        ##changing this from sgtk.platform.stop_engine()
        sgtk.platform.restart()

    tk = sgtk.sgtk_from_path(project_path)
    ctx = tk.context_from_path(project_path)
    sgtk.platform.start_engine(engine_name, tk, ctx)

-- end of those bits

mymenu.addCommand('Start Shotgun', r'import ss.sg; ss.sg.start_engine("whatever a project path is here", "tk-nuke")')

I’m on the latest shotgun engine and deadline 6.2 - any thoughts?

Well, the ‘environment’ variable that it’s complaining about is being built during that CallDeadlineCommand() function call. Ryan tells me that some of these things are objects instead of strings somehow.

Just for fun, can you try and change line 545 to wrap the variable in the value assingment? It should go from this:

        environment[key] = os.environ[key]

to this:

        environment[key] = str(os.environ[key])

There’s another assignment a bit lower, line 549 that could do with ending up like this:

        environment['PATH'] = str(deadlineBin + os.pathsep + os.environ['PATH'])

That ought to help you out.

This worked perfectly, much appreciated guys.

We’ll get this fix into 7.0 ASAP

(thanks for testing)