<?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: Server Geolocator Publishing Fails in Python 3.6 but works in 2.7 in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/server-geolocator-publishing-fails-in-python-3-6/m-p/266675#M10281</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, thanks. I just started using &lt;A href="https://www.arcgis.com/home/item.html?id=54e8aab14f6e4c61b65b9dd9ab451503"&gt;this&amp;nbsp;&lt;/A&gt;script as a module, and everything is working. But your solution is faster. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Dec 2019 18:00:39 GMT</pubDate>
    <dc:creator>LeviCecil</dc:creator>
    <dc:date>2019-12-19T18:00:39Z</dc:date>
    <item>
      <title>Server Geolocator Publishing Fails in Python 3.6 but works in 2.7</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/server-geolocator-publishing-fails-in-python-3-6/m-p/266671#M10277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a script that creates two geolocators and publishes one of them to our standalone ArcGIS Server (10.7.1). When I run it in Python IDLE 3.6.8 it fails. When I run the exact same script in Python 2.7, it succeeds. I'm trying to get away from using 2.7, but I have a very similar issue with another important script that won't run in Pro or 3.6.8 due to a bug. Is anyone having trouble with Server publishing in Python 3.6.8?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the error that I get in the script and in the server logs. There is nothing specific in the server logs, just this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;An error occurred&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR 001487: Failed to update the published service with the server-side data location. Please see the server's log for more details.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR 001369: Failed to create the service.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Failed to execute (Publish Service Definition).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Failed.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Failed to execute (Publish Service Definition).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Failed.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Failed to execute (UploadServiceDefinition).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the relevant snippet of the script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;##Publish locators to ArcGIS Server&lt;/SPAN&gt;
locator_path &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; geocoding_dir &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"COP_Master_Address_Locator.loc"&lt;/SPAN&gt;
sddraft_file &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; geocoding_dir &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"COP_MAF_locator.sddraft"&lt;/SPAN&gt;
sd_file &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; geocoding_dir &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"COP_MAF_locator.sd"&lt;/SPAN&gt;
service_name &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"COP_Master_Address_Locator_test"&lt;/SPAN&gt;
summary &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Locator based on City Master Address Points"&lt;/SPAN&gt;
tags &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Geolocator"&lt;/SPAN&gt;
gis_server_connection_file &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"path\to\myconnection.ags"&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Create the sd draft file&lt;/SPAN&gt;
analyze_messages &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CreateGeocodeSDDraft&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;locator_path&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; sddraft_file&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; service_name&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                           connection_file_path&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;gis_server_connection_file&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                           summary&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;summary&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; tags&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;tags&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; max_result_size&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                           max_batch_size&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;100000&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; suggested_batch_size&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;10000&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                           &lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;##overwrite_existing_service=True&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Stage and upload the service if the sddraft analysis did not contain errors&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; analyze_messages&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'errors'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;try&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="comment token"&gt;# Execute StageService to convert sddraft file to a service definition &lt;/SPAN&gt;
        &lt;SPAN class="comment token"&gt;# (sd) file &lt;/SPAN&gt;
        arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;server&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;StageService&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;sddraft_file&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; sd_file&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

        &lt;SPAN class="comment token"&gt;# Execute UploadServiceDefinition to publish the service definition &lt;/SPAN&gt;
        &lt;SPAN class="comment token"&gt;# file as a service&lt;/SPAN&gt;
        arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;server&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;UploadServiceDefinition&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;sd_file&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; gis_server_connection_file&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"The geocode service was successfully published"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;except&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ExecuteError&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"An error occurred"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetMessages&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; 
    &lt;SPAN class="comment token"&gt;# If the sddraft analysis contained errors, display them&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Error were returned when creating service definition draft"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    pprint&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;pprint&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;analyze_messages&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'errors'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; indent&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:05:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/server-geolocator-publishing-fails-in-python-3-6/m-p/266671#M10277</guid>
      <dc:creator>LeviCecil</dc:creator>
      <dc:date>2021-12-11T13:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: Server Geolocator Publishing Fails in Python 3.6 but works in 2.7</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/server-geolocator-publishing-fails-in-python-3-6/m-p/266672#M10278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is with the&amp;nbsp;argument &lt;STRONG&gt;overwrite_existing_service=True.&amp;nbsp;&lt;/STRONG&gt;If I remove this from the arcpy.CreateGeocodeSDDraft tool in Python 3.6, I get&amp;nbsp;ERROR 001398: Service name 'COP_Master_Address_Locator' already exists. Failed to execute (UploadServiceDefinition).If I put it back in I get the aforementioned errors. If I run this script in Python 2.7 with &lt;STRONG&gt;overwrite_existing_service=True.&lt;/STRONG&gt; the script says this is an unexpected argument. If I run it without that line&amp;nbsp;the script will overwrite the previous locator on the server. So as it stands, I'll have to split this into two scripts between Python 2.7 and 3.6 to get it to work.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Dec 2019 23:17:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/server-geolocator-publishing-fails-in-python-3-6/m-p/266672#M10278</guid>
      <dc:creator>LeviCecil</dc:creator>
      <dc:date>2019-12-16T23:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: Server Geolocator Publishing Fails in Python 3.6 but works in 2.7</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/server-geolocator-publishing-fails-in-python-3-6/m-p/266673#M10279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your data is being updated on some periodic basis, why don't you try manually creating the gocode service and then have scripts that stop the service, then rebuild the address locator and finally start the service.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Dec 2019 23:55:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/server-geolocator-publishing-fails-in-python-3-6/m-p/266673#M10279</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2019-12-16T23:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: Server Geolocator Publishing Fails in Python 3.6 but works in 2.7</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/server-geolocator-publishing-fails-in-python-3-6/m-p/266674#M10280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Levi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Python 3.6, you have to add&amp;nbsp;&lt;SPAN class="" style="background-color: #ffffff; font-weight: 300; font-size: 14.875px;"&gt;copy_data_to_server&lt;SPAN style="color: #4c4c4c;"&gt;=True as one of the parameters to the "CreateGeocodeSDDraft" call.&amp;nbsp;That will get rid of&amp;nbsp;&lt;STRONG style="color: #3d3d3d; background-color: #ffffff; border: 0px; font-weight: bold; font-size: 15px;"&gt;ERROR 001487.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #4c4c4c; font-weight: 300; font-size: 14.875px; "&gt;It sounds like you already have a service called&amp;nbsp;&lt;SPAN style="color: #3d3d3d; background-color: #ffffff; font-weight: 400;"&gt;COP_Master_Address_Locator, so you'll have to also pass the&amp;nbsp;&lt;STRONG style="border: 0px; font-weight: bold; font-size: 15px;"&gt;overwrite_existing_service=True.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #3d3d3d; font-weight: 400; font-size: 14.875px; "&gt;Passing those 2 arguments in Python 3.6 should solve your problem.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #3d3d3d; font-weight: 400; font-size: 14.875px; "&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #3d3d3d; font-weight: 400; font-size: 14.875px; "&gt;Victor&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Dec 2019 17:47:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/server-geolocator-publishing-fails-in-python-3-6/m-p/266674#M10280</guid>
      <dc:creator>VictorBhattacharyya</dc:creator>
      <dc:date>2019-12-19T17:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: Server Geolocator Publishing Fails in Python 3.6 but works in 2.7</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/server-geolocator-publishing-fails-in-python-3-6/m-p/266675#M10281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, thanks. I just started using &lt;A href="https://www.arcgis.com/home/item.html?id=54e8aab14f6e4c61b65b9dd9ab451503"&gt;this&amp;nbsp;&lt;/A&gt;script as a module, and everything is working. But your solution is faster. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Dec 2019 18:00:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/server-geolocator-publishing-fails-in-python-3-6/m-p/266675#M10281</guid>
      <dc:creator>LeviCecil</dc:creator>
      <dc:date>2019-12-19T18:00:39Z</dc:date>
    </item>
  </channel>
</rss>

