Select to view content in your preferred language

How to use AGS's datastore when publishing a geoprocessing ?

470
1
01-11-2021 09:00 AM
Raphiki
Emerging Contributor

I've a geoprocessing (created with Arcmap 10.5) which basically connect to a datasource, extract data with a cursor and return it as JSON.

At development step I setup my source as following:

SdeObject = "Database Connections\\xy_source.sde\\xy_database.xy_schema.xy_table"

It works because, as far as I understand, the String "Database Connections" is a shortcut for my catalaog.

Then I publish my geoprocessing as a Geoprocessing Service on a Arcgis Enterprise federated server (v10.7). It publishs without error, but when I execute my job I got the following error without many surprise.

Error executing tool. Tool Job ID: jdf738x90a0b14793ac47ce44cd99a0df : Traceback (most recent call last): File "<string>", line 127, in execute File "<string>", line 38, in run File "q:\esri\server\arcpy\arcpy\management.py", line 6986, in MakeFeatureLayer raise e ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Input Features: Dataset Database Connections\xy_source.sde\xy_database.xy_schema.xy_table does not exist or is not supported Failed to execute (MakeFeatureLayer). Failed to execute (Tool). Failed to execute (Tool).

The xy_database is already configured as datastore on my AGS with the same user, but I guess it is not accessible from "Database Connections" alias...

So, what is the recommanded way to publish a geoprocessing, in order to use AGS's already configured datastore?

0 Kudos
1 Reply
DavidPike
MVP Frequent Contributor

Seems strange.  Perhaps try adding that specific connection file into the registered datastores if different schemas are being referenced, but that's more of a random guess!  And if there's no data source reference errors on Analyze before publishing it very likely won't help.

Could you share more of the code? Would be good to see where it failed on MakeFeatureLayer

0 Kudos