I have a working GeoProcessing model in ArcPro that works perfectly well. Within this model I have a number of python tools.
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 X:\arcgisserver\directories\arcgissystem\arcgisinput
However, one of the python scripts gets adjusted with the following added to the top of the code X:\arcgisserver\directories\arcgissystem\arcgisinput\MyTool_101023.GPServer\extracted\p30\MyTool_widget_gp\SelectFactors3.py
When I run the model I get an error and it points to SelectFactors3.py as being the problem.
Why does this g_ESRI_variable_1 get added and what does it mean?
# 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