2

Oh, the dredded 999999 error. I am trying to create a service definition in arcpy for ArcGIS Pro. I succeed in creating a .sddraft but I fail to create a .sd

sharing_draft = mlist[0].getWebLayerSharingDraft("HOSTING_SERVER", "FEATURE", "Active_Projects")

analysis = {}
try:
    analysis = sharing_draft.exportToSDDraft(sddraft_output_filename)
    print("draft export success")
except Exception as e:
    print("Draft export failed: {}".format(e))
#stage service by creating an .sd file
if analysis is not None:
    print("analysis: " + str(analysis.values))
else:
    print("draft analysis has no errors")
#create .sd file
sd_output_filename = outdir + sd_filename
print("sd_output_filename:" + sd_output_filename)
try:
    arcpy.StageService_server(sddraft_output_filename, sd_output_filename)
    print("stage successful")
except Exception as e:
    print("stage failed:{}".format(str(e)))

I get the following output

draft export success
draft analysis has no errors
stage failed:ERROR 999999: Something unexpected caused the tool to fail. Contact Esri Technical Support (http://esriurl.com/support) to Report a Bug, and refer to the error help for potential solutions or workarounds.
Failed to execute (StageService).

The draft has no errors...or does it? I am using double backslash the paths. I looked at this answer: (https://community.esri.com/thread/90453) but it is from 2014.

Edit: Do you think it has to do with the first line? I tried the following

mlist = aprx.listMaps()

sharing_draft = mlist[0].getWebLayerSharingDraft("FEDERATED_SERVER", "MAP_IMAGE", "Active_DDC_Projects")

sharing_draft = mlist[0].getWebLayerSharingDraft("HOSTING_SERVER", "FEATURE", "Active_DDC_Projects")

I am trying to publish an mxd file.

1
  • Do you think it has to do with the first line? I tried the following mlist = aprx.listMaps() sharing_draft = mlist[0].getWebLayerSharingDraft("FEDERATED_SERVER", "MAP_IMAGE", "Active_DDC_Projects") #sharing_draft = mlist[0].getWebLayerSharingDraft("HOSTING_SERVER", "FEATURE", "Active_DDC_Projects") I am trying to publish an mxd file. Oct 10, 2019 at 18:37

0

Your Answer

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