Geoprocessing Services - Write Data to Non ArcGIS Server Location

1004
8
Jump to solution
02-18-2020 12:42 PM
LanceKirby2
Occasional Contributor II

I've searched many threads for an answer to this question, but haven't had a lot of luck. In a nutshell what I am trying to do is have a geoprocessing service run on the ArcGIS Server, but access a network file geodatabase location, retrieve data, manipulate data, and write back to that file geodatabase. I have the gdb registered with the service so I have no problem accessing or manipulating the data. However, I am running into issues writing back to the file geodatabase. I can however, write a shapefile back to the folder containing the file geodatabase with no issue.

I've just been trying to test this with some very simple code that I will attach below. The first example is writing to the folder as a shapefile which works just fine. The second example is basically the same except I am trying to write to a file geodatabase.  In the 2nd example my code will not delete the feature class when it is present. That is where it fails. If I manually delete it before I run the service, my code will fail on the copy features. (Note I am testing for the presence of the shapefile or FC and deleting it as arcpy.env.overwriteOutput does not work in Pro 2.5.) I would very much appreciate any help or suggestions!

0 Kudos
1 Solution

Accepted Solutions
JoshuaBixby
MVP Esteemed Contributor

if that account has permissions to write data to the folder containing the geodatabase, then I would assume it would have permission to write inside the geodatabase itself

Not necessarily.  The way Creator Owner permissions are commonly set on shared directories allows multiple people to create files and folders, but once someone creates a file or folder that file or folder is owned only by him/her and others cannot modify or delete it (but can commonly read it).  Try running a script that creates a new file geodatabase in the parent directory in question.

View solution in original post

8 Replies
JoshuaBixby
MVP Esteemed Contributor

It is helpful if you can post the error messages and trace backs for any Python errors and ArcPy messages for anything being returned by the service.  

0 Kudos
LanceKirby2
Occasional Contributor II

Thanks for the quick response. This is the error returned when the script tries to delete the feature class

And this is what is returned when I manually delete the feature class.

0 Kudos
LanceKirby2
Occasional Contributor II

So it looks like the service has no issue accessing the file geodatabase.. It's only when it tries to write or delete data from it that causes the problem.

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

My guess is file system permissions.  What credentials are you running GIS Server under?

0 Kudos
LanceKirby2
Occasional Contributor II

That is what I thought as well; however, I can write a shapefile or say a PDF map to the folder containing this geodatabase. It's only when I try to write/delete data inside the geodatabase that it fails. So, if that account has permissions to write data to the folder containing the geodatabase, then I would assume it would have permission to write inside the geodatabase itself unless there was some specific restrictions applied on the geodatabase itself, which I am almost certain there are not. I'm using the ArcGIS Server admin account that appears to have read write access to this location. 

 

Can write data here: \\toto\gis\_ArcGIS_PublishingProjects\_tools\widget_downloads\GpTool

Can not write here:   \\toto\gis\_ArcGIS_PublishingProjects\_tools\widget_downloads\GpTool\outSDE.gdb

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

if that account has permissions to write data to the folder containing the geodatabase, then I would assume it would have permission to write inside the geodatabase itself

Not necessarily.  The way Creator Owner permissions are commonly set on shared directories allows multiple people to create files and folders, but once someone creates a file or folder that file or folder is owned only by him/her and others cannot modify or delete it (but can commonly read it).  Try running a script that creates a new file geodatabase in the parent directory in question.

LanceKirby2
Occasional Contributor II

Wow thanks for the insight. It in fact seems to be a permissions issue. I ran a script to create a geodatabase from the server side onto the shared network location and everything is working like a charm. Of course having to run a script to create a geodatabase in this manner can be tedious so what I think needs to be done is have higher level permissions applied to the ArcGIS Server admin account. Thanks for your help Josh!

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

Yes, granting additional permissions to the GIS Server service account is what our organization does to address these kinds of situations.

Since it seems like my response answered your question, please mark one of the responses as correct to close out the thread.

0 Kudos