Select to view content in your preferred language

'This layer is unavailable' message in map, but nothing wrong with layer

991
5
12-06-2022 08:58 AM
Labels (2)
RandyMcGregor3
Frequent Contributor

I published over a layer. and now the maps the layer was in are giving me this error message:

RandyMcGregor3_0-1670345653544.png

There is nothing wrong with the layer. I can open it fine. If I click on the error message it takes me to the layer - and the layer opens perfectly fine. But the map has decided to reject it. I have to reload the layer (again, works fine), symbolize it, redo the labels, etc... I had to do it all from memory because the layer was completely dead - No information available. 

We are going to have to overwrite this hosted service with some regularity. Any idea what would cause this?

Thank you,

Randy McGregor

 

5 Replies
RandyMcGregor3
Frequent Contributor

I noticed that this layer had become unresponsive in an arcade expression as well. After fighting with it for a while, I realized that the layer id had changed from 0 to 1. I changed the layer id to 1 in the arcade expression and it worked.

My guess is that this is why the layer became unresponsive in the map, even though it was still a perfectly fine feature layer. The map was "looking for" layer id 0, and the only layer in that map service now has a layer id of 1.

0 Kudos
RandyMcGregor3
Frequent Contributor

I overwrote this layer and it is now unresponsive and has to be reloaded. If anyone knows why this is happening and how to prevent it from happening, I would very much appreciate it. This workflow requires periodic updating of a hosted feature layer without disruption.

0 Kudos
EmersonCardenasSachica
Emerging Contributor

Hi.. i have the same problem... but dont understand you WHERE did you change " the layer id to 1 in the arcade expression and it worked."

please help me if you can explain where to do this!!

thanks

0 Kudos
RandyMcGregor3
Frequent Contributor

This thread explains how a feature layer can become unreadable to a map when overwritten. It has to do with the assignment of 'layer id' values, which can change if you are not careful. 

https://community.esri.com/t5/arcgis-online-questions/map-rejects-hosted-feature-layer-after-overwri...

0 Kudos
RandyMcGregor3
Frequent Contributor

This - " the layer id to 1 in the arcade expression and it worked." - pertains to data expressions created with Arcade, and is related. In the line below, the bold number is the layer id.

var features = FeatureSetByPortalItem(arcgisPortal, '7b1fb95ab77f40bf8aa09c8b59045449', 0, ['Name', 'Count'], false);

(Explained here - https://developers.arcgis.com/arcade/function-reference/portal_functions/#featuresetbyportalitem)

Because the feature layer's id changed after an overwrite  (unbeknownst to me), this failed. I had to change the "0" to "1" (the new layer id) and it worked, but this would not have been necessary if I had been careful about overwriting the feature layer in the first place.  

Long story short, keep your layer ids from changing. This really does, frankly, seem like an unnecessary complication, but it's a fact of life.

0 Kudos