Geoprocessing service failed to delete existing output

2972
3
01-11-2012 01:03 AM
by Anonymous User
Not applicable
Original User: obelgrubel

Dear experts,

I created a really simple geoprocessing (just buffering some points) and publish it as Geoproc Service. I make a web app which has this geoproc.
When I run the geoproc service within web app, i get an error :


Executing (Model2): Model2 "303 Meters" Start Time: Wed Jan 11 16:57:38 2012 Executing (Buffer): Buffer xxxx.gisadmin.test_buff_pt C:\student\test_buff_pt_Buffer.shp "303 Meters" FULL ROUND NONE # Start Time: Wed Jan 11 16:57:38 2012 ERROR 000258: Output C:\student\test_buff_pt_Buffer.shp already exists Failed to execute (Buffer). Failed at Wed Jan 11 16:57:38 2012 (Elapsed Time: 0.00 seconds) Failed to execute (Model2). Failed at Wed Jan 11 16:57:38 2012 (Elapsed Time: 0.00 seconds)


The problem is the geoproc service failed to delete the existing output file (C:\student\test_buff_pt_Buffer.shp). After I delete the output file manually and run the geoproc service again, it works.. I have also redirect the output to a geodatabase and it failed too with the same error message.

Why does the geoproc service failed to delete the existing output file ??? The location of the output is the same as the location of the published mxd.
The geoprocessing model is fine when run in ArcMap without having to delete the existing outputs manually.

Here I attach the model and the geoproc settings.

Please kindly help. Thanks
0 Kudos
3 Replies
by Anonymous User
Not applicable
Original User: khibma

Its failing because Server is trying to overwrite the output which exists, but it cant (you know this).
The issue here is you should be writing your output to a unique location, not your working directory where you authored your model. Server has ways to write to a unique location (arcgisjobs directory)

I'd read this help topic: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Creating_models_for_geoprocessing_serv...
In particular, you want to look at this section: Intermediate and output data

You'll see here that Server can handle the output and put it in a location where no output exists (thus no chance for collision), by using the %scratchworkspace% inline variable.
In short, simply changing your output path from the c:\student\test___buffer.shp you have to something like %scratchworkspace%\buffer.shp, republishing or restarting the service, should make it work.
0 Kudos
obelgrubelobelgrubel
New Contributor
thanks Kevin,

you are right, i have to have '%scratchworkspace%' for my output.

Also, i like to add that to display the output of geoprocessing for web application, i need to add "P" (Model Parameter) in the output. It isnt said that I have to add "P" in http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Creating_models_for_geoprocessing_serv....
Is this correct ? It doesnt work without the "P" in the output.

thanks alot

Its failing because Server is trying to overwrite the output which exists, but it cant (you know this).
The issue here is you should be writing your output to a unique location, not your working directory where you authored your model. Server has ways to write to a unique location (arcgisjobs directory)

I'd read this help topic: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Creating_models_for_geoprocessing_serv...
In particular, you want to look at this section: Intermediate and output data

You'll see here that Server can handle the output and put it in a location where no output exists (thus no chance for collision), by using the %scratchworkspace% inline variable.
In short, simply changing your output path from the c:\student\test___buffer.shp you have to something like %scratchworkspace%\buffer.shp, republishing or restarting the service, should make it work.
0 Kudos
by Anonymous User
Not applicable
Original User: khibma

Right, anything you want a user to be able to change for input and any output you want returned to the user must be a model parameter (have the P beside it in Modelbuilder).

As a resource, I'd use this help link, its a checklist. It touches on all the main points you need and has links to more detailed help topics:
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Checklist_for_authoring_and_publishing...
0 Kudos