Map rejects hosted feature layer after overwrite

4176
34
Jump to solution
12-21-2022 01:13 PM
RandyMcGregor3
Occasional Contributor III

I have a hosted feature layer in ArcGIS Online that I need to periodically overwrite. It appears in four maps. When I overwrite it, all layers sourced to this feature layer become disconnected with an error message 'An error occurred loading this layer.' There is nothing wrong with the layer. No fields change. The source GIS layer is the same each time (new features are swapped out for old - and that's when I need to overwrite the layer.). I reload it and reconfigure it when this happens. This is time-consuming. 

Does anyone know what causes this? I overwrite hosted feature layers regularly and this is not a normal occurrence.

Any suggestions would be appreciated. This is very disruptive to an important workflow.

Thank you,

Randy McGregor

34 Replies
MaxwellESRI
New Contributor

Hi @RandyMcGregor3,

I am Maxwell, an product engineer on the ArcGIS Online team here at Esri. I have been looking into this issue, and you are right this should not be happening. If the layers are public would you mind sharing the hosted feature layer that is having this issue. If not that is totally okay! Regardless, do you mind giving me a brief rundown on your workflow and the changes made to the HFL. Thanks!

JamesShreeve
New Contributor III

Hi @MaxwellESRI, hope you don't mind me replying to your question too. So, i've noticed the issue recently when using the "Overwrite web layer" tool in ArcGIS Pro. I work in local government so our process is to amend the feature class locally (so we have a copy outside of AGO for business systems) and then I would simply use the "Overwrite web layer" tool in Pro to then overwrite the HFL. Previously, I've had no issues whatsoever with the tool and the HFL would simply show the updated polygon shape or textual change, but now we seem to get the error message/situation that has also been explained by @RandyMcGregor3. Thank you for looking into this. If I can help at all please just let me know.

RandyMcGregor3
Occasional Contributor III

Thanks for responding Maxwell. I can't share the layer, but I think I have a clue. (FYI - Since overwriting the layer risks breaking maps I can't test it now. We know of the issue and next time we HAVE to update the layer, we know this may happen, but I can't risk it at this time.)

The issue I submitted below, which as successfully resolved, may be it, but I can't  be sure until we test. I noticed some columns were defaulting to being not visible and did not respond to being made visible. These columns are used for labelling, filtering and symbology.

https://community.esri.com/t5/arcgis-online-questions/columns-not-visible-in-hosted-feature-layer/m-...

 

0 Kudos
RandyMcGregor3
Occasional Contributor III

As far as a rundown of procedures, similar to @JamesShreeve , I have an fgdb feature class that I update regularly. I delete all old features and append in new features, then do an 'Overwrite Web Layer' from the layer in ArcGIS Pro (not from a map), then (for now) repair broken links.

0 Kudos
KateBray
New Contributor II

@MaxwellESRI  THANK YOU!! This also solved my issue, however I'd like to add my findings, so that it might help others. This is the second time this has happened to my on a deployed dashboard and Im delighted to not have to recreate the whole thing AGAIN!

Before I found this thread, I tried what worked for so many others and cleared my cache  https://community.esri.com/t5/arcgis-online-questions/existing-layers-showing-quot-error-occurred/m-... but it did not work for me.

However in doing so I believe I may have then cleared the very vital REST Layer IDs which were needed to fix these errors.  So after clearing my cache when I then overwrote the layers again, using the incorrect Layer IDs from my ArcPro, so REST services then had the erroneous Layer IDs (that matched the Layer IDs in ArcPro).

Luckily I had an old layerfile, so removed duplicate copies of the offending layers in my ArcPro map, added the old layer file and all was well again.  I have now realised that the problem occured because I had the same layers added twice to my map, and I had incorrectly used the second occurance to overwrite the web layers and not the first ones which is the Layer IDs that the REST services expected.

Hope that helps!

MaxwellESRI
New Contributor

Hi @RandyMcGregor3 and @JamesShreeve,

 

After doing some testing, I think I might have found the issue. It seems that when overwriting a web layer inside ArcGIS Pro the layer IDs are sometimes being changed regardless of unique IDs being enabled for all layers in a map project. To correct this issue from within ArcGIS Pro, first validate that "Allow assignment of Unique numeric IDs for sharing web layers" is turned on in map properties > general.

 Enable Unique IDs.PNG

Next, open up the layer properties for the web layers you are looking to overwrite. Under the general tab, validate that the Layer ID matches the Layer ID in the ArcGIS Online Rest Service.

Check_layer_ID.PNGLayer_ID_RestServices.PNG

If they do not match, change the Layer ID in ArcGIS Pro to match that of the Layer ID on ArcGIS Online. Then you should be able to overwrite the layer without breaking any links. Let me know if this resolved the issue and or if you have any more questions. We also offer overwriting hosted feature layers through ArcGIS Online. You can do this by going to the item details page for the layer, and selecting the Update Data > Overwrite Entire Layer. This will only work if the HFL is published on ArcGIS Online. This workflow won't work with ArcGIS Pro derived layers. You can read more about that here Overwrite HFL ArcGIS Online.

Thanks!

Maxwell

JamesShreeve
New Contributor III

Hi, thank you for your detailed explanation and guide. I checked my map properties and the "Allow assignment of Unique numeric IDs for sharing web layers" was ticked, so I then moved onto checking the Layer ID for the WFL in Pro and on the Rest Services. Both of these were the same, so seemed like I was going to struggle but when I checked the local copy of the data I was editing prior to using the "Overwrite web layer" tool, the Layer ID of that was different from that of the WFL. So, hesitantly I changed the Layer ID on the local copy of the data and used the tool as normal. All worked as expected! All the maps with the layer saw the updated test polygon appear with no error messages. Thank you @MaxwellESRI for your help with identifying the issue, much appreciated.

0 Kudos
RandyMcGregor3
Occasional Contributor III

The layer id in your feature class was different from the layer id of the service(layer)? That is my situation and I also changed the layer id of the feature class in ArcGIS Pro to match the hosted feature layer and am hopeful this will work. (Can't test because no budget for reconnection if that proves necessary). I think I've seen this before and forgot. It's a VERY tricky thing. If you move a layer within an ArcPro map, it might be assigned a new layer id, or it might not (??). If it is assigned a different layer id from the one it had when the layer was published originally, it gets weird fast when you overwrite. I might be having this issue with another layer that's blowing up when I overwrite it... 

0 Kudos
EmersonCardenasSachica
New Contributor II

hi maxwell .. i'm having this problem and looks that you answer can solve my problem.. but the question is... where is the " ArcGIS Online Rest Service" ... I'm logged into my arcgis online organization, enter the feature layer ... but can´t find where to see the ID layer .... (#58 in you example) ... i'm new in this so you answer will be very important to me!

thanks  ... and hope you understand me because english is not my native language.

 

 

0 Kudos
EmersonCardenasSachica
New Contributor II

the only ID I see is this in the picture .... I Have to put this long alplhanumeric ID text in the ID of the Layer in ArcGis Pro?

0 Kudos