10.1 ExtractData.py script not the same as embedded Extract Data tool script

3122
11
08-07-2012 08:45 AM
GerardoGarza
New Contributor III
I have been creating services in 10.1 using geoprocessing tools created in 10.0.
One tool was based on the Extract Data Task in the Server Tools toolbox.
I ran the tool which completed successfully, but when I tried to publish results as geoprocessing service, I received the following:
Error - Code 68 - Script Extract Data contains broken project data source: gdb
Warning - Code 24032 - Data source used by Script Extract Data is not registered with the server and will be copied to the server: gdb

I then used the 10.1 ExtractData.py script to refactor the 10.0 script and received the same error.

When I ran the Extract Data Task directly from the Server Tools toolbox, it published successfully.
When I copied the Extract Data Task and script to a new toolbox, publishing failed again with the above error.
After some more research and testing, I realized that the Server Tools Extract Data was using an embedded script which was different from the Extract Data.py script in the ArcGIS\Desktop10.1\ArcToolbox\Scripts folder.

Question:  Is it possible to get copy of the functional embedded ExtractData.py script?
0 Kudos
11 Replies
GerardoGarza
New Contributor III
Hi Steffen,
Sorry for the delay in returning to this thread.  I was pulled to another project that took my attention away.

The issue lies in the strict scanning of python scripts when publishing as a geoprocessing service.  According to Authoring Geoprocessing Tasks with Python Scripts, "when your script is scanned, every quoted string (either single- or double-quotes) used in a Python variable or as an argument to a function is tested to see if it is a path to data that exists."

Line 135 in ExtractData.py is the culprit.  I changed "gdb" to "file geodatabase" so it wouldn't look like part of a path when passed to getTempLocationPath, and it published.  I'll be curious to see how the script has changed in SP1.
Hope this helps,
GG
0 Kudos
TysonSchoepflin
New Contributor II
Hi Steffen,
Sorry for the delay in returning to this thread.  I was pulled to another project that took my attention away.

The issue lies in the strict scanning of python scripts when publishing as a geoprocessing service.  According to Authoring Geoprocessing Tasks with Python Scripts, "when your script is scanned, every quoted string (either single- or double-quotes) used in a Python variable or as an argument to a function is tested to see if it is a path to data that exists."

Line 135 in ExtractData.py is the culprit.  I changed "gdb" to "file geodatabase" so it wouldn't look like part of a path when passed to getTempLocationPath, and it published.  I'll be curious to see how the script has changed in SP1.
Hope this helps,
GG


Ran into a similar issue.


Trying to share as a geoprocessing service throws the same error and warning.  Changing line 135 in the python script to "file geodatabase" does fix the error.  However, layer groups are still a problem.  Any layer group in the file is given a warning code 24032.  Along with the layer groups is another 24032 warning for "\" as shown here:  "Data source used by Script Extract Data is not registered with the server and will be copied to the server: \". 

A "flat" map file with no groups is a way to get around "copying" data to the server.  If you publish with the "\" warning, the selection box is empty and you can publish anyway.

My question is why are layer groups and "\" treated as data not on the server?  Is it required to use "flat" (no layer groups) map files to publish geoprocessing services?
0 Kudos