AWS Thinkbox Discussion Forums

Runtime error

Hi,

I’m getting a RuntimeError from Python when I try to submit a Draft job. It seems associated with the importing of the Draft module:

I’ve attached the full log for this task. I tried a few of the Sample scripts to make sure this is a real problem, not just from my own ignorance. Seems to consistently fail on the import Draft line.

Not sure if it’s worth mentioning, but we don’t have OpenOffice installed on the machines in question. Not sure why Draft would look for it though.

Edit: It seems that the Draft init only fails on a certain pool of machines. For various reasons we’re running Deadline on those machines in the pre-login environment (as services). Could there be some python-sys issues with permissions, etc maybe? I forced it to run on my own workstation now and it initialized just fine.

Cheers,
Daniel
Job_2014-04-03_12-24-20_533cb844c0bb7f08242e46de.txt (5.07 KB)

It sounds rather like it’s finding something on the path before it gets to the right place that makes it think it has found what it wants, but it hasn’t actually. Can you run the attached script and let me know what the output is?

Thanks!
Andrea
draftTest.py.zip (516 Bytes)

Hi Andrea,

Please find attached the output from your script job. I doesn’t mean too much to me, but *** “import Draft” failed *** is pretty indicative :slight_smile:

Cheers,
Daniel
Job_2014-04-04_08-48-29_533dd72e097cf911e492279a.txt (9.33 KB)

Okay Daniel… so, you see that space in the path? After “C:\PROGRAM FILES\OPENOFFICE.ORG 3\URE\BIN;” but before “C:\PROGRAM FILES (X86)\OPENOFFICE.ORG 3\URE\BIN;”? Take out the space. Then give Draft another try. Putting a space in my path was enough to break things for me here.

Cheers,
Andrea

I see what you mean, but at the danger of revealing my incompetence, how can I change this?

Preferably at runtime since I don’t have proper access to these machines.

Thanks,
Daniel

It would be best if someone were to fix the paths properly and permanently, but, until then, placing the following lines of code before your “import Draft” statement should do the trick (I tested it in a script run on the command line, not through Deadline):

import os import string orig_path = os.environ[ 'PATH' ] modified_path = string.replace( orig_path, '; ', ';' ) os.environ[ 'PATH' ] = modified_path
Note: According to https://docs.python.org/2/library/os.html, “On some platforms, including FreeBSD and Mac OS X, setting environ may cause memory leaks.”

Edit: Jon thinks it should still work when the script is run through Deadline, and Paul figured out where (internal to Draft) the malformed path is causing problems… so this work-around probably won’t be necessary in future releases. Until then, this work-around should fix things for you. :slight_smile:

Thanks Andrea,

I’ll give it a crack!

Cheers,
Daniel

That works like a charm, thanks again!

Cheers,
Daniel

Not a problem. :slight_smile: I’m glad it worked for you!

Privacy | Site terms | Cookie preferences