how to set directory to local files as input in GP Service

2787
11
07-26-2016 01:26 PM
springzhang
New Contributor II

I have the ArcGIS desktop and ArcGIS server on the same machine. The input parameters of my GP service require the directory to TIFF files, e.g., C:\inputdata\image1.tif.

I can successfully run the gp service from ArcMap. When I gave the exactly same inputs, and run the gp service from the rest endpoint, it failed with the error "invalid input parameter". How could I appropriately set the directory as inputs when running gp service from rest endpoint?

Thanks

0 Kudos
11 Replies
ModyBuchbinder
Esri Regular Contributor

Hi

Make sure the ArcGIS Server owner (owner of ArcSOC.exe process) have access to the files.

springzhang
New Contributor II

Thank  you, Mody! I granted the access permission. But, the submitted job still failed when running it from REST endpoint. No error information returned, just "failed". Do you have any idea why the gp service runs well in ArcMap, but fails immediately when running from REST endpoint? Thanks again

0 Kudos
FC_Basson
MVP Regular Contributor

Register the inputdata folder as a data store on ArcGIS Server. [About registering your data with ArcGIS Server—Documentation | ArcGIS for Server ]

springzhang
New Contributor II

Thanks!

I also did that, but did not work..

0 Kudos
ModyBuchbinder
Esri Regular Contributor

When you published a GP it copies the GP tool into C:\arcgisserver\directories\arcgissystem\arcgisinput\XXX.GPServer and change it. You can go into this directory to understand what is the different between the tool that runs in ArcMap to the tool that runs in the server (do not change anything there).

Then you can go to C:\arcgisserver\directories\arcgisjobs\XXX_gpserver - there is a directory for each run - and check temporary files and results.

These are the two best ways to debug gp services.

Have Fun

springzhang
New Contributor II

Mody, Thanks again. I checked the two folders you mentioned above, but did not find something useful. Could you explain more in detail about the exact differences between running gp service from my GIS Server connection in Catalog and running in the server?

0 Kudos
ModyBuchbinder
Esri Regular Contributor

One more comment. The server log will show any error messages from the tool. Just like the result window in ArcMap.

0 Kudos
springzhang
New Contributor II

I also checked the server log which is empty (I have enabled info-level messages of the gp service). The paragraph below on ESRI website mentioned that if the server log is empty, it indicates invalid inputs.

"If you did not receive any geoprocessing messages even after setting your message level to Info, it indicates invalid inputs. The input parameter values of the task may be malformed, partial, or invalid JSONs. You must verify the input parameter data types and their JSON values."

The GP service I tested only has two inputs: one is the directory to a TIFF file, and the other one is a number. Since I have already granted the access permission to the TIFF file, the input should not be invalid any more. So confusing why the job running gp service from Rest endpoint still failed....

0 Kudos
springzhang
New Contributor II

Hi Mody,

my gp service runs well now! Thanks for all your help. 

I changed the type of one input parameter from "GPSAGeoDataType" to "GPString", and it works now.  One more question, do you know why the directory to the TIFF file can be accepted as the input in ArcMap, while it can not be recognized in server?