I've developed a geoprocessing service that accepts a personal geodatabase as an attachment. After this MDB is copied to the server, I'd like to use ArcPy to open it, edit some feature classes, then append the data to an existing SDE dataset.
Given that ArcGIS Server GP Services are running 64 bit python, I tried using a subprocess to call 32 bit python:
try:
arcpy.AddMessage(subprocess.check_output(["C:\Python27\ArcGIS10.3\python", \
"D:\Data\GISData\Scripts\CheckFCExists.py", newSourceData]))
except subprocess.CalledProcessError, e:
arcpy.AddMessage('It failed!')
arcpy.AddMessage("Subprocess output: {0}".format(e.output))
When running as a script tool in ArcGIS Desktop, the subprocess completes successfully with the STDOUT printed via arcpy.AddMessage.
When published as a GP service, it fails. The code enters the except block, prints 'it fails!' and then "Subprocess output", indicating that e.output
is empty.