<?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: Publishing a Model from Pro to Server - g_ESRI_variable_1 issue in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/publishing-a-model-from-pro-to-server-g-esri/m-p/1336718#M6791</link>
    <description>&lt;P&gt;David, I just replaced the rewritten script on the server (via the publishing process) with the original one from my local Pro and it worked. Thank you! I'll explore more&lt;/P&gt;</description>
    <pubDate>Tue, 10 Oct 2023 20:04:28 GMT</pubDate>
    <dc:creator>JPGlee</dc:creator>
    <dc:date>2023-10-10T20:04:28Z</dc:date>
    <item>
      <title>Publishing a Model from Pro to Server - g_ESRI_variable_1 issue</title>
      <link>https://community.esri.com/t5/developers-questions/publishing-a-model-from-pro-to-server-g-esri/m-p/1336663#M6789</link>
      <description>&lt;P&gt;I have a working GeoProcessing model in ArcPro that works perfectly well. Within this model I have a number of python tools.&lt;/P&gt;&lt;P&gt;When I publish the model to ArcGIS Server it seems fine but when I try and run the model in Server I get an error. It seems Server makes a copy of all scripts to&amp;nbsp;X&lt;SPAN&gt;:\arcgisserver\directories\arcgissystem\arcgisinput&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, one of the python scripts gets adjusted with the following added to the top of the code X&lt;SPAN&gt;:\arcgisserver\directories\arcgissystem\arcgisinput\MyTool_101023.GPServer\extracted\p30\MyTool_widget_gp\SelectFactors3.py&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When I run the model I get an error and it points to&amp;nbsp;SelectFactors3.py as being the problem.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Why does this g_ESRI_variable_1 get added and what does it mean?&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Esri start of added imports
import sys, os, arcpy
# Esri end of added imports

# Esri start of added variables
g_ESRI_variable_1 = 'X:\\arcgisserver\\directories\\configuration\\aliasconfiguration.json'
# Esri end of added variables&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2023 17:44:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/publishing-a-model-from-pro-to-server-g-esri/m-p/1336663#M6789</guid>
      <dc:creator>JPGlee</dc:creator>
      <dc:date>2023-10-10T17:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: Publishing a Model from Pro to Server - g_ESRI_variable_1 issue</title>
      <link>https://community.esri.com/t5/developers-questions/publishing-a-model-from-pro-to-server-g-esri/m-p/1336688#M6790</link>
      <description>&lt;P&gt;The publishing process is rewriting your script to adjust embedded paths but the heuristic is terrible and it'll often break your scripts. The workaround is to edit the server's copy, adjust your tool to avoid referencing external files that aren't standard ArcGIS resources, or copy those external files to the server directories.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2023 18:49:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/publishing-a-model-from-pro-to-server-g-esri/m-p/1336688#M6790</guid>
      <dc:creator>DavidSolari</dc:creator>
      <dc:date>2023-10-10T18:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: Publishing a Model from Pro to Server - g_ESRI_variable_1 issue</title>
      <link>https://community.esri.com/t5/developers-questions/publishing-a-model-from-pro-to-server-g-esri/m-p/1336718#M6791</link>
      <description>&lt;P&gt;David, I just replaced the rewritten script on the server (via the publishing process) with the original one from my local Pro and it worked. Thank you! I'll explore more&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2023 20:04:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/publishing-a-model-from-pro-to-server-g-esri/m-p/1336718#M6791</guid>
      <dc:creator>JPGlee</dc:creator>
      <dc:date>2023-10-10T20:04:28Z</dc:date>
    </item>
  </channel>
</rss>

