Error 001270: Consolidating the data failed. Failed to execute (StageService)

5457
3
06-05-2015 11:10 AM
PatBlair2
New Contributor II

Hello.  I have an arcpy script that can draft, stage, and upload a service on Machine A, but which fails during staging on Machine B when I get to the point where I call arcpy.server.StageService(). Here is the error:

arcgisscripting.ExecuteError: ERROR 001270: Consolidating the data filed.

Failed to execute(StageService).

Machine A is running ArcGIS 10.2 while Machine B is running 10.2.2.

I have created the simplest possible map document that I know how to create and modified it to the point that Machine A can publish it without errors, messages, or warnings.  Neither Machine A nor Machine B report any errors during the analysis of the draft, though Machine B seems to report a warning that Machine A does not: "Layer is using unsupported label settings (KML) (CODE 20032)".  Having said that, I should mention that I don't have any unusual labeling effects (of which I'm aware), and according to this document, you can simply "Do nothing" when you see it because "the effects not supported by KML will be ignored by the KML service".

From Machine A, I can draft, stage, and upload the map to the ArcGIS Server instance on Machine B, but I get the exception noted above when I attempt to run the same script, against the same data, on Machine B.  On both machines, the data is stored in the same directory (ie. all the file paths are the same).

I have done much research (reviewing ESRI docs, older posts, etc.) trying to figure out what might be causing this behavior and what I must correct to make it work.  For example, I have followed the advice in this document, but to no avail.  So far, though, I am still unable to get around this error.

I have attached my test script to this post, and also pasted it below.  I believe that the test script I am running is just about the least-exotic possible example of publishing a map service using arcpy, and I am at a loss to determine why Machine B is unhappy.

Any advice you may be able to provide would be greatly appreciated.

Many thanks.

(Script Follows)

import arcpy
import arcpy.mapping
import arcpy.server
import os, ntpath, sys



# See which python version we're running.
print sys.executable # C:\Python27\ArcGISx6410.2\python.exe


mxd = "C:\\MapData\\Main.mxd"
working_dir = "C:\\Temp"
connection_file_name = "my_ags.ags"
connection_file_path = ntpath.join(working_dir, connection_file_name)
draft_file_path = "C:\\Temp\\my_draft.sddraft"
service_def_file_path = draft_file_path[:-5]
server_url = "http://MYSERVER:6080/arcgis/admin"
service_name = "Main"
folder = "MyFolder"



# Remove the files created by previous runs.
for f in [ connection_file_path, draft_file_path, service_def_file_path ]:
    if ntpath.isfile(f):
        os.remove(f)



print("Creating the connection file.")
# Create the connection file.
arcpy.mapping.CreateGISServerConnectionFile(connection_type='ADMINISTER_GIS_SERVICES',
                                            out_folder_path=working_dir,
                                            out_name=connection_file_name,
                                            server_url=server_url,
                                            server_type='ARCGIS_SERVER',
                                            use_arcgis_desktop_staging_folder=False, # Don't use an ArcGIS desktop staging folder.
                                            staging_folder_path=working_dir,
                                            username='myuser',
                                            password='mypassword',
                                            save_username_password='SAVE_USERNAME')



# Create the draft.
print("Creating the draft.")
analysis = arcpy.mapping.CreateMapSDDraft(mxd,
                                          draft_file_path,
                                          service_name,
                                          'ARCGIS_SERVER',
                                          connection_file_path,
                                          False,
                                          folder,
                                          'summary',
                                          'tags')



# Perform the analysis.
print("Here comes the analysis...")
for key in ('messages', 'warnings', 'errors'):
  print "----" + key.upper() + "---"
  vars = analysis[key]
  for ((message, code), layerlist) in vars.iteritems():
    print "    ", message, " (CODE %i)" % code
# I've redacted the affected layers from the output just to make it a little
# easier to read, but here's the code...
#    print "       applies to:",
#    for layer in layerlist:
#        print layer.name,
#    print





# Stage the draft.
print("Staging the draft.") # Machine B fails at the next line...
arcpy.server.StageService(in_service_definition_draft=draft_file_path,
                          out_service_definition=service_def_file_path)


# Upload the service.
print("Uploading the service.")
arcpy.server.UploadServiceDefinition(service_def_file_path, 
                                        connection_file_path)
0 Kudos
3 Replies
GarethWalters3
New Contributor III

patblair‌ did you ever get an answer to this? If so please post. I have noticed that my python script works fine,  but when I implort the script to use as a toolbox tool, I get the same error you mentioned.

Look forward to hearing from you.'


Cheers,

Gareth

0 Kudos
PatBlair2
New Contributor II

Hi, Gareth.

Many times when we see this error (which, it seems, can crop up for a variety of reasons that, I guess, don't show up in the analysis), it's ends up being a problem with the data (as when a layer references an SDE source to which it can't connect, or something like that).  Have you tried the solutions documented here?

Also, we had some problems with staging during the transition from 10.3 to 10.4:  If I recall correctly, an MXD saved in ArcMap 10.3 would fail during the stage if an arcpy script running under 10.4 tried to publish from it.

GarethWalters3
New Contributor III

Thanks for the quick reply Pat, my issue turned out to be very simple. I didn't have the run in process tick box checked. Rookie mistake

0 Kudos