Esri / overwrite-hosted-features

The Transportation 511 Script is used to keep the contents of a Feature Collection up to date. Please see
http://links.esri.com/stategovernment/help/transportation511
Apache License 2.0
7 stars 5 forks source link

Overwriting feature service fails on Portals #19

Closed jessnoo closed 6 years ago

jessnoo commented 6 years ago

Repro Steps:

  1. Stand up a feature service and feature collection pair on a portal using data store
  2. Configure the overwrite script against the portal items
  3. Run script: Receive error Failed to update Transportation511 feature service: {u'services': [{u'success': False, u'error': {u'message': u"Service name 'Transportation511' already exists for '0123456789ABCDEF'"}}]} image

Resources: Transportation 511 sample data One of the public portals the dev team maintains

@NikkiGolding @jmhauck fyi

jessnoo commented 6 years ago

this was originally discovered during 10.6 certification testing.

jmhauck commented 6 years ago

I have been able to reproduce the issue and have seen it occur across multiple versions of Portal (10.6, 10.5.1, and 10.5). The issue occurs when we call publish to update the feature service. This call is supposed to overwrite the existing service.

I cannot reproduce the general issue when I go through a similar workflow of overwriting the service by uploading a new file geodatabase directly in the portal home app. I also cannot reproduce the general issue when I overwrite a web layer directly from Pro against the same portal. In the process of following up with development on this to see if they can help us get to the bottom of it as well as closely reviewing the network traffic differences between the workflows that are succeeding vs the one that fails.

jmhauck commented 6 years ago

@jessnoo ready to be verified

jmhauck commented 6 years ago

@NikkiGolding @jessnoo This does boil down to a difference in how things are handled internally between Enterprise and AGOL. For the overwrite flag to be honored on the Enterprise side it expects a relationship to exist between the Field Geodatabase and the Feature Service. This relationship is generated automatically when a user uploads a file geodatabase and allows the system to generate the service. AGOL on the other hand does not require this relationship to exist. Therefore, we see the difference between the two environments.

The commit above adds a step that will now always check if this item relationship exists and if not it will add it. This will now occur on both Enterprise and AGOL.

jmhauck commented 6 years ago

This is the portal issue that was logged: https://devtopia.esri.com/WebGIS/arcgis-portal-services/issues/7266

jessnoo commented 6 years ago

verified on 10.6 portal