Python subprocess.call() returning Access is denied [error 5] on Django Deployed App in Windows with HeliconZoo

509 views Asked by At

Ok, I'm starting to get a headache to solve this problem and now i decide to ask for help here in the stackoverflow. First, let me know introduce what i'm trying to do:

My django app is quite simple for now (but i expect to evolute in the future), it only takes a request, renders a template that has three options to user choose. These options are file formats convertions using AutoCAD (DXF to DWG, DWG to DXF and DXF to PDF). So the user choose one option, choose input files and in the server i call a external program to do the task and, finally, it response a zip file to user.

These are the facts:

1) Absolutely EVERYTHING works fine in django development server. But, as everything in life is not easy, i can't (for obvious reasons) use django development server in production environment. So i tried to deploy my app in the production development.

2) I deployed it in apache using apache mod_wsgi (it's the recommended way by django docs). Everything works fine, except one thing: AutoCAD is invoked by external program and it doesn't respond by no means. I receive RPC_E_CALL_REJECTED when i try to issue any kind of command to AutoCAD. I think this is some issue with COM objects that AutoCAD uses to do the task, but i'm not certain about that and i don't know hot to solve it. Do you have any idea?

3) I forget about apache + mod_wsgi for a while and started to use HeliconZoo. Again, everything works fine, but HeliconZoo can't use subprocess.call() because i'm getting Access is denied [error 5]. I've checked all permisisons in folders that is used and aparentely it has all permissions.

Here is the code that i'm using in all the scenarios described above:

 def convert(input_path, template, output_path, method_name):
     exit_code = subprocess.call([CONVERSOR_EXE_PATH, input_path, PDF_TEMPLATE_PATH, output_path, method_name])
     return exit_code

Does anyone have any king of idea to these problems? Thanks guys!

0

There are 0 answers