1

I often create maps in AGOL with data from sources outside AGOL that is eventually updated either manually, as the result of some revised or extended analysis or simply upon receiving new data from a client.

Most of the time I can pull the new data into ArcGIS Pro and use the share>> overwrite feature layer options to republish the data in the same place. This is great because the update then passes through to any maps pulling from the hosted feature layer automatically.

Maybe 1/3 of the time though, the connection is broken and the map then shows an error Unable to establish a secure HTTPS connection to the layer. The layer, "Layer Name", cannot be added to the map.

Looking at the network activity and browser console, the site is looking for:

"https://services6.arcgis.com/ID-string/arcgis/rest/services/Feature_layer_name/FeatureServer/40"

but the current url of the data source is:

"https://services6.arcgis.com/ID-string/arcgis/rest/services/Feature_layer_name/FeatureServer/42"

where the index number at the end of the url string has changed since the update.

In some cases, I think adding or removing an attribute column is clearly to blame for the disconnect, but in other cases it seems random as only attribute values, and not even the feature count or the geoms themselves have changed.

Does anyone have info or a resource for better understanding this behavior?

Is there a better way to update hosted feature layer data? Even a warning message during the "Analyze" step of republishing would be helpful to anticipate whether a data update will require a map rebuild.

1
  • My preferred workflow for this is to make any schema/field changes directly on the hosted feature layer while simultaneously developing your new data set concurrently. You can then upsert the new dataset over the old or completely truncate the hosted feature service and upload a completely new dataset matching the schema. Nov 22, 2023 at 19:18

2 Answers 2

0

A tentative answer that I haven't had time to test

https://community.esri.com/t5/arcgis-online-questions/map-rejects-hosted-feature-layer-after-overwrite/m-p/1243099#M49472

the key is that there is a "layer id" value in the general setting of a layer that is (as far as I've checked so far)

Setting that to match the layer id of the hosted feature layer being overwritten may solve this broken link problem.

enter image description here

0

Thank you so much for posting this question and your potential solution. I've been banging my head off the wall for a while trying to figure out why this keeps happening. Your suggestion worked perfectly!

I have been struggling with this issue the past few months and didn't know why my layer kept breaking. I didn't know the Layer ID was a setting in the layer properties in Pro.

Here's an overview of my process that was causing my issue, in case it helps anyone else out:

  • Every month I would run a model builder tool to update a layer.
  • After running the model, several layers would be added to the map display so I could double check things looked correct.
  • Before updating the service, I would remove all layers except the one web layer that I wanted to update.
  • When I would open the webmap containing this layer in AGOL, I was often getting this error: “Unable to establish a secure HTTPS connection to the layer. The layer, "Layer Name", cannot be added to the map.”

I wasn’t sure why this kept happening. The service looked exactly the same in Pro when I would publish it (the same as it originally looked in ArcMap when I created the original service) with only one single layer in the map. However, based on your tentative answer I’ve now learned that Pro functions slightly differently than ArcMap when it comes to the Layer ID that shows up in the web service.

In ArcMap, the Layer ID for the published service is determined by the order of the layers in the table of contents. It doesn’t matter when layers are added to the map or if they’re removed from the map, as long as they are in the correct order at the time of publishing. However, the Layer ID in Pro is controlled and specified in the Layer Properties for each layer. As each layer is added to the map, it is assigned an incremental ID that stays the same regardless of whether layers are rearranged in the table of contents.

Generally, if you’re just opening an old map and republishing, you shouldn’t run into this issue. However, if you’re doing any work or rearranging layers in your map before overwriting a web layer, it might be worth double checking the Layer IDs match your existing service before republishing.

Thanks again for helping with this solution!

1
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Jan 5 at 15:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.