I have a Python script that consumes a map service (with geometry) and puts it in a FeatureSet. (Ref. the code from this question or this question.)

for layer in layer_list:
    # generate gkey_query based on variable `layer`
    queryURL = baseURL + gkey_query # generates a valid map service URL
    feature_set = arcpy.FeatureSet()
    # do stuff with feature_set

This works as expected when executed as part of a toolbox Python script. However, when the script is then published as a geoprocessing service, it fails as follows (emphasis mine):

esriJobMessageTypeError: Traceback (most recent call last): File "\VIEW01V\arcgisserver\directories\arcgissystem\arcgisinput\CNS\DeviceQuery.GPServer\extracted\v101\devices_to_premise\procedural.py", line 215, in network_trace_group = trace_network(start_gkey, stop_gkey_list) File "\VIEW01V\arcgisserver\directories\arcgissystem\arcgisinput\CNS\DeviceQuery.GPServer\extracted\v101\devices_to_premise\procedural.py", line 158, in trace_network feature_set.load(queryURL) File "c:\program files\arcgis\server\arcpy\arcpy\arcobjects\arcobjects.py", line 175, in load return convertArcObjectToPythonObject(self._arc_object.Load(*gp_fixargs(args))) RuntimeError: RecordSetObject: Cannot open table for Load

It appears that the published service isn't able to access map services. Is this possible and I just need to modify the URL in some way, or is this something that geoprocessing services aren't able to do?

(We are still on Desktop 10.2.1; not sure what the Server version is, but I can ask if necessary.)

  • I'd do a quick test of: getting on the server machine itself, opening Server's python, and plugging in your 2,3 lines of code to make sure the server machine can communicate with the feature service. If that works, then it might be something with how the script got updated when published – KHibma Nov 22 '17 at 15:10
  • In addition to what @KHibma suggested, check if the user account that ArcGIS Server is using has access to the network. Does network traffic go through a proxy? – Berend Nov 22 '17 at 15:51
  • It's all internal, but there are plenty of firewalls around. I'll need to get the infrastructure team in order to get onto that particular box, but either the servers or the user account seem really likely. – Erica Nov 22 '17 at 15:53
  • Have you try it with FeatureServer. Instead of Mapserver use FeatureServer . – BBG_GIS Nov 22 '17 at 22:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.