<?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 SD item added but publishing results in &amp;quot;Job Failed&amp;quot; - was working fine. in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/sd-item-added-but-publishing-results-in-quot-job/m-p/1255748#M8349</link>
    <description>&lt;P&gt;I am using the getWebLayerSharingDraft --&amp;gt; exportToSDDraft --&amp;gt; StageService_server&amp;nbsp; --&amp;gt; content.add --&amp;gt; item.publish method of updating a hosted feature layer with new data.&amp;nbsp; This has been working perfectly.&amp;nbsp; Now, for no reason so far as I can tell, my SD file will upload to AGOL but the next publishing step fails with "Job Failed".&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One note - after a successful publish, the code goes on to delete the Service Definition item.&amp;nbsp; The service definition file appears to be delete protected now.&amp;nbsp; I see both the hosted feature layer and the service definition file in my AGOL content.&amp;nbsp; In ArcGIS Online, the Feature Layer (hosted) item says it was updated Feb 7, yet in the Details section on the right panel, it says "Data updated: Jan 28.&lt;/P&gt;&lt;P&gt;Log result for below:&lt;/P&gt;&lt;P&gt;Creating SD file&lt;BR /&gt;exportToSDDraft&lt;BR /&gt;Connecting to &lt;A href="https://arcgis.com/" target="_blank"&gt;https://arcgis.com/&lt;/A&gt;&lt;BR /&gt;GIS @ &lt;A href="https://pottcounty.maps.arcgis.com" target="_blank"&gt;https://pottcounty.maps.arcgis.com&lt;/A&gt; version:10.3&lt;BR /&gt;added&lt;BR /&gt;Job failed.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;    sharing_draft = mp.getWebLayerSharingDraft("HOSTING_SERVER", "FEATURE", sd_fs_name)
    
    sharing_draft.summary = ""
    sharing_draft.tags = ""
    sharing_draft.description = ""
    sharing_draft.credits = ""
    sharing_draft.useLimitations = ""
    sharing_draft.offline = True
    sharing_draft.overwriteExistingService = True
##    # Create Service Definition Draft file
    print ("exportToSDDraft")
    sharing_draft.exportToSDDraft(sddraft)

##    # Stage Service
    try:
        arcpy.StageService_server(sddraft, sd)
        warnings = arcpy.GetMessages(1)
        print(warnings)
    except Exception as stage_exception:
        print("Sddraft not staged. Analyzer errors encountered - {}".format(str(stage_exception)))

    print("Connecting to {}".format(portal))
    gis = GIS(portal, user, password)
    print(gis)

    #######
    item = gis.content.add({"overwrite": True},sd)
    print ("added")
    published_item = item.publish(overwrite=True)
    print ("published")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Feb 2023 15:52:56 GMT</pubDate>
    <dc:creator>JamiePetersen</dc:creator>
    <dc:date>2023-02-07T15:52:56Z</dc:date>
    <item>
      <title>SD item added but publishing results in "Job Failed" - was working fine.</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/sd-item-added-but-publishing-results-in-quot-job/m-p/1255748#M8349</link>
      <description>&lt;P&gt;I am using the getWebLayerSharingDraft --&amp;gt; exportToSDDraft --&amp;gt; StageService_server&amp;nbsp; --&amp;gt; content.add --&amp;gt; item.publish method of updating a hosted feature layer with new data.&amp;nbsp; This has been working perfectly.&amp;nbsp; Now, for no reason so far as I can tell, my SD file will upload to AGOL but the next publishing step fails with "Job Failed".&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One note - after a successful publish, the code goes on to delete the Service Definition item.&amp;nbsp; The service definition file appears to be delete protected now.&amp;nbsp; I see both the hosted feature layer and the service definition file in my AGOL content.&amp;nbsp; In ArcGIS Online, the Feature Layer (hosted) item says it was updated Feb 7, yet in the Details section on the right panel, it says "Data updated: Jan 28.&lt;/P&gt;&lt;P&gt;Log result for below:&lt;/P&gt;&lt;P&gt;Creating SD file&lt;BR /&gt;exportToSDDraft&lt;BR /&gt;Connecting to &lt;A href="https://arcgis.com/" target="_blank"&gt;https://arcgis.com/&lt;/A&gt;&lt;BR /&gt;GIS @ &lt;A href="https://pottcounty.maps.arcgis.com" target="_blank"&gt;https://pottcounty.maps.arcgis.com&lt;/A&gt; version:10.3&lt;BR /&gt;added&lt;BR /&gt;Job failed.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;    sharing_draft = mp.getWebLayerSharingDraft("HOSTING_SERVER", "FEATURE", sd_fs_name)
    
    sharing_draft.summary = ""
    sharing_draft.tags = ""
    sharing_draft.description = ""
    sharing_draft.credits = ""
    sharing_draft.useLimitations = ""
    sharing_draft.offline = True
    sharing_draft.overwriteExistingService = True
##    # Create Service Definition Draft file
    print ("exportToSDDraft")
    sharing_draft.exportToSDDraft(sddraft)

##    # Stage Service
    try:
        arcpy.StageService_server(sddraft, sd)
        warnings = arcpy.GetMessages(1)
        print(warnings)
    except Exception as stage_exception:
        print("Sddraft not staged. Analyzer errors encountered - {}".format(str(stage_exception)))

    print("Connecting to {}".format(portal))
    gis = GIS(portal, user, password)
    print(gis)

    #######
    item = gis.content.add({"overwrite": True},sd)
    print ("added")
    published_item = item.publish(overwrite=True)
    print ("published")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 15:52:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/sd-item-added-but-publishing-results-in-quot-job/m-p/1255748#M8349</guid>
      <dc:creator>JamiePetersen</dc:creator>
      <dc:date>2023-02-07T15:52:56Z</dc:date>
    </item>
  </channel>
</rss>

