Trouble publishing a gp tool

5471
6
07-09-2012 09:24 AM
KevinGooss
Occasional Contributor
I have a simple python script that accepts a feature class name and a list of object ids. the script makes an sde connection with a hard-coded sde file and then exports the chosen features to a shapefile and stamps that to disk.
The tool runs fine in my python ide. The tool runs fine in Arcmap.
When i click on the results and select Share as GP service i select new service and am presented with the Service Editor dialog.
When i try to publish (or analyze) i get errors that my tool "contains broken project data source"
I'm actually getting 4 things in the Prepare are. one is High severity error with code 68 broken project data. The other 3 are high warnings with code 24032 datasource is not registered with server.

Why are there 3 warnings and an error?
I have registered this data source with ags using ArcCatalog (both normally and as an ags managed data source)
When i click on the warnings I get the Data Stores dialog and i see my registered data store. I then click Validate All and get a check.
I can do this for all 3 warnings and they are then listed as Re-Analyze. But when i analyze again they return!

When i click on the sole error message my Task is removed from the Service Editor and I am brought to the General tab. Not sure what to do there.
Am I missing something? How can I get this gp tool to publish?
Tags (2)
0 Kudos
6 Replies
KevinHibma
Esri Regular Contributor
If you havent seen this topic, give it a once over to see if anything stands out with what you're doing in your script.
http://resources.arcgis.com/en/help/main/10.1/index.html#//00570000007r000000

Could you email me your script? I'd like to see how you put it together and why the analyzer thinks you have project data that it cant find.
khibma[@]esri.com

thanks
0 Kudos
TimDine
Occasional Contributor II
...
theOutageView = r"\\theServer\ArcGISServerResources\workingConnectionFile.sde\GIS.TableName"
arcpy.TableToTable_conversion(theOutageView, arcpy.env.scratchGDB, "theOutageViewTable")
...


Script works great in python IDE and ArcMap.  Give the error 00068, Script contains broken project data source and the error 24032, Data source used by Script is not registered with the server and will be copied to the server.

I've hit this error while publishing my GP service after upgrading from 10.0 to 10.1.  Referencing this sde file has worked since 9.X and is now causing issues (as did in_memory as a workspace).  I am unable to mark this error as an exception.  Was there ever a resolution to this issue?
0 Kudos
KevinHibma
Esri Regular Contributor
Yeah...we can get you around that.

First...make sure you have sp1 installed. It fixed some script packaging problems.
Second... the 00068 error will give you what it is thats broken, by name in the analyzer window. What name is it? That'll most likely be a variable or "name" inside your script. If you do something like this to your name, it'll get around the 00068 problem (yeah, its a bit of a hack)
#original 
myVar = "something"

#new
import os
myVar = os.path.join("something")

Third...while this isn't really helpful to you now, when 10.2 is released, we've fixed many more of these issues, and you shouldnt have to do this hack.
0 Kudos
DavidMcMillan1
New Contributor II

Kevin,

I am having the same issue when using the download DDP example from the arcpy mapping team. http://www.arcgis.com/home/item.html?id=3a525b986b774a3f9cbbd8daf2435852

Not sure what I am doing wrong here, I run the script, it works great then I share as a geoprocessing service and I get the broken link error.

I am running 10.3 and using pyscripter 2.6.0

Thanks,

Dave McMillan

0 Kudos
JimDickerson
New Contributor II
I have a similar problem and tried this solution to no avail.  In my geoprocessing script I'm using an SDE connection that is on a Linux machine.  ArcMap accesses it through a network drive x: and it runs fine in ArcMap.  The service publishes to Linux with no errors but when I run it, it won't use the SDE connection, even though it is native to the server.  I look at the python script as I submitted it and the python script as it sits on the ArcGIS Server and this is what I see:
Windows:
featurepath = os.path.join('x:/ags101','Aquarius.event.sde')
featureClass = os.path.join(featurepath,'location_new')
dest_folder = 'x:/ags101/viewer'

Linux:
# Esri start of added variables
g_ESRI_variable_1 = u'x:/ags101'
g_ESRI_variable_2 = u'/home/ags101/viewer'

# Esri end of added variables
featurepath = os.path.join(g_ESRI_variable_1,'Aquarius.event.sde')
dest_folder = g_ESRI_variable_2

As you can see, the first variable is still Windows format, but the second one translates correctly.  I've tried several variations of defining the SDE connection but the result is always similar, one variable translates correctly but the other one doesn't.  Can you give me any ideas about how to use the SDE connection?
0 Kudos
BrandonFlessner
Occasional Contributor

6 years later and in Pro I'm also getting the 00068 error. My script creates an intermediate table using the in_memory workspace:

arcpy.CreateTable_management('in_memory', 'outTable')

Then the script does some things to populate the table, then copies the table. The in_memory/table triggers the "broken project data source" but the table is not a project data source. It's created by the script!! I save other intermediate outputs into the in_memory workspace as well, but these do not trigger the error.

Any ideas? So far my attempts at a work around have failed.