Submitting Command Job or Command Script Jobs erros out, why

Hi there,

I just need to submit a simple cmd line job to execute a cmd program with a few parameters.

I wanted to test it out on Deadline 6’s own command line job plugins with a simple task of printing out the PATH of the machine that runs the job to a text file located on C: drive, like this:

PATH > C:\PATH.txt

However, every time I run the job (either Command Submission or Command Script Submission) I get this error:

0: INFO: Using Process Tree: True 0: INFO: Hiding DOS Window: True 0: INFO: Creating New Console: False 0: INFO: Executable: "C:/Windows/System32/cmd.exe" 0: INFO: Argument: PATH > C:\PATH.txt 0: INFO: Startup Directory: "C:\Windows\System32" 0: INFO: Process Priority: BelowNormal 0: INFO: Process Affinity: default 0: INFO: Process is now running 0: STDOUT: The filename, directory name, or volume label syntax is incorrect. 0: INFO: Process exit code: 1

I have no idea where to start looking for errors.

The command job sumission only pointed to the cmd.exe file with arguments PATH > C:\PATH.txt
and the command script job sumission had the same setup cmd.exe (with full path) PATH > C:\PATH.txt

Thanks for any tips on getting this working.

Cheers…

Hey Loocas!

There are actually a few issues here. Some are easy to fix, and one has me completely stumped.

The three quick issues are 1) the PATH variable on Windows needs to be sandwiched between ‘%’ signs, 2) ‘cmd.exe’ needs to have a ‘/c’ switch to run commands, and 3) to see the contents of a variable, you should call ‘echo’ because anything after it including variables will be sent to standard output. In summary, the options should look like this:
c:\windows\system32\cmd.exe /c echo %PATH% > c:\PATH.txt

Now, the crazy thing with this is that the redirect (’>’) didn’t work for me at all when I ran it from the command line, but it’s worth a try anyhow.

Since Deadline saves all the standard output and this is only a test, you can also try without the “> c:\PATH.txt”.

Hi there, Eric,

thanks for the corrections, however, it still errors out for some reason (exit code 1), even though it seems the command gets executed.

=======================================================
Error
=======================================================
Error in CheckExitCode: Renderer returned non-zero error code, 1. Check the log for more information.
   at Deadline.Plugins.ScriptPlugin.RenderTasks(String taskId, Int32 startFrame, Int32 endFrame, String& outMessage, AbortLevel& abortLevel)

=======================================================
Type
=======================================================
RenderPluginException

=======================================================
Stack Trace
=======================================================
   at Deadline.Plugins.Plugin.RenderTask(String taskId, Int32 startFrame, Int32 endFrame)
   at Deadline.Slaves.SlaveRenderThread.RenderCurrentTask(TaskLogWriter tlw)

=======================================================
Full Log
=======================================================
0: Task timeout is disabled.
0: Loaded job: cmd test (53d67a8d170b1b09c89fdb91)
0: INFO: Executing plugin script C:\Users\loocas\AppData\Local\Thinkbox\Deadline6\slave\VFX01\plugins\53d67a8d170b1b09c89fdb91\CommandLine.py
0: INFO: About: Command Line support for Deadline
0: INFO: The current environment will be used for rendering
0: Plugin rendering frame(s): 0
0: INFO: Stdout Handling Enabled: True
0: INFO: Popup Handling Enabled: True
0: INFO: Using Process Tree: True
0: INFO: Hiding DOS Window: True
0: INFO: Creating New Console: False
0: INFO: Executable: "C:/Windows/System32/cmd.exe"
0: INFO: Argument: /c %PATH%
0: INFO: Startup Directory: "C:\Windows\System32"
0: INFO: Process Priority: BelowNormal
0: INFO: Process Affinity: default
0: INFO: Process is now running
0: STDOUT: The full path of .exe /c C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files (x86)\QuickTime Alternative\QTSystem;C:\duber\RV\3.12.18_x86\bin;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Autodesk\Backburner\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\duber\3ds Max\2014_x64\dlls;C:\duber\3ds Max\2014_x64\dlls\ALPServer;C:\duber\3ds Max\2014_x64\dlls\ALPServer\(x86) is too long.
0: INFO: Process exit code: 1


=======================================================
Details
=======================================================
Date: 07/28/2014 18:30:17
Frames: 0
Elapsed Time: 00:00:00:04
Job Submit Date: 07/28/2014 18:30:05
Job User: loocas
Average RAM Usage: 2717454336 (22%)
Peak RAM Usage: 2717544448 (22%)
Average CPU Usage: 2%
Peak CPU Usage: 6%

=======================================================
Slave Information
=======================================================
Slave Name: VFX01
Version: v6.1.0.54665 R
Operating System: Windows 7 Professional (SP1)
Machine User: loocas
IP Address: 192.168.0.111
MAC Address: 00:1F:D0:DC:0B:71
CPU Architecture: x64
CPUs: 8
CPU Usage: 0%
Memory Usage: 2.5 GB / 12.0 GB (21%)
Free Disk Space: 976.834 GB (1.517 GB on C:\, 96.285 GB on D:\, 879.032 GB on E:\)
Video Card: NVIDIA GeForce GTX 285

This is my submission:

I was missing the “echo” command, however, even with it in the arguments, it still errors out:

0: STDOUT: The full path of .exe /c echo C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files (x86)\QuickTime Alternative\QTSystem;C:\duber\RV\3.12.18_x86\bin;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Autodesk\Backburner\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\duber\3ds Max\2014_x64\dlls;C:\duber\3ds Max\2014_x64\dlls\ALPServer;C:\duber\3ds Max\2014_x64\dlls\ALPServer\(x86) is too long. 0: INFO: Process exit code: 1

Why is this? Why is it trying to execute some arbitrary exe with the output as a parameter?

I managed to get the command executed using the Command Script submission.

However, it did not work with the output forwarded to a file “> C:\test.txt”

It threw the very same error:

0: STDOUT: The full path of .exe /c echo C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files (x86)\QuickTime Alternative\QTSystem;C:\duber\RV\3.12.18_x86\bin;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Autodesk\Backburner\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\duber\3ds Max\2014_x64\dlls;C:\duber\3ds Max\2014_x64\dlls\ALPServer;C:\duber\3ds Max\2014_x64\dlls\ALPServer\(x86) is too long. 0: INFO: Process exit code: 1

Nice! I think you hit a limitation within the Windows because your path variable is too long.

The max should be about 8K, but I wonder if cmd.exe has its own limit for the “/C” option. Microsoft says you should be fine:
support.microsoft.com/kb/830473

I think you’re in good shape now anyway. Try running your Python stuff now and see how it goes.

Thanks, but the problem is, I don’t need to run Python scripts (I have IronPython or CPython submitters for that). I need to run cmd line programs with parameters for configuring certain plugins and such.

The piping is worrying. I can’t output anything into a file, for example. Or run multiple commands feeding output of one into another.

Try putting everything in a batch file perhaps? I’ve definitely done that before. It’ll need to be put somewhere that is network accessible, but that should be fine.

In fact, you can probably just call the batch file directly from a UNC path instead of using cmd.exe.

Edit: Works just fine!

[code]=======================================================
Log

0: Plugin will be reloaded because a new job has been loaded, or one of the job files or plugin files has been modified
0: Loaded plugin: CommandScript
0: Task timeout is disabled.
0: Loaded job: Edwin’s Command Line Test (53d7f669f4b70d855493b080)
0: INFO: Executing plugin script C:\Users\Edwin\AppData\Local\Thinkbox\Deadline6\slave\MOBILE-010\plugins\53d7f669f4b70d855493b080\CommandScript.py
0: INFO: About: Command Script support for Deadline
0: INFO: The current environment will be used for rendering
0: Plugin rendering frame(s): 0
0: INFO: Checking line:"\fs-01\public\users\edwin.amsler\test.bat"
0: INFO: Stdout Handling Enabled: False
0: INFO: Popup Handling Enabled: False
0: INFO: Using Process Tree: True
0: INFO: Hiding DOS Window: True
0: INFO: Creating New Console: False
0: INFO: Executable: “\fs-01\public\users\edwin.amsler\test.bat”
0: INFO: Argument:
0: INFO: Startup Directory: “c:”
0: INFO: Process Priority: BelowNormal
0: INFO: Process Affinity: default
0: INFO: Process is now running
0: STDOUT: c:>echo C:\Program Files\Thinkbox\Deadline7\bin;C:\Program Files\Thinkbox\Deadline6\bin;C:\windows\SYSTEM32;C:\windows;C:\windows\SYSTEM32\WBEM;C:\windows\SYSTEM32\WINDOWSPOWERSHELL\V1.0;C:\PROGRAM FILES\TORTOISESVN\BIN;C:\windows\SYSTEM32\WINDOWSPOWERSHELL\V1.0;C:\Python27;C:\Python27\Scripts;C:\Python\Lib\site-packages\PyQt4;C:\Program Files (x86)\CMake 2.8\bin;C:\Program Files (x86)\Git\bin;C:\Program Files\TortoiseGit\bin;C:\Program Files\Common Files\Autodesk Shared\ 1>c:\test.txt
0: STDOUT: c:>echo C:\Program Files\Thinkbox\Deadline7\bin;C:\Program Files\Thinkbox\Deadline6\bin;C:\windows\SYSTEM32;C:\windows;C:\windows\SYSTEM32\WBEM;C:\windows\SYSTEM32\WINDOWSPOWERSHELL\V1.0;C:\PROGRAM FILES\TORTOISESVN\BIN;C:\windows\SYSTEM32\WINDOWSPOWERSHELL\V1.0;C:\Python27;C:\Python27\Scripts;C:\Python\Lib\site-packages\PyQt4;C:\Program Files (x86)\CMake 2.8\bin;C:\Program Files (x86)\Git\bin;C:\Program Files\TortoiseGit\bin;C:\Program Files\Common Files\Autodesk Shared\
0: STDOUT: C:\Program Files\Thinkbox\Deadline7\bin;C:\Program Files\Thinkbox\Deadline6\bin;C:\windows\SYSTEM32;C:\windows;C:\windows\SYSTEM32\WBEM;C:\windows\SYSTEM32\WINDOWSPOWERSHELL\V1.0;C:\PROGRAM FILES\TORTOISESVN\BIN;C:\windows\SYSTEM32\WINDOWSPOWERSHELL\V1.0;C:\Python27;C:\Python27\Scripts;C:\Python\Lib\site-packages\PyQt4;C:\Program Files (x86)\CMake 2.8\bin;C:\Program Files (x86)\Git\bin;C:\Program Files\TortoiseGit\bin;C:\Program Files\Common Files\Autodesk Shared
0: INFO: Process exit code: 0
0: Render time for frame(s): 3.441 s
0: Total time for task: 8.160 s
[/code]

Well, that certainly sounds like a workaround, however, what if I really need to put the command in the submission?

Isn’t this a bug somewhere in Deadline?

Well, you have to realize that Deadline isn’t a command shell, so pipes and other elements that would normally work I don’t think will end up working the same as you would see in cmd.exe…

Down deep in the core we use the C# Process class:
msdn.microsoft.com/en-us/library … s(v=vs.110.aspx

So we’re kind of at its mercy as far as what it allows and what it doesn’t.

Actually… I talk with Ryan about this. We might be able to create batch scripts on the fly and see how that works out. No promises.

Ok, good to hear.

Thank you again for the help! I appretiate it.