I am having perplexing issues overwriting a feature layer that was, as recently as last week, routinely overwritten with new data without issue as a part of a large body of python code using the arcgis package. The first failure I noticed was Monday 18 November 2024. The last previous success was Tuesday 12 November, the same day of the November 2024 update to ArcGIS Online. I don't know if my overwrite occurred before or after the application of the AGOL update.
I've debugged a good deal since this popped up, and it is not exclusively a python API issue. I cannot overwrite the feature layer through the GUI either, even with the same dataset I used to successfully overwrite on 12 November or any prior. The inconsistency plus the documentation noting overwrite was included in the update and citations of other bugs with the update makes me wonder if it is something on AGOL's end. I fully acknowledge that the issue could lie with me, but my debugging hasn't lead me to this yet.
The puzzling thing is that this is only affecting one dataset; other data sources, even ones with similar schemas, are overwriting using the same code just fine. I've had no other GUI or python API overwrite problems except for this one feature layer so far.
I would try more risky delete-then-reload methods, but the hosted feature layer I am trying to overwrite has view layers and downstream layers scaffolded on top of them used in a production dashboard that I would rather not risk destroying. I have also seen a lot of suggestions (see here, here, here) suggesting replacing the overwrite process with a truncate-append method. This is all fine and well, but A) I have complex data pipelines that use Overwrite in a (usually) very stable way that I would like to keep for now, and
if this is a better way to update schema-consistent datasets, ESRI could make that implementation on their end. If they offer an overwrite option, it seems reasonable to opt to use it as is.
I have attached the GUI screenshot of the error message as well as the text of the python API error messages. I cannot share the data or feature layer itself due to data privacy constraints, but the layer in question is feeding the layers with the child care provider points on this dashboard. I can add the columns and their types too if that is useful. Any help would be welcome; many thanks.
# arcgis==1.8.5.post3, try 1
...
flcollection.manager.overwrite(csvowriteversion_path)
File "~\venv\lib\site-packages\arcgis\features\managers.py", line 1785, in overwrite
published_item = related_data_item.publish(publish_parameters, overwrite=True)
File "~\venv\lib\site-packages\arcgis\gis\__init__.py", line 10387, in publish
serviceitem_id = self._check_publish_status(ret, folder)
File "~\venv\lib\site-packages\arcgis\gis\__init__.py", line 10614, in _check_publish_status
raise Exception("Job failed.")
Exception: Job failed.
----------------
# arcgis==1.8.5.post3, try 2
Traceback (most recent call last):
File "~\venv\lib\site-packages\IPython\core\interactiveshell.py", line 3553, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-15-e4b5a6775c63>", line 1, in <module>
xstcsv.publish(overwrite=True)
File "~\venv\lib\site-packages\arcgis\gis\__init__.py", line 10387, in publish
serviceitem_id = self._check_publish_status(ret, folder)
File "~\venv\lib\site-packages\arcgis\gis\__init__.py", line 10614, in _check_publish_status
raise Exception("Job failed.")
Exception: Job failed.
----------------
# arcgis-1.9.0
...
File "~\agol_overwrite.py", line 240, in overwrite_agol_biweekly
flcollection.manager.overwrite(csvowriteversion_path)
File "~\venv\lib\site-packages\arcgis\features\managers.py", line 2036, in overwrite
if bool(self._fs.replicas.get_list()):
AttributeError: 'FeatureLayerCollection' object has no attribute 'replicas'
Traceback (most recent call last):
File "C:\Users\Alex.Cooper\Documents_Local\coding_loc\local_ssm\py_venv\venv\lib\site-packages\IPython\core\interactiveshell.py", line 3553, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-15-e4b5a6775c63>", line 1, in <module>
xstcsv.publish(overwrite=True)
File "C:\Users\Alex.Cooper\Documents_Local\coding_loc\local_ssm\py_venv\venv\lib\site-packages\arcgis\gis\__init__.py", line 10387, in publish
serviceitem_id = self._check_publish_status(ret, folder)
File "C:\Users\Alex.Cooper\Documents_Local\coding_loc\local_ssm\py_venv\venv\lib\site-packages\arcgis\gis\__init__.py", line 10614, in _check_publish_status
raise Exception("Job failed.")
Exception: Job failed.