ArcPy 10.2.1 - Service Publishing Error

1765
4
02-10-2014 12:46 PM
JasonGreenlaw
Occasional Contributor
Using ArcPy on Windows (via ArcGIS Desktop or iPython), I am able to successfully publish map services using the draft/stage/upload approach, however I am not able to perform the same task using ArcPy on the ArcGIS Server (Linux) machine itself.

Creating a draft and analyzing works fine, but when I attempt to stage the service (arcpy.StageService_server(...)) I'm encountering the following error:

arcgisscripting.ExecuteError: ERROR 001270: Consolidating the data failed.
Failed to execute (StageService).


I am using ArcGIS Server 10.2.1 for Linux (RHEL 6, x86_64)

There are several other forum posts mentioning this error message, but I've tried the advice mentioned (shortening staging/connection path names, ensuring adequate storage is available, etc.), but nothing has resolved the problem.

Since I am using the Python/ArcPy environment packaged with the ArcGIS Server machine itself, I suspect what I'm trying to do may not be possible as the ArcInfo licensing level may be required, but that's just a guess.

Is it possible to publish a service using ArcPy on the ArcGIS Server machine itself?

This seems like it should be a fairly common task for enterprise ArcGIS Server installations, since publishing large map services to a remote ArcGIS Server over the internet (not a LAN) is quite time-consuming, so it would be nice to be able to copy the MXD/data to the server manually and run the publishing locally.
Tags (2)
4 Replies
LucaSimone
New Contributor III
Same problem here, looking around the general solution was to change the stage folder to something short like: C:\temp
but did't solve my problem.
Now I deploy the service by saving the service definition and then publish it in the ArcGisServer Manager (web admin).
It's the only way to deploy a Geoprocessing tool for me right now...
JasonGreenlaw
Occasional Contributor
Thanks for the input.  That sounds like a good workaround for some services, but I don't think that will work for shapefile-based map services that copy data to the server.  However I suppose it should work if the shapefiles are copied over manually to a registered data store folder.

Hopefully ESRI can give an answer as to whether or not the original approach is possible.
DavidBowman
New Contributor
I'm having exactly the same problem.
Everything publishes fine from ArcMap but using arcpy it fails.

Tried moving everything from my project to C:/temp/ as suggested by other users but no luck.

I'm wondering if it's because I have a trial license but would be good to have this clarified!
The whole reason for the trial is to check we can get scripted publishing working before investing.
ColinAlexander1
New Contributor

I'm having this exact same problem in 10.7.1. The exact same script on Windows will run succesfully in about 3 minutes, but running from ArcPy on ImageServer(Linux, Ubuntu 20.04) will result in this exact same error. 

I think it's due to data registration paths getting mangled by StageService.

When I pull the method StageService_server out of the try blocks (from examples) I can get better errors. The error message prints out the paths to .sd and .sdd files, and everytime, my Linux .sd path gets converted to a Windows path. (Uses backslashes instead of forward-slashes). No matter what I do to my Linux paths, the StageService_server method will convert only the .sd path to Windows. 

0 Kudos