<?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 Publishing GP service via script fails to create Tasks in Publishing and Managing Services Questions</title>
    <link>https://community.esri.com/t5/publishing-and-managing-services-questions/publishing-gp-service-via-script-fails-to-create/m-p/1396844#M1151</link>
    <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;This process was working correctly just recently, only change has been the latest ArcPro update.&amp;nbsp; I'm basically following the examples in this&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/3.1/arcpy/functions/creategpsddraft.htm" target="_blank" rel="noopener"&gt;help doc&lt;/A&gt;.&amp;nbsp; Sample of bare min code to reproduce below.&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;My service/task list is pretty complicated so the script is a HUGE time/mistake saver.&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;I've tried a few tweaks and modified it down to just one tool and always get the same result.&amp;nbsp; I've also tried the script with just a single, simple out-of-the box tool (AddXY) rather than the custom tools/scripts -- example below.&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;Environment:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;ArcPro 3.2.2&lt;/LI&gt;&lt;LI&gt;ArcGIS Server (standalone 11.1)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Process Results:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;sddraft and sd files get created (no warnings, errors in analyze)&lt;UL&gt;&lt;LI&gt;I've opened the sd archive and extracted.&amp;nbsp; Everything looks fine.&amp;nbsp; The toolbox contains tools to be&amp;nbsp; published as tasks as configured&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;sd file uploads fine to arcgis server&lt;/LI&gt;&lt;LI&gt;service creates without error&lt;/LI&gt;&lt;LI&gt;no arcgis server manager log errors or warnings nor obvious messages at info level&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Two issues:&lt;UL&gt;&lt;LI&gt;service task list is empty!&lt;/LI&gt;&lt;LI&gt;minor but the message level setting does not take.&amp;nbsp; SOC count and other service properties get set correctly.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Repro script:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;result = arcpy.management.AddXY(
    in_features=r"D:\temp\data\scratch\Default.gdb\GPXPoints"
)                                   ^
sd = r"D:\temp\data\scratch\xy.sd"
sddraft = r"D:\temp\data\scratch\xy.sddraft"
serverconnectionfile = r"D:\temp\data\scratch\arcgis_on_server.com.ags"
serviceName = "XYTest"
analyzeMessages = arcpy.CreateGPSDDraft(
    result, sddraft, serviceName, server_type="FROM_CONNECTION_FILE",  
    connection_file_path= serverconnectionfile,
    copy_data_to_server=True, folder_name=None, 
    summary="XY Service", tags="gp", executionType="Synchronous",
    resultMapServer=False, showMessages="INFO", maximumRecords=5000,
    minInstances=2, maxInstances=3, maxUsageTime=100, maxWaitTime=10,
    maxIdleTime=180)
analyzeMessages
#{'errors': {}, 'warnings': {}, 'messages': {}}
arcpy.server.StageService(sddraft, sd)
#&amp;lt;Result 'D:\\temp\\data\\scratch\\xy.sd'&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached are the output sddraft and sd files&lt;/P&gt;&lt;P&gt;Thanks for any insights.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Mar 2024 21:31:20 GMT</pubDate>
    <dc:creator>FredSpataro</dc:creator>
    <dc:date>2024-03-15T21:31:20Z</dc:date>
    <item>
      <title>Publishing GP service via script fails to create Tasks</title>
      <link>https://community.esri.com/t5/publishing-and-managing-services-questions/publishing-gp-service-via-script-fails-to-create/m-p/1396844#M1151</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;This process was working correctly just recently, only change has been the latest ArcPro update.&amp;nbsp; I'm basically following the examples in this&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/3.1/arcpy/functions/creategpsddraft.htm" target="_blank" rel="noopener"&gt;help doc&lt;/A&gt;.&amp;nbsp; Sample of bare min code to reproduce below.&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;My service/task list is pretty complicated so the script is a HUGE time/mistake saver.&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;I've tried a few tweaks and modified it down to just one tool and always get the same result.&amp;nbsp; I've also tried the script with just a single, simple out-of-the box tool (AddXY) rather than the custom tools/scripts -- example below.&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;Environment:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;ArcPro 3.2.2&lt;/LI&gt;&lt;LI&gt;ArcGIS Server (standalone 11.1)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Process Results:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;sddraft and sd files get created (no warnings, errors in analyze)&lt;UL&gt;&lt;LI&gt;I've opened the sd archive and extracted.&amp;nbsp; Everything looks fine.&amp;nbsp; The toolbox contains tools to be&amp;nbsp; published as tasks as configured&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;sd file uploads fine to arcgis server&lt;/LI&gt;&lt;LI&gt;service creates without error&lt;/LI&gt;&lt;LI&gt;no arcgis server manager log errors or warnings nor obvious messages at info level&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Two issues:&lt;UL&gt;&lt;LI&gt;service task list is empty!&lt;/LI&gt;&lt;LI&gt;minor but the message level setting does not take.&amp;nbsp; SOC count and other service properties get set correctly.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Repro script:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;result = arcpy.management.AddXY(
    in_features=r"D:\temp\data\scratch\Default.gdb\GPXPoints"
)                                   ^
sd = r"D:\temp\data\scratch\xy.sd"
sddraft = r"D:\temp\data\scratch\xy.sddraft"
serverconnectionfile = r"D:\temp\data\scratch\arcgis_on_server.com.ags"
serviceName = "XYTest"
analyzeMessages = arcpy.CreateGPSDDraft(
    result, sddraft, serviceName, server_type="FROM_CONNECTION_FILE",  
    connection_file_path= serverconnectionfile,
    copy_data_to_server=True, folder_name=None, 
    summary="XY Service", tags="gp", executionType="Synchronous",
    resultMapServer=False, showMessages="INFO", maximumRecords=5000,
    minInstances=2, maxInstances=3, maxUsageTime=100, maxWaitTime=10,
    maxIdleTime=180)
analyzeMessages
#{'errors': {}, 'warnings': {}, 'messages': {}}
arcpy.server.StageService(sddraft, sd)
#&amp;lt;Result 'D:\\temp\\data\\scratch\\xy.sd'&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached are the output sddraft and sd files&lt;/P&gt;&lt;P&gt;Thanks for any insights.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 21:31:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/publishing-and-managing-services-questions/publishing-gp-service-via-script-fails-to-create/m-p/1396844#M1151</guid>
      <dc:creator>FredSpataro</dc:creator>
      <dc:date>2024-03-15T21:31:20Z</dc:date>
    </item>
  </channel>
</rss>

