<?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 Error with function: arcpy.mp.CreateWebLayerSSDraft in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-with-function-arcpy-mp-createweblayerssdraft/m-p/793460#M1672</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to wirte a script that will update automatically my hosted feature services from ArcGIS Pro to ArcGIS Online via a python script. I am new to python but found this post that gives a detailed description of the script needed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://blogs.esri.com/esri/arcgis/2017/03/14/updating-your-hosted-feature-services-with-arcgis-pro-and-the-arcgis-api-for-python/" title="https://blogs.esri.com/esri/arcgis/2017/03/14/updating-your-hosted-feature-services-with-arcgis-pro-and-the-arcgis-api-for-python/"&gt;Updating your hosted feature services with ArcGIS Pro and the ArcGIS API for Python | ArcGIS Blog&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to update the script to my needs so I changed the project path, sd_fs_name, user and password.&amp;nbsp; After running:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.mp.CreateWebLayerSDDraft(mp, sddraft, sd_fs_name, 'MY_HOSTED_SERVICES', 'FEATURE_ACCESS','', True, True)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get this error that I cannot figure out:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt; File "&amp;lt;string&amp;gt;", line 32, in &amp;lt;module&amp;gt;&lt;BR /&gt; File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\utils.py", line 191, in fn_&lt;BR /&gt; return fn(*args, **kw)&lt;BR /&gt; File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\mp.py", line 105, in CreateWebLayerSDDraft&lt;BR /&gt; return _convertArcObjectToPythonObject(arcgisscripting._mapping.CreateWebLayerSDDraft(*_gp_fixargs([map_or_layers, out_sddraft, service_name, server_type, service_type, folder_name, overwrite_existing_service, copy_data_to_server, enable_editing, allow_exporting, enable_sync, summary, tags, description, credits, use_limitations], True)))&lt;BR /&gt;RuntimeError&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the blog comments others have had the same problem but no solution has yet been offered there so I am hoping I might get more information here. Running on ArcGIS Pro 2.1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Feb 2018 14:00:53 GMT</pubDate>
    <dc:creator>ZecsQuébec</dc:creator>
    <dc:date>2018-02-13T14:00:53Z</dc:date>
    <item>
      <title>Error with function: arcpy.mp.CreateWebLayerSSDraft</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-with-function-arcpy-mp-createweblayerssdraft/m-p/793460#M1672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to wirte a script that will update automatically my hosted feature services from ArcGIS Pro to ArcGIS Online via a python script. I am new to python but found this post that gives a detailed description of the script needed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://blogs.esri.com/esri/arcgis/2017/03/14/updating-your-hosted-feature-services-with-arcgis-pro-and-the-arcgis-api-for-python/" title="https://blogs.esri.com/esri/arcgis/2017/03/14/updating-your-hosted-feature-services-with-arcgis-pro-and-the-arcgis-api-for-python/"&gt;Updating your hosted feature services with ArcGIS Pro and the ArcGIS API for Python | ArcGIS Blog&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to update the script to my needs so I changed the project path, sd_fs_name, user and password.&amp;nbsp; After running:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.mp.CreateWebLayerSDDraft(mp, sddraft, sd_fs_name, 'MY_HOSTED_SERVICES', 'FEATURE_ACCESS','', True, True)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get this error that I cannot figure out:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt; File "&amp;lt;string&amp;gt;", line 32, in &amp;lt;module&amp;gt;&lt;BR /&gt; File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\utils.py", line 191, in fn_&lt;BR /&gt; return fn(*args, **kw)&lt;BR /&gt; File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\mp.py", line 105, in CreateWebLayerSDDraft&lt;BR /&gt; return _convertArcObjectToPythonObject(arcgisscripting._mapping.CreateWebLayerSDDraft(*_gp_fixargs([map_or_layers, out_sddraft, service_name, server_type, service_type, folder_name, overwrite_existing_service, copy_data_to_server, enable_editing, allow_exporting, enable_sync, summary, tags, description, credits, use_limitations], True)))&lt;BR /&gt;RuntimeError&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the blog comments others have had the same problem but no solution has yet been offered there so I am hoping I might get more information here. Running on ArcGIS Pro 2.1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Feb 2018 14:00:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-with-function-arcpy-mp-createweblayerssdraft/m-p/793460#M1672</guid>
      <dc:creator>ZecsQuébec</dc:creator>
      <dc:date>2018-02-13T14:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: Error with function: arcpy.mp.CreateWebLayerSSDraft</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-with-function-arcpy-mp-createweblayerssdraft/m-p/793461#M1673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Zecs Quebec,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also seen this issue, when running a script from within ArcGIS Pro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have found that if I am signed in to ArcGIS Online and it is my Active Portal within Pro, the issue does not seem to occur.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Nic&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2018 00:05:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-with-function-arcpy-mp-createweblayerssdraft/m-p/793461#M1673</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2018-03-02T00:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: Error with function: arcpy.mp.CreateWebLayerSSDraft</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-with-function-arcpy-mp-createweblayerssdraft/m-p/793462#M1674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much for your reply. I though I was connected to Online and that it was my active portal but maybe not - I'll check! I finally fixed my problem by specifiyng the path to my project instead of having&amp;nbsp;&lt;CODE class="" style="color: black !important; background: none !important; border: 0px !important; font-size: 14px; margin: 0px !important; padding: 0px !important;"&gt;relPath &lt;/CODE&gt;&lt;CODE class="" style="color: #006699 !important; background: none !important; border: 0px !important; font-weight: bold !important; font-size: 14px; margin: 0px !important; padding: 0px !important;"&gt;=&lt;/CODE&gt;&lt;SPAN style="color: #333333; background-color: #ffffff;"&gt; &lt;/SPAN&gt;&lt;CODE class="" style="color: black !important; background: none !important; border: 0px !important; font-size: 14px; margin: 0px !important; padding: 0px !important;"&gt;sys.path[&lt;/CODE&gt;&lt;CODE class="" style="color: #009900 !important; background: none !important; border: 0px !important; font-size: 14px; margin: 0px !important; padding: 0px !important;"&gt;0&lt;/CODE&gt;&lt;CODE class="" style="color: black !important; background: none !important; border: 0px !important; font-size: 14px; margin: 0px !important; padding: 0px !important;"&gt;] &lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;(line 24 in the code sample from the blog).&amp;nbsp;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Mar 2018 16:51:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-with-function-arcpy-mp-createweblayerssdraft/m-p/793462#M1674</guid>
      <dc:creator>ZecsQuébec</dc:creator>
      <dc:date>2018-03-07T16:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: Error with function: arcpy.mp.CreateWebLayerSSDraft</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-with-function-arcpy-mp-createweblayerssdraft/m-p/793463#M1675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am having the same issue with&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;arcpy.mp.CreateWebLayerSDDraft.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Can you please post the code you used in place of relPath = sys.path[0]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2018 17:40:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-with-function-arcpy-mp-createweblayerssdraft/m-p/793463#M1675</guid>
      <dc:creator>SantiagoGarcia1</dc:creator>
      <dc:date>2018-05-07T17:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: Error with function: arcpy.mp.CreateWebLayerSSDraft</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-with-function-arcpy-mp-createweblayerssdraft/m-p/793464#M1676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code that I used, I hope it helps you resolve your issue! Note that I replaced the actual username and password with XXXX. I am a beginner in Python but if you have questions I'll do my best to help &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp; "Public_lac" is my map in my ArcGIS Pro Projet. Since I have many maps in my project I had to find wich "number" was associated to "Public_lac" because I could not call the map by name so this is the line:&amp;nbsp;&lt;SPAN&gt;mp = prj.listMaps("Public_lac")[0]&amp;nbsp;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;##Upload - overwrite Public_lac&lt;BR /&gt;import arcpy&lt;BR /&gt;import os, sys&lt;BR /&gt;from arcgis.gis import GIS&lt;/P&gt;&lt;P&gt;##Start setting variables&lt;BR /&gt;#Set path to the project&lt;BR /&gt;prjPath = "C:\\Users\\Proprio\\Desktop\\ArcGISOnline_FichierTravail\\AppWeb_ZecsQuébec.aprx"&lt;/P&gt;&lt;P&gt;#Feature service/SD name in arcgis.com, user/password of the owner account&lt;BR /&gt;sd_fs_name= "Public_lac"&lt;BR /&gt;&lt;SPAN&gt;portal = "&lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.esri.com/www.arcgis.com" rel="nofollow" target="_blank"&gt;http://www.arcgis.com&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;BR /&gt;user = "XXXX"&lt;BR /&gt;password = "XXXX"&lt;/P&gt;&lt;P&gt;# Set sharing options&lt;BR /&gt;shrOrg = True&lt;BR /&gt;shrEveryone = True&lt;BR /&gt;shrGroups = ""&lt;BR /&gt; &lt;BR /&gt;### End setting variables&lt;BR /&gt; &lt;BR /&gt;# Local paths to create temporary content&lt;BR /&gt;relPath = 'C:\\Users\\Proprio\\Documents\\ArcGIS\\Projects'&lt;BR /&gt;sddraft = os.path.join(relPath, "WebUpdate.sddraft")&lt;BR /&gt;sd = os.path.join(relPath, "WebUpdate.sd")&lt;BR /&gt; &lt;BR /&gt;# Create a new SDDraft and stage to SD&lt;BR /&gt;print("Creating SD file")&lt;BR /&gt;arcpy.env.overwriteOutput = True&lt;BR /&gt;prj = arcpy.mp.ArcGISProject(prjPath)&lt;BR /&gt;mp = prj.listMaps("Public_lac")[0] &lt;BR /&gt;arcpy.mp.CreateWebLayerSDDraft(mp, sddraft, sd_fs_name, 'MY_HOSTED_SERVICES', 'FEATURE_ACCESS','', True, True)&lt;BR /&gt;arcpy.StageService_server(sddraft, sd)&lt;BR /&gt; &lt;BR /&gt;print("Connecting to {}".format(portal))&lt;BR /&gt;gis = GIS(portal, user, password)&lt;BR /&gt; &lt;BR /&gt;# Find the SD, update it, publish /w overwrite and set sharing and metadata&lt;BR /&gt;print("Search for original SD on portal...")&lt;BR /&gt;sdItem = gis.content.search("{} AND owner:{}".format(sd_fs_name, user), item_type="Service Definition")[0]&lt;BR /&gt;print("Found SD: {}, ID: {} \n Uploading and overwriting...".format(sdItem.title, sdItem.id))&lt;BR /&gt;sdItem.update(data=sd)&lt;BR /&gt;print("Overwriting existing feature service...")&lt;BR /&gt;fs = sdItem.publish(overwrite=True)&lt;BR /&gt; &lt;BR /&gt;if shrOrg or shrEveryone or shrGroups:&lt;BR /&gt; print("Setting sharing options...")&lt;BR /&gt; fs.share(org=shrOrg, everyone=shrEveryone, groups=shrGroups)&lt;BR /&gt; &lt;BR /&gt;print("Finished updating: {} - ID: {}".format(fs.title, fs.id))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2018 13:47:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-with-function-arcpy-mp-createweblayerssdraft/m-p/793464#M1676</guid>
      <dc:creator>ZecsQuébec</dc:creator>
      <dc:date>2018-05-08T13:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Error with function: arcpy.mp.CreateWebLayerSSDraft</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-with-function-arcpy-mp-createweblayerssdraft/m-p/793465#M1677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have an automated process that overwrites a hosted feature layer in ArcGIS Online, like the blog post referenced above. We encountered an issue somewhere around February 4, 2019 involving&amp;nbsp;a RuntimeError exception in the call to arcpy.mp.CreateWebLayerSDDraft() that prints out nothing meaningful when handled in a try/except.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="445632" class="image-1 jive-image" height="215" src="https://community.esri.com/legacyfs/online/445632_pastedImage_1.png" width="416" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The portion of the code that was failing is as follows...&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #cc7832;"&gt;try&lt;/SPAN&gt;:
    arcpy.mp.CreateWebLayerSDDraft(&lt;SPAN style="color: #aa4926;"&gt;map_or_layers&lt;/SPAN&gt;=arcpro_map&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;                                   &lt;/SPAN&gt;&lt;SPAN style="color: #aa4926;"&gt;out_sddraft&lt;/SPAN&gt;=sd_draft_filename&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;                                   &lt;/SPAN&gt;&lt;SPAN style="color: #aa4926;"&gt;service_name&lt;/SPAN&gt;=&lt;SPAN style="color: #6a8759;"&gt;"Elected_Officials"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;                                   &lt;/SPAN&gt;&lt;SPAN style="color: #aa4926;"&gt;server_type&lt;/SPAN&gt;=&lt;SPAN style="color: #6a8759;"&gt;"MY_HOSTED_SERVICES"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;                                   &lt;/SPAN&gt;&lt;SPAN style="color: #aa4926;"&gt;service_type&lt;/SPAN&gt;=&lt;SPAN style="color: #6a8759;"&gt;"FEATURE_ACCESS"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;                                   &lt;/SPAN&gt;&lt;SPAN style="color: #aa4926;"&gt;folder_name&lt;/SPAN&gt;=&lt;SPAN style="color: #6a8759;"&gt;"MD Elect"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;                                   &lt;/SPAN&gt;&lt;SPAN style="color: #aa4926;"&gt;overwrite_existing_service&lt;/SPAN&gt;=&lt;SPAN style="color: #cc7832;"&gt;True,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;                                   &lt;/SPAN&gt;&lt;SPAN style="color: #aa4926;"&gt;copy_data_to_server&lt;/SPAN&gt;=&lt;SPAN style="color: #cc7832;"&gt;True,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;                                   &lt;/SPAN&gt;&lt;SPAN style="color: #aa4926;"&gt;enable_editing&lt;/SPAN&gt;=&lt;SPAN style="color: #cc7832;"&gt;False,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;                                   &lt;/SPAN&gt;&lt;SPAN style="color: #aa4926;"&gt;allow_exporting&lt;/SPAN&gt;=&lt;SPAN style="color: #cc7832;"&gt;False,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;                                   &lt;/SPAN&gt;&lt;SPAN style="color: #aa4926;"&gt;enable_sync&lt;/SPAN&gt;=&lt;SPAN style="color: #cc7832;"&gt;False,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;                                   &lt;/SPAN&gt;&lt;SPAN style="color: #aa4926;"&gt;summary&lt;/SPAN&gt;=&lt;SPAN style="color: #cc7832;"&gt;None,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;                                   &lt;/SPAN&gt;&lt;SPAN style="color: #aa4926;"&gt;tags&lt;/SPAN&gt;=&lt;SPAN style="color: #cc7832;"&gt;None,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;                                   &lt;/SPAN&gt;&lt;SPAN style="color: #aa4926;"&gt;description&lt;/SPAN&gt;=&lt;SPAN style="color: #cc7832;"&gt;None,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;                                   &lt;/SPAN&gt;&lt;SPAN style="color: #aa4926;"&gt;credits&lt;/SPAN&gt;=&lt;SPAN style="color: #cc7832;"&gt;None,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;                                   &lt;/SPAN&gt;&lt;SPAN style="color: #aa4926;"&gt;use_limitations&lt;/SPAN&gt;=&lt;SPAN style="color: #cc7832;"&gt;None&lt;/SPAN&gt;)
&lt;SPAN style="color: #cc7832;"&gt;except &lt;/SPAN&gt;&lt;SPAN style="color: #8888c6;"&gt;RuntimeError &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;as &lt;/SPAN&gt;rte:
    &lt;SPAN style="color: #8888c6;"&gt;print&lt;/SPAN&gt;(&lt;SPAN style="color: #6a8759;"&gt;f"Runtime Error: &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;{&lt;/SPAN&gt;rte&lt;SPAN style="color: #cc7832;"&gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"&lt;/SPAN&gt;)
    &lt;SPAN style="color: #8888c6;"&gt;exit&lt;/SPAN&gt;()
&lt;SPAN style="color: #cc7832;"&gt;else&lt;/SPAN&gt;:
    arcpy.StageService_server(&lt;SPAN style="color: #aa4926;"&gt;in_service_definition_draft&lt;/SPAN&gt;=sd_draft_filename&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;                              &lt;/SPAN&gt;&lt;SPAN style="color: #aa4926;"&gt;out_service_definition&lt;/SPAN&gt;=sd_filename)&lt;/PRE&gt;&lt;/PRE&gt;&lt;P&gt;Outside of a try/except this is the error output...&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt; File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\mp.py", line 105, in CreateWebLayerSDDraft&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt; return _convertArcObjectToPythonObject(arcgisscripting._mapping.CreateWebLayerSDDraft(*_gp_fixargs([map_or_layers, out_sddraft, service_name, server_type, service_type, folder_name, overwrite_existing_service, copy_data_to_server, enable_editing, allow_exporting, enable_sync, summary, tags, description, credits, use_limitations], True)))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;RuntimeError&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;After much trial and error we figured out that the space in the folder name value was causing the issue.&lt;/STRONG&gt; The process had been running for months with no issue using the string value "MD Elect". It looks like something in the underlying arcpy code was changed. We revised our ArcGIS Online folder name to eliminate the space, so that the destination folder matched the string we were forced to pass, and gave the function "MD_Elect" and the process runs again. We also tried "MD%20Elect", thinking it might be some web related issue, even though the function of interest doesn't make a web call, but it failed with the RuntimeError.&amp;nbsp;The default of None and also a blank string "" worked, as a side note.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;So, for our anonymous RuntimeError exception thrown by arcpy.mp.CreateWeblayerSDDraft the solution was to eliminate spaces in the string value passed to the folder_name keyword parameter.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/209599" target="_blank"&gt;Error with function: arcpy.mp.CreateWebLayerSSDraft&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/241957" target="_blank"&gt;Matthew Sokol (DOIT)&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/space/2145" target="_blank"&gt;Python&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/space/2059" target="_blank"&gt;GIS Developers&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:07:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-with-function-arcpy-mp-createweblayerssdraft/m-p/793465#M1677</guid>
      <dc:creator>ConradSchaefer__DOIT_</dc:creator>
      <dc:date>2021-12-12T09:07:54Z</dc:date>
    </item>
    <item>
      <title>Re: Error with function: arcpy.mp.CreateWebLayerSSDraft</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-with-function-arcpy-mp-createweblayerssdraft/m-p/1014697#M5395</link>
      <description>&lt;P&gt;Also ensure the out_sddraft folder specified as a parameter exists.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 16:39:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-with-function-arcpy-mp-createweblayerssdraft/m-p/1014697#M5395</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-01-07T16:39:05Z</dc:date>
    </item>
  </channel>
</rss>

