Hello all. I am not sure if this is a python question or an ArcGIS Online question, but my feeling it's more the layer.
I am using the ArcGIS for Python API to update a hosted feature layer. I developed this tool quite a few months ago and has run like clock work. This week, I am experiencing an error that isn't making much sense since the tool has always worked. The error is:
Traceback (most recent call last):
pwr.publish(overwrite=True, file_type='fileGeodatabase')
Exception: Unable to analyze item.
Item type'url' is not supported for anzlyzing, The item needs to be of type file
(Error Code: 400)
My code basically takes a zipped geodatabase and updates the hosted feature layer based on the Item ID:
from arcgis.gis import GIS
import os
def updateAGOData():
gis = GIS("myoraganizationURL", agol_username, agol_password)
dataLoc = r"C:\data"
arcpy.AddMessage("Connected to ArcGIS Online...")
PWR_item = os.path.join(dataLoc, "zip_file\Data.zip")
pwr = gis.content.get('cf755f973b4a4f19a0e2e80425d30188')
pwr.update({}, PWR_item)
pwr.publish(overwrite=True, file_type='fileGeodatabase')
arcpy.AddMessage("Hosted Feature Layer Updated...")
updateAGOData()
Now, to answer a few questions:
- The code has not changed since last fall
- The geodatabase has not changed at all.
- the Item ID has not changed at all
- My organizations URL has not changed at all
- The path to the data has not changed.
Like, nothing has changed at all. I have the the script running on a task scheduler daily for months now and it has never failed until now.
I tested to make sure the zipped geodatabase isn't the issue by manually updating the hosted feature layer and that works fine. The hosted feature layer gets updated.
The message is cryptic to me:
Item type'url' is not supported for anzlyzing, The item needs to be of type file
The error throws when when the script sets to the 'Update' method and yes....it legitimately prints out 'anzlyzing'...🤔
There is an older post mentioning the same issue with no solution: https://community.esri.com/t5/arcgis-api-for-python-questions/item-type-url-is-not-supported-for-anzlyzing/m-p/862864