0

I have script that attempts to publish a service which consists of a single tiff.

I am using boilerplate ESRI code for this one:

# initialize
imagery_date = 'some date'
folder_name = 'name of folder'
summary = 'summary info_{}'.format(imagery_date)
service_name = 'name of service_{}'.format(imagery_date)
workspace = r'\\xxxx\xxxx\xxxx\Imagery'
ags_con = r'xxxx\xxxx.xxxx.xxxx_6443 (admin)'
service = "{}/{}/{}.MapServer".format(ags_con, folder_name, service_name)
map_doc = arcpy.mapping.MapDocument(os.path.join(workspace, '{}.mxd'.format(service_name)))
sddraft = os.path.join(workspace, '{}.sddraft'.format(service_name))
sd = os.path.join(workspace, '{}.sd'.format(service_name))

analysis = arcpy.mapping.CreateMapSDDraft(map_doc, sddraft, service_name, 'ARCGIS_SERVER',ags_con, False, folder_name, summary, tags)

if analysis['errors'] == {}:
    # Execute StageService
else:
    # if the sddraft analysis contained errors, display them
    print("ERROR!!")
    print(analysis['errors'])

The script fails with this error:

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

This error is supposed to occur when the layers data source is not accessible, and ESRI suggests repairing the broken link.

When I open the MXD I'm publishing from, there are no broken links. When I analyze the service, there are also no errors, and I can publish from the MXD.

The tiff in my MXD is referenced via a UNC path, and I do not have relative paths stored.

Has anyone dealt with this issue before?

  • 1
    "3" is not the same as Error 0003 as you link too. Your error is 1272: pro.arcgis.com/en/pro-app/tool-reference/… Change your code to print all of the analysis value, ie: print(analysis) and run again and see if there are other errors. – KHibma May 17 at 19:06
  • 1
    Or, that error could be coming from lines you haven't shown us based on the fact you say ExecuteError. Perhaps your error is coming from StageService or The UploadTool. Either way, you'll need to provide more script and more printed errors. At this point it could be a UNC issue, or 100 other different things. – KHibma May 17 at 19:10
  • @KHibma isn't error 1272 a generic code stating that errors were encountered, and the code in the parenthesis is the specific value? if '3' is not 0003, then what else could it be? – CSB May 17 at 20:09
  • @KHibma also, I should note, that error is not being generated by the print statement, but by arcmap, from within the script tool i'm running – CSB May 17 at 20:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.