ArcPy 10.1 StageService fails

2683
6
07-02-2013 09:16 PM
JoseSousa
Occasional Contributor III
Hi,

When executing the line arcpy.StageService_server(sddraft, sd) in ArcPy 10.1 using both PythonWin and VS2012 it fails with the error:
ERROR:root:ERROR 001269: Compressing the service definition failed.

I have noticed that this error is mentioned in the link thus it is not very helpful:
http://resources.arcgis.com/en/help/main/10.1/index.html#//00vp0000002r001269

The folder where the service definition is being written has all the appropriate permission.
If I execute the script inside ArcMap or ArcGIS for Server the line works just fine.

Can I have more help here?

Cheers,
Jose
Tags (2)
0 Kudos
6 Replies
LucasDanzinger
Esri Frequent Contributor
I'm guessing you can repro this through the UI and outside of Python. Are your data registered with the data store? If not, I would start with that. Otherwise, I have seen this happen with a corrupt MXD, so you could try adding the layers to a new map and trying to publish that MXD.
0 Kudos
JoseSousa
Occasional Contributor III
Hi,

Thanks for the reply.
The data store is appropriately registered and there is no problems with the MXD. I even created a new one with just one basic layer and it still doesn't work.

I am validating the sddraft first and there aren't errors to the exception of the scale range.

As mentioned before this works perfectly if the script is called by ArcGIS for Desktop (e.g. Tool or Geoprocessing Window).

When it is called from outside (e.g. VS or PythonWin) it doesn't work.

Cheers,
Jose
0 Kudos
LucasDanzinger
Esri Frequent Contributor
Hi Jose,

Just a thought, but do you have any other versions of Python installed? I'm wondering if ArcMap is pointing to the correct version and perhaps the IDEs that you are using are pointing to a different version?

-Luke
0 Kudos
SchoppMatthieu
New Contributor III
Hi,
The only case I've got stuck with that was because the "enabling SOE debugging" option was enabled (see attachment). For some reasons when the SOE debugging option is enabled, then the "Publishing Tool" geoprocessing service fails. Otherwise, check the ArcGIS Server logs, it must be saying  something about it.
0 Kudos
JoseSousa
Occasional Contributor III
Hi Lucas,

Yes. It was a conflict between versions. Thanks for pointing me to that.

I had installed AGS for Desktop which uses the 32 bits version of Python. Then installed PythonWin (and other stuff for other IDE's) for 32 bits OS. Then installed the ArcGIS Background Geoprocessing for Desktop 64 bits and it seems like it changed the Python version used for all IDE's. So when I tested these IDE's for the Python version (not the arcpy version) they were using the 64 bits version while
ArcGIS for Desktop was still using the 32 bits as expected.

After uninstalling, the ArcGIS Background Geoprocessing for Desktop and reinstalling all the IDE components that used Python (e.g. IronPython) everything is working properly.

It is a bit odd though that the desktop libraries coming with the AGS background geoprocessing setup causes this issue as AGS for Server is running arcpy on 64 bits and seems to work fine ...

Cheers,
Jose
Esri NZ
0 Kudos
ChrisPedrezuela
Occasional Contributor III

Hi Jose,

I've tried out this update script straight from our 10.3 documentation help files, it fails on 64bit and successful in 32bit python. I'm using python 2.7.8. I just find it weird that this particular function in the arcpy library fails in 64bit python while the rest works fine like creating SD drafts. 

0 Kudos