RecordSetObject: Cannot open table for Load (un-secured host)

02-06-2019 05:55 AM
New Contributor III
I'm experiencing an issue about FeatureSet Load method: the error is RuntimeError: RecordSetObject: Cannot open table for Load
The service I'm requesting is on an unsecured host and I'm using a specific context to workaround:

os.environ['PYTHONWARNINGS']="ignore:Unverified HTTPS request"

This is my simple code:
def createFeatureSet(serviceUrl, layerId, bbox):
    fsURL = buildUrl(serviceUrl, layerId,bbox)
    fs = arcpy.FeatureSet()
    result= urllib.urlopen(fsURL, context = ctx)
    return fs
fs_item = createFeatureSet(serviceUrl, l, bbox)"in_memory\\outlyr.shp")
arcpy.MakeFeatureLayer_management("in_memory\\outlyr.shp", "outlayer")

Following error trace:

Traceback (most recent call last):
  File "", line 85, in <module>
    fs_item = createFeatureSet(serviceUrl, l, bbox)
  File "", line 80, in createFeatureSet
  File "C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\arcobjects\", line 175, in load
    return convertArcObjectToPythonObject(self._arc_object.Load(*gp_fixargs(args)))
RuntimeError: RecordSetObject: Cannot open table for Load
I tried also these snippets, but I get the same error.
Do you have any ideas?
Tags (3)
0 Kudos
1 Reply
MVP Emeritus

We have a script that worked just fine until yesterday and we're getting that same error. I 'ported' it over to python 3.x which entailed changing the print statements to print() functions.  We originally imported urllib2 but it's no longer; after a google search, I found urllib.request has a .urlopen() method.

Bottom line, after making the changes and executing as a 3.x script, it still fails with the same error as the 2.x script does...  Sigh....

That should just about do it....
0 Kudos