bpstewar

Calculate Value not working in online geoprocessing service

Discussion created by bpstewar on Jul 29, 2013
I have a tool that works in desktop and in ArcGIS Server 10.0, but is failing in ArcGIS Server 10.1. The problem is with a calculate value function that generates the proper path, but that path is not being used by the next function in the model.

Basically, the calculate value function generates a path to the desired input variable based on two arguments. The output is then spit out as a raster variable for use in a zonal stats function. The tool is pretty simple and worked on both the desktop and one the old version of server. However, with the new version of publishing in ArcGIS 10.1, it does not work.

The tool messages are provided below. I have bolded/italicized the difference between the two functions. While the second one shows the tool properly calculating the path to the data, the next command uses a different path to a dataset titled "1" in the scratch gdb.

Is this a permissions issue? Can the server not see the data in this other folder, even though that data is being used in a map service?

WORKING TOOL MESSAGE
Messages
Executing: ZonalStatsPoly "Feature Set" "Gross Domestic Product" "Indus" "SAR" C:\Users\wb411133\Documents\ArcGIS\Default.gdb\ZonalSt_8 "desktop"
Start Time: Mon Jul 29 14:32:25 2013
Executing (Calculate Value): CalculateValue getVariablePath("Gross Domestic Product", "SAR", "Indus", "desktop") "def getVariablePath (var, region, basin, desktop):\n  if var == "Annual Temperature (Celsius)":\n    variable = "ANNTEMP.img"\n  if var == "Annual Precipitation (mm)":\n    variable = "ANNPRCP.img"\n  if var == "Drought Exposure":\n    variable = "Droughts_PE.img"\n  if var == "Flood Frequency":\n    variable = "Floods_Freq.img"\n  if var == "Flood Exposure":\n    variable = "Floods_PE.img"\n  if var == "Flood Risk":\n    variable = "Floods_Risk.img"\n  if var == "Gross Domestic Product":\n    variable = "GDP.img"\n  if var == "Global Irrigated Area Mapping":\n    variable = "GIAM.img"\n  if var == "Global Map of Rainfed Cropped Area":\n    variable = "GMRCA.img"\n  if var == "DEM":\n    variable = "DEM_1k.img"\n  if desktop == "desktop":\n      return("//sdnarc/ArcData/SAWI/Regions/%s/%s/%s" % (region, basin, variable))\n  return("C:/arcgisserver/directories/arcgissystem/arcgisinput/SAWI/SAWI_%s.MapServer/extracted/cd/raster_data/%s" % (basin, variable))" "Raster Dataset"
Start Time: Mon Jul 29 14:32:25 2013
Value = //sdnarc/ArcData/SAWI/Regions/SAR/Indus/GDP.img
Succeeded at Mon Jul 29 14:32:25 2013 (Elapsed Time: 0.00 seconds)
Executing (Zonal Statistics as Table): ZonalStatisticsAsTable "Feature Set" Id //sdnarc/ArcData/SAWI/Regions/SAR/Indus/GDP.img C:\Users\wb411133\Documents\ArcGIS\Default.gdb\ZonalSt_8 DATA ALL
Start Time: Mon Jul 29 14:32:25 2013
Succeeded at Mon Jul 29 14:32:29 2013 (Elapsed Time: 4.00 seconds)
...

BROKEN TOOL MESSAGE
Server Messages
Submitted.
Executing...
Executing (ZonalStatsPoly): ZonalStatsPoly "Feature Set" "Gross Domestic Product" "Indus" "SAR" c:\arcgisserver\directories\arcgisjobs\sawi\zonalstatspoly_gpserver\je3cf16d3b97b439faee89905d6ba170d\scratch\ZonalSt_1 "server"
Start Time: Mon Jul 29 14:29:31 2013
Executing (ZonalStatsPoly): ZonalStatsPoly "Feature Set" "Gross Domestic Product" "Indus" "SAR" c:\arcgisserver\directories\arcgisjobs\sawi\zonalstatspoly_gpserver\je3cf16d3b97b439faee89905d6ba170d\scratch\scratch.gdb\ZonalSt_6 "server"
Start Time: Mon Jul 29 14:29:31 2013
Executing (Calculate Value): CalculateValue getVariablePath("Gross Domestic Product", "SAR", "Indus", "server") "def getVariablePath (var, region, basin, desktop):\n  if var == "Annual Temperature (Celsius)":\n    variable = "ANNTEMP.img"\n  if var == "Annual Precipitation (mm)":\n    variable = "ANNPRCP.img"\n  if var == "Drought Exposure":\n    variable = "Droughts_PE.img"\n  if var == "Flood Frequency":\n    variable = "Floods_Freq.img"\n  if var == "Flood Exposure":\n    variable = "Floods_PE.img"\n  if var == "Flood Risk":\n    variable = "Floods_Risk.img"\n  if var == "Gross Domestic Product":\n    variable = "GDP.img"\n  if var == "Global Irrigated Area Mapping":\n    variable = "GIAM.img"\n  if var == "Global Map of Rainfed Cropped Area":\n    variable = "GMRCA.img"\n  if var == "DEM":\n    variable = "DEM_1k.img"\n  if desktop == "desktop":\n      return("//sdnarc/ArcData/SAWI/Regions/%s/%s/%s" % (region, basin, variable))\n  return("C:/arcgisserver/directories/arcgissystem/arcgisinput/SAWI/SAWI_%s.MapServer/extracted/cd/raster_data/%s" % (basin, variable))" "Raster Dataset"
Start Time: Mon Jul 29 14:29:31 2013
Value = C:/arcgisserver/directories/arcgissystem/arcgisinput/SAWI/SAWI_Indus.MapServer/extracted/cd/raster_data/GDP.img
Succeeded at Mon Jul 29 14:29:31 2013 (Elapsed Time: 0.00 seconds)
Executing (Zonal Statistics as Table): ZonalStatisticsAsTable "Feature Set" Id c:\arcgisserver\directories\arcgisjobs\sawi\zonalstatspoly_gpserver\je3cf16d3b97b439faee89905d6ba170d\scratch\1 c:\arcgisserver\directories\arcgisjobs\sawi\zonalstatspoly_gpserver\je3cf16d3b97b439faee89905d6ba170d\scratch\ZonalSt_2 DATA ALL
Start Time: Mon Jul 29 14:29:31 2013
ERROR 000865: Input value raster: c:\arcgisserver\directories\arcgisjobs\sawi\zonalstatspoly_gpserver\je3cf16d3b97b439faee89905d6ba170d\scratch\1 does not exist.

Outcomes