Select to view content in your preferred language

Recent Failure of Using ArcGIS Online Hosted Feature Layers as Inputs in arcpy

90
0
yesterday
B_NewGE
Occasional Contributor

Hello, I have a script that has ran without failure for the last 6 months but very recently started failing. The script includes lines of code that pass in a hosted feature layer from our ArcGIS Online instance into various geoprocessing tools. Here is an example:

well_points = "https://services3.arcgis.com/7FTAucs3gO3lUZyu/arcgis/rest/services/Well_Points_Input/FeatureServer/0"
well_points_sort = r'memory/well_points_fl_sort'

arcpy.management.Sort(in_dataset=well_points,out_dataset=well_points_sort,sort_field='WellName ASCENDING')

 

As of very recently, it started failing with these errors: 

ERROR 000732: Input Dataset: Dataset https://services3.arcgis.com/7FTAucs3gO3lUZyu/arcgis/rest/services/Well_Points_Input/FeatureServer/0 does not exist or is not supported
Failed to execute (Sort)

Here's another example with a different error:

well_master_points_hosted = "https://services3.arcgis.com/7FTAucs3gO3lUZyu/arcgis/rest/services/Well_Master_Points/FeatureServer/0"

insert_field_list = [f.name for f in arcpy.ListFields(well_master_points_hosted)]

icur = arcpy.da.InsertCursor(well_master_points_hosted, insert_field_list)
with arcpy.da.SearchCursor(mem_well_master_points, insert_field_list) as cursor:
    for row in cursor:
        icur.insertRow(row)
del icur

Error code: 400

Description: Bad syntax in request. Message: Invalid URL

As you can tell, I am using the full REST URL as the input to pass in my hosted feature layer. Can I no longer use the REST URL per the October release, and if so, how can I now correctly pass in our hosted feature layers? TIA!

 

0 Replies