2

I was in the process of publishing my mxd , I had reached till the analysis step where I encontered the error at staging the service. Before this below mentioned code I had created a connection ags file.

analysis = arcpy.mapping.CreateMapSDDraft(MapDoc, SDDraft, serviceName, "ARCGIS_SERVER")
if analysis['errors']=={}:
     arcpy.StageService_server(SDDraft, sd)
     arcpy.UploadServiceDefinition_server(sd, connectionFilePath)

This is the error I encountered at the arcpy.StageService_server(SDDraft, sd) step:

ERROR 001272: Analyzer errors were encountered (codes = 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3).

Failed to execute (StageService).

What should I do now?

3 Answers 3

4

From the help on this error message:

Open the GIS resource using the appropriate application (for example, if you are working with a map document, open it with ArcMap), analyze the resource, and fix each error.

It appears that you have errors in your map document that is prohibiting you from creating the map service. These must be fixed before you are able to stage the service.

You need to analyze your map document from within ArcMap via Service Editor, as outlined here.

2
  • Thanks a lot for the reply, I am using the analyze variable to catch the errors, I'm still wondering if my mxd had errors why it didnt catch 'em? Is there a way to analyze and catch the errors in the code itself?
    – GBh
    Commented Sep 6, 2013 at 14:46
  • @GBh, you should use an IDE (Pyscripter, PythonWin, IDLE, etc) to determine if you have code errors such as syntax.
    – Paul
    Commented Sep 6, 2013 at 18:26
3

With respect to your comment:

"Is there a way to analyze and catch the errors in the code itself?"

Use arcpy.mapping.AnalyzeForSD(path_to_sddraft) to get a Python dictionary of your errors, warnings and messages.

Refer to the AnalyzeForSD (arcpy.mapping) help for code samples and further explanation.

2

This error can also ocur if you have made an MXD that does not contain anything. Please note that getting analysis from analysis = arcpy.mapping.CreateMapSDDraft(...) does not give a complete picture, so the error may come out when you convert the sddraft to sd even after reviewing the analysis.

A better way is to do analysis = arcpy.mapping.AnalyzeForSD(sddraft) after creating sddraft. This analysis will for example tell that codes = 1 means that the dataframe has no layers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.