A geoprocessing service fails because the server adds two strings to the data variables

530
2
04-03-2023 01:55 PM
Labels (1)
WilsonIonara
New Contributor III

I have a geoprocessing service that breaks because the server adds two strings to the data variables. The code snippet is: 

 

dir_path = r'e:\ArcGISData\ForestEcosystemValuesData'
arcpy.AddMessage(dir_path)
# root = r'E:\ArcGISData\ForestEcosystemValuesData\ForestValuesApp.gdb'
workspace = os.path.join(dir_path, 'ForestValuesApp.gdb')
arcpy.env.workspace = workspace
arcpy.env.overwriteOutput = True
CS = 30
CONV = 0.000247105381
ZONEFIELD = 'SAID'
AOITotalAreaAcres = 0
root = arcpy.env.workspace
urban = os.path.join(root, 'AOIUrbanVector')
rasterList = ['uBiodiversity', 'uClimate',  'uCultural', 'uEconomic',  'uHumanHealth', 'uWatershed',  'rBiodiversity', 'rClimate', 'rCultural', 'rWatershed']
tempPolygon = r'in_memory\temp1'
memo = "in_memory"

 

 

And when I open the script on the server folder I have this, it adds a string (a') to one of the variables and another string (db') to the other variable: 

g_ESRI_variable_1 = 'E:\\ArcGISData\\ForestEcosystemValuesData'a'
g_ESRI_variable_2 = 'E:\\ArcGISData\\ForestEcosystemValuesData/ForestValuesApp.gdb'db'
g_ESRI_variable_3 = 'in_memory\\temp1'
g_ESRI_variable_4 = 'SAID'
g_ESRI_variable_6 = 'in_memory/'
g_ESRI_variable_7 = 'in_memory\\urbanaoipoly3'
g_ESRI_variable_8 = 'UrbanID'

WilsonIonara_0-1680555075399.png

 

And this is the error returned on the app: 

File "E:\arcgisserver\directories\arcgissystem\arcgisinput\ForestEcosystemValues\EcoNewGP.GPServer\extracted\p20\forestecosystemvaluesdata\LATEST_CHANGEURBANNOPARAMS CLEAN NO PARAMS3.py", line 5
g_ESRI_variable_1 = 'E:\\ArcGISData\\ForestEcosystemValuesData'a'
^
SyntaxError: invalid syntax

WilsonIonara_1-1680555206187.png

 

My coworkers are able to publish the geoprocessing service with no errors. What is going with my publishing? Thanks

 

 

Tags (2)
0 Kudos
2 Replies
Cristian_Galindo
Occasional Contributor III

I think we are suffering with the same issue. Are you publishing using ArcGIS pro 3.*?

0 Kudos
WilsonIonara
New Contributor III

Yes, but I tried with ArcGIS Pro 2.X also and then upgraded to 3.1.0 but I am still having the same issue. 

0 Kudos