Select to view content in your preferred language

Did the November 2024 AGOL Update Introduce an Overwrite Bug?

3291
12
Jump to solution
11-19-2024 01:04 PM
JACooper
Regular Contributor

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 B) 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.

 

Tags (1)
0 Kudos
12 Replies
Ian-Horn
Emerging Contributor

Not sure of your status on this, but before I nailed down the metadata issue, I placed an unzipped file geodatabase on S3 and then used ESRI Data Pipelines on AGOL and that successfully overwrote the data for the feature service.  It was a band-aid I wasn't happy about because the process takes about 45 minutes, same in pro, and would cost us about 50 credits every time we run it.  Burning credits wasn't necessarily the issue, but it was solution where we didn't need credits before. 

 

0 Kudos
JACooper
Regular Contributor

Update: I was having no luck solving my original problem, so I sucked it up and tore down the "corrupted" layer and its children sourcing my dashboard, loaded new data, tested that it would overwrite okay, generated hosted layers and secure services, and plugged those back in to my dashboard's maps and widgets. I called this a one-off overwrite() issue that was fixed with a new layer and moved on. 

I ran my data pipeline code again (sourcing overwrite() from arcgis v1.3.5.post3) today and was displeased to see another, similar-but-new error. 

Traceback (most recent call last):
...
  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 1785, in overwrite
    published_item = related_data_item.publish(publish_parameters, overwrite=True)
  File "~\venv\lib\site-packages\arcgis\gis\__init__.py", line 10384, in publish
    elif not buildInitialCache and ret[0]['type'].lower() == 'image service':
KeyError: 'type'

 This error comes from a similar spot in the arcgis code to my original post, so I dug more. 

The good news is that I have solved some of the mystery: errors arise from from trying to overwrite a base feature layer which has a hosted feature layer view downstream with a spatial filtering bounding box applied. Example below. I had a few points outside my area of interest, so I figured I could use this HFLV feature to focus my layer. I cannot remember when I set this feature, so I can't rule out that it wasn't the November 2024 that introduced changes here.

JACooper_0-1733881772308.png

I loaded the same CSV used to supply my dashboard into AGOL and published it as fresh feature layers, created spatially filtered HFLVs downstream, and ran into my original issue. First time I was able to duplicated the original issue. When this bounding box was removed, I was able to overwrite in the GUI successfully. However, 1) I was no longer able to edit the HFLV's bounding box (see image below), and 2) the fix did not work for my main layer sourcing the public, production dashboard (naturally). Not being able to edit the bounding box again after it was tweaked once is consistent with my original issue and left me unable to test more then. 

JACooper_1-1733882107453.png

When I try to overwrite my primary feature layer now, I no longer get the same "failed" message in the GUI like the screenshot in the original post. I get a success message, but nothing happens; no features are added or deleted. The old record counts and table data remain. The data also don't record as being updated in the timestamp. It's like my overwrite command never happened without any notice of failure. No clue why this isn't matching my test FLs that I was able to fix with the spatial filtering rollback.

When I try with python, I continue to get the type publishing message above. There are several resources on addressing this out there (see here, here, here, here, to cite a few), but most of these are regarding the original .publish() method in the arcgis package, not that functionality embedded in .overwrite()

I'm back where I started with a feature layer that can't be overwritten sourcing a production dataset, only I know a tear-down, build-back solution won't solve the root problem. Any help here is welcome.  

0 Kudos
JACooper
Regular Contributor

Update 2: I raised this issue as a technical support case (Case #03801309) with ESRI. They were able to reproduce and document the issue. It was found as a preexisting bug, BUG-000172493. This was submitted after the November 2024 update of AGOL and was reproducible on that version.

Turns out, the key issue was that my feature layer had an associated hosted feature layer view with a spatial filter, as I noted in update 1. The known bug states this as a limitation of AGOL:

Overwriting a hosted feature layer in ArcGIS Online fails if the layer has a joined view or a view with an area of interest defined.

This isn't very satisfying, and I do not know whether ESRI will plan to patch this bug. But, to answer my own question posed here, yes, the November 2024 AGOL update introduced an overwrite bug for feature layers with associated hosted feature layer views with spatial filters. If I learn anything more about planned fixes, I will update this post.

0 Kudos