AnsweredAssumed Answered

999999 error on StageService_server()

Question asked by scottwi_NYCDDC on Oct 10, 2019
Latest reply on Jul 8, 2020 by agelfert_RangeResources
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
```
#create draft
analysis = {}
try:
   analysis = sharing_draft.exportToSDDraft(sddraft_output_filename)
   print("draft export success")
except Exception as e:
   print("Draft export failed: {}".format(e))
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:

I am trying to publish an .mxd to our internal portal.

Which should I use?

 

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

Outcomes