1

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?

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.

  • 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 Sep 6 '13 at 14:46
  • @GBh, you should use an IDE (Pyscripter, PythonWin, IDLE, etc) to determine if you have code errors such as syntax. – Paul Sep 6 '13 at 18:26
2

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, privacy policy and cookie policy

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