featureLayerCollection overwrite "Job failed"

1843
1
01-15-2020 05:48 AM
LenBalthis
New Contributor II

Hi. I am trying to update/overwrite a hosted feature layer, following the logic given near the end of a tutorial on learn.arcgis (Update Real-Time Data With Python). It uses the following to overwrite the feature layer:

# Replace file
manager = arcgis.features.FeatureLayerCollection.fromitem(item).manager
status = manager.overwrite(updated_sd)

Everything else is working except this step, which returns an error:

status = manager.overwrite(updated_sd)
Traceback (most recent call last):

File "<ipython-input-45-b7a0406a969f>", line 1, in <module>
status = manager.overwrite(updated_sd)

File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\features\managers.py", line 1269, in overwrite
published_item = related_data_item.publish(publish_parameters, overwrite=True)

File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py", line 8780, in publish
serviceitem_id = self._check_publish_status(ret, folder)

File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py", line 9007, in _check_publish_status
raise Exception("Job failed.")

Exception: Job failed.

I have found a couple of relevant threads about this, one says it's a bug (Phil Larkin, Dec. 12, 2018 2:31PM:

This is in fact associated with the bug. The severity is logged as low.

BUG-000115253: When using the overwrite method from arcgis.features.managers.FeatureLayerCollectionManager, ArcGIS API for Python returns the error "Exception: Job Failed.''

BUG-000115253: When using the overwrite method from arcgis.features.. 

Another thread (very last comment) says:

While I was trying these solutions, I was simultaneously working with ESRI Support, and we came up with a different workflow which publishes a new SD file. That is working well, so I won't need to pursue this solution, though it appears it would be a simpler script.

Can anyone point me to a workaround, or the 'different workflow which publishes a new SD file' referred to here?

Thanks,

Len

1 Reply
by Anonymous User
Not applicable

I ran into this error and eventually worked out it's because the Feature Layers I'm wanting to overwrite have outstanding replicas present. Once I unregistered the replicas it worked.

0 Kudos