6

I created and published a geoprocessing service from a toolbox. It works with a file geodatabase on my local drive. When run as a tool in ModelBuilder, it worked well and wrote data into the file geodatabase perfectly. However, when I published it as geoprocessing service and triggered it via REST service, it wrote data into the scratch.gdb in the job directory on the ArcGIS Server directories.

How can I configure the tool/model, or service or arcgis server to make it work with the original file geodatabase instead of the scratch file geodatabase?

1 Answer 1

3

To avoid situations like these, I rework my toolbox until I am satisfied with it, copy it to a shared folder on the AGS machine and publish the service from there, making sure that model's scratch gdb is referenced in the environment settings correctly.

You should also register the gdb with ArcGIS Server. Anecdotally, I've found this process to be hit-and-miss; half of my gdbs get copied over to the local Server directories because "it's not registered", even though it is. This should not be such a big problem though.

If you would like the user to input the file gdb to be used, add that as a model parameter and make sure all your internal tools point to that variable so that all outputs will be written there.

7
  • Thanks Arabella. I actually has already point my both current and scratch workspaces to the correct file geodatabase on the model level. Also, I disabled using Intermediate data in the model so all intermediate data is written in the file geodatabase and overwrite is enabled. I reran and republished the model as geoprocessing service, but it didn't make any difference at all... ... By the way, file geodatabase cannot be registered with ArcGIS Server 10.1.
    – alextc
    Jul 24, 2013 at 5:50
  • I have registered the folder where the file geodatabase is. If I registered that folder, were all sub-folders within automatically registered?
    – alextc
    Jul 24, 2013 at 23:42
  • Any tips? I'm still struggling with it :(
    – alextc
    Jul 25, 2013 at 23:50
  • I was hoping you wouldn't have this problem, because we have the same issues but we just assumed it was something we were doing because our server setup is slightly wonky. When publishing the service, does it prompt you that it will copy everything to the server? From my experience sub-folders inside a registered folder are sometimes included, sometimes not :-/ Jul 26, 2013 at 4:54
  • Worst case scenario, I'm thinking you will have to to set your overwrite environnment settings to True, and then add a Copy process to the end of the model which will then output your result into the file gdb you choose. It's a workaround I know, but I've had to do something similar before when there just isn't time to figure out why it's not working when you have followed all the steps exactly. Jul 26, 2013 at 4:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.