GP service hell

4334
11
Jump to solution
10-15-2015 12:47 PM
BillChappell
Occasional Contributor II

Alright after 3 days of screwing around with this I'm stumped.

Setup, ArcSDE 10.2 on Oracle 11g... Using ArcGIS desktop 10.3.1, ArcServer 10.3. on iiS.

I've registered the SDE database and a folder \\gis01\gistemp (the folder has temp.gdb and both are open to "everyone" for read/write/modify)

In Arcmap I can make a model or python script, run it and it will work locally.  However when I publish it, it says successful but doesn't write data to either of the registered databases. If I run the service from the REST endpoint, it returns no records. If I use the service as a tool , no records.

As for code: I just created a model, dropped the buffer tool on it, had it use a FC from SDE and the output to the registered FGDB. For grins, I played with the exported Python code below, changed the connection string. The Model, both versions of the connection string work well in ArcMap. and create temp fc, however as a service they run successfully but don't create anything. I closed ArcMap, to avoid schema locks but hitting the rest service endpoint returns nothing,  I've even deleted the temp fc to avoid any conflict in using the service, I've also tried this using ArcMap on the server, without luck.

Any ideas?  

# -*- coding: utf-8 -*-

# ---------------------------------------------------------------------------

# dumbtest.py

# Created on: 2015-10-15 15:09:58.00000

#   (generated by ArcGIS/ModelBuilder)

# Description:

# None

# ---------------------------------------------------------------------------

# Import arcpy module

import arcpy

# Local variables:

DOHGIS_ESRI_COUNTY_SIMPLE = r"\\GIS01\GISTemp\dohgis@racdev (DEV).sde\DOHGIS.ESRI_COUNTY_SIMPLE"

#DOHGIS_ESRI_COUNTY_SIMPLE = "Database Connections\\dohgis@racdev (DEV).sde\\DOHGIS.ESRI_COUNTY_SIMPLE"

test = "\\\\gis01\\GISTemp\\temp.gdb\\test"

# Process: Buffer

arcpy.Buffer_analysis(DOHGIS_ESRI_COUNTY_SIMPLE, test, "300 Meters", "FULL", "ROUND", "NONE", "", "PLANAR")

.

0 Kudos
1 Solution

Accepted Solutions
BillChappell
Occasional Contributor II

After a week of troubleshooting, one fc didn't have a defined projection, although it was in the right location arcServer had a problem with it. ArcMap was more forgiving in this, once I defined a projection it worked as a service.

View solution in original post

11 Replies
VenusScott
Occasional Contributor III

I hear you Bill! I'm trying something similar and I keep getting as far as . . .

  • Invalid return value: e:\arcgisserver\directories\arcgisjobs\ptd\lastvalueused_gpserver\je8a6c767867b4c5589fa306fcdcce59b\scratch\scratch.gdb\MapTransit.GIS.BUS_STOPS_Sort
  • Failed.

I'm getting this similar error on ANY GP Service I try and run including the buffer one I've tried!

0 Kudos
GrantHerbert
Occasional Contributor II

First up, can you confirm that your ArcGIS server user actually has write access to the folder? The fact that ArcMap on the server doesn't work suggests that there may be a permissions issue there.

Can you see any output in "C:\arcgisserver\directories\arcgisoutput" on the server while the tool is running?

0 Kudos
VenusScott
Occasional Contributor III

Just piggy backing off Bill's thread here, but I have verified that the user does have permissions on our server.

0 Kudos
BillChappell
Occasional Contributor II

I verified the folder has correct permissions, For grins, I copied the input FC to the file.gdb and write the output to the same file.gdb. As a model or script it runs. As a service it says it works but does nothing. I delete the output fc before I try to run it. I also close arcmap and arcCat. After running nothing is in the folder.

I've also reinstalled ArcServer, and by putting the input and output in the same file.gdb I removed any issues that could have been in SDE.

0 Kudos
GrantHerbert
Occasional Contributor II

Could you add some debugging? (psuedo coded below)

msg = ''

# Local variables:

DOHGIS_ESRI_COUNTY_SIMPLE = r"\\GIS01\GISTemp\dohgis@racdev (DEV).sde\DOHGIS.ESRI_COUNTY_SIMPLE"

msg += str(arcpy.GetCount_management(DOHGIS_ESRI_COUNTY_SIMPLE)) + "\n"

#DOHGIS_ESRI_COUNTY_SIMPLE = "Database Connections\\dohgis@racdev (DEV).sde\\DOHGIS.ESRI_COUNTY_SIMPLE"

test = "\\\\gis01\\GISTemp\\temp.gdb\\test"

# Process: Buffer

try:

    arcpy.Buffer_analysis(DOHGIS_ESRI_COUNTY_SIMPLE, test, "300 Meters", "FULL", "ROUND", "NONE", "", "PLANAR")

except Exception, e:

     msg += str(e)

At the end add a parameter and republish the service

arcpy.SetParameterAsText(0, msg)

then any messages will be output to the results pane.

0 Kudos
ZacharyHart
Occasional Contributor III

Have you done the following?:

  1. Granted the correct permissions for the arcgis account within the RDBMS? (In MMSQL it needs at least connection permission.
  2. Created a local arcgis account (with the same credentials) on the system which you are publishing from (presuming its a desktop/ not the same devices hosting the RDBMS).
  3. Created a local arcgis account (with the same credentials) on the system where the GDB resides (if its a different location than your server install).
0 Kudos
MichaelMiller2
Occasional Contributor III

Your issues may lie where you are trying to write the output. See the documentation, http://http://resources.arcgis.com/en/help/main/10.2/index.html#/Authoring_geoprocessing_tasks_with_...

I believe you need to have the entire folder structure in one location, see example below.

,GeoProcExample.PNG

The original script is in the python folder and the script tool is in the toolbox. My input data and schema is in the Data.gdb and directing output to scratch.gdb.

Once this is published, it runs as a geoprocessing web service. Below is an example of the output on the ArcGIS Server:

ArcGISServerOutput.PNG

0 Kudos
ModyBuchbinder
Esri Regular Contributor

Hi

If you are using windows authontication in your connection files you should check that the ArcGIS Server user (the owner of SOC.exe) is defined as a user in your database.

0 Kudos
VenusScott
Occasional Contributor III

So here is what ended up with my "GP Service Hell" . . .

"I am glad to hear that your geoprocessing service is working as expected after updating the output location to be a file geodatabase as opposed to an enterprise geodatabase. As we discussed, the storage parameters of enterprise databases adds an extra period to the feature class name, which seems to cause issues for geoprocessing services. Therefore, I recommend not writing the outputs of geoprocessing services to enterprise databases."

Once I directed my output to a "scratchworkspace.gdb" on the AGS and registered the file location, I was in business!

Hope this helps someone else!