Hi everyone. I am trying to update/overwrite a hosted feature layer in ArcGIS Online through Python using 'manager.overwrite' but it doesn't work, I even tried to overwrite it manually with the source '.csv' file without success, apparently the element has some kind of error or lock that prevents to perform this action. It also does not work if I run the task several times.
The errors are shown below:
Note 1: The element works properly for months, after a while this happens. This is the second time it happens.
Note 2: It also does not work if I enable the edit option in advanced options of the element.
Note 3: This element also has no pending replicas.
Solved! Go to Solution.
Hello everyone, it looks like we've found a solution.
We updated the "description" parameter with "Shape Index" in the table's JSON, specifically in the spatial index section, and it is now working correctly.
Before:
After:
This is the code we used for the solution:
from arcgis.gis import GIS
from arcgis.features import FeatureLayer
import pandas as pd
# URL del servicio de entidades
service_url = url
# Conectar a ArcGIS Online o Enterprise (en este caso, sin autenticación)
gis = GIS("https://www.arcgis.com", user, password)
# Crear un objeto FeatureLayer
layer = FeatureLayer(service_url)
description = layer.properties["indexes"]
description[1]["description"] = 'Shape Index'
print(layer.properties["indexes"][1])
layer.manager.update_definition({"indexes": description })
Best regards.
Hi there, I apologize that you are running into this issue with overwrite. If you could please share more details on your workflow. It would be great help for trying to resolve this issue that you are seeing. From you post, I see that you mentioned this occurs after multiple overwrites, is this correct? We just made changes to overwrite for the most recent release and want to make sure that this isn't a new issue for you. Thanks!
Hi @MaxwellDebellaESRI , yes, it apparently occurs after several overwrites. Below is the workflow we follow and the errors that have appeared.
This service has been overwritten automatically every 6 hours for approximately a year using a script. We process a CSV file, point to the item, and overwrite it using collection.manager.overwrite(csv), as shown in the image.
Currently, when trying to overwrite the service, the following error appears:
We attempted to overwrite it manually from ArcGIS Online by directly uploading the CSV file, but the process keeps loading indefinitely without completing the action.
When reviewing the attribute table in ArcGIS Online, we observed the following:
We also tried using the Append tool by spatializing the table and attempting to add it to the existing layer, but we got the following result:
Hello everyone, it looks like we've found a solution.
We updated the "description" parameter with "Shape Index" in the table's JSON, specifically in the spatial index section, and it is now working correctly.
Before:
After:
This is the code we used for the solution:
from arcgis.gis import GIS
from arcgis.features import FeatureLayer
import pandas as pd
# URL del servicio de entidades
service_url = url
# Conectar a ArcGIS Online o Enterprise (en este caso, sin autenticación)
gis = GIS("https://www.arcgis.com", user, password)
# Crear un objeto FeatureLayer
layer = FeatureLayer(service_url)
description = layer.properties["indexes"]
description[1]["description"] = 'Shape Index'
print(layer.properties["indexes"][1])
layer.manager.update_definition({"indexes": description })
Best regards.