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

1261
1
02-06-2019 05:55 AM
GianniContino
New Contributor III
Hi,
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:
requests.packages.urllib3.disable_warnings()

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)
    fs.load(result)
    return fs
fs_item = createFeatureSet(serviceUrl, l, bbox)
fs_item.save("in_memory\\outlyr.shp")
arcpy.MakeFeatureLayer_management("in_memory\\outlyr.shp", "outlayer")

Following error trace:

Traceback (most recent call last):
  File "myscript.py", line 85, in <module>
    fs_item = createFeatureSet(serviceUrl, l, bbox)
  File "myscript.py", line 80, in createFeatureSet
    fs.load(result)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.5\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
I tried also these snippets, but I get the same error.
Do you have any ideas?
Thanks,
Gianni
Tags (3)
0 Kudos
1 Reply
JoeBorgione
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