<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: 999999 error on StageService_server() in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/999999-error-on-stageservice-server/m-p/1199229#M65195</link>
    <description>&lt;P&gt;I hope this helps someone out there.&amp;nbsp; I solved a half-day of banging my head against the wall with one silly line of code:&lt;/P&gt;&lt;P&gt;aprx.save()&lt;/P&gt;&lt;P&gt;If you make any changes, save them before publishing.&lt;/P&gt;</description>
    <pubDate>Wed, 03 Aug 2022 23:39:31 GMT</pubDate>
    <dc:creator>MarkCederholmEvergy</dc:creator>
    <dc:date>2022-08-03T23:39:31Z</dc:date>
    <item>
      <title>999999 error on StageService_server()</title>
      <link>https://community.esri.com/t5/python-questions/999999-error-on-stageservice-server/m-p/124671#M9696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;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

&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;```
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).
```&lt;/PRE&gt;&lt;P&gt;The draft has no errors...or does it? I am using double backslash the paths. I looked at this answer: (&lt;A href="https://community.esri.com/thread/90453" target="_blank"&gt;https://community.esri.com/thread/90453&lt;/A&gt;) but it is from 2014.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit:&lt;/P&gt;&lt;P&gt;I am trying to publish an .mxd to our internal portal.&lt;/P&gt;&lt;P&gt;Which should I use?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;sharing_draft = mlist[0].getWebLayerSharingDraft("FEDERATED_SERVER", "MAP_IMAGE", "Active_Projects")
sharing_draft = mlist[0].getWebLayerSharingDraft("HOSTING_SERVER", "FEATURE", "Active_Projects")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:02:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/999999-error-on-stageservice-server/m-p/124671#M9696</guid>
      <dc:creator>SteveScott</dc:creator>
      <dc:date>2021-12-12T16:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: 999999 error on StageService_server()</title>
      <link>https://community.esri.com/t5/python-questions/999999-error-on-stageservice-server/m-p/124672#M9697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the difference between UploadServiceDefinition_Server and gis.content.add?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Oct 2019 14:04:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/999999-error-on-stageservice-server/m-p/124672#M9697</guid>
      <dc:creator>SteveScott</dc:creator>
      <dc:date>2019-10-11T14:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: 999999 error on StageService_server()</title>
      <link>https://community.esri.com/t5/python-questions/999999-error-on-stageservice-server/m-p/124673#M9698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you ever get this to work? I've run into 99999 with the same step and have no explanation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jul 2020 17:35:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/999999-error-on-stageservice-server/m-p/124673#M9698</guid>
      <dc:creator>ArneGelfert</dc:creator>
      <dc:date>2020-07-08T17:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: 999999 error on StageService_server()</title>
      <link>https://community.esri.com/t5/python-questions/999999-error-on-stageservice-server/m-p/1199229#M65195</link>
      <description>&lt;P&gt;I hope this helps someone out there.&amp;nbsp; I solved a half-day of banging my head against the wall with one silly line of code:&lt;/P&gt;&lt;P&gt;aprx.save()&lt;/P&gt;&lt;P&gt;If you make any changes, save them before publishing.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 23:39:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/999999-error-on-stageservice-server/m-p/1199229#M65195</guid>
      <dc:creator>MarkCederholmEvergy</dc:creator>
      <dc:date>2022-08-03T23:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: 999999 error on StageService_server()</title>
      <link>https://community.esri.com/t5/python-questions/999999-error-on-stageservice-server/m-p/1560741#M73209</link>
      <description>&lt;P&gt;Thank you!!!&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2024 14:44:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/999999-error-on-stageservice-server/m-p/1560741#M73209</guid>
      <dc:creator>RandyMcGregor_BMcD</dc:creator>
      <dc:date>2024-11-20T14:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: 999999 error on StageService_server()</title>
      <link>https://community.esri.com/t5/python-questions/999999-error-on-stageservice-server/m-p/1699534#M75221</link>
      <description>&lt;P&gt;Thank you very much. Saved my day&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2026 11:21:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/999999-error-on-stageservice-server/m-p/1699534#M75221</guid>
      <dc:creator>RasmusKlog1</dc:creator>
      <dc:date>2026-05-01T11:21:10Z</dc:date>
    </item>
  </channel>
</rss>

