Intermittent Azure cache error: “Cache referred to does not exist. Contact administrator or use the Cache administration tool to create a Cache.”

StackOverflow https://stackoverflow.com/questions/16817121

  •  30-05-2022
  •  | 
  •  

Question

We have a deployment which has been using a cache role for a while (with no real issues), and to which we have recently added a colocated cache on one instance.

Since we have added this colocated cache we have started to occasionally see this error:

ErrorCode<ERRCA0009>:SubStatus<ES0001>:Cache referred to does not exist. Contact administrator or use the Cache administration tool to create a Cache.

when we are accessing the cache in the cache role but this seems to then go away almost immediately and everything is ok again for a while until this issue returns.

It seems unlikely that the cache does not exist, as it has been working and then starts working again very quickly afterwards, so what could the problem be?

EDIT to add a bit more detail.

We have 2 caches. 1 is a dedicated cache role which holds some response data, shared between web and worker roles, several instances use the cache (probably about 10). 1 is a co-located cache on 1 web role (2 instances) which holds some small ids that this role alone needs.

We think the issue may be related to the fact that both caches are configured to use the same storage account in the Microsoft.WindowsAzure.Plugins.Caching.ConfigStoreConnectionString value, and they seem to overwrite each others changes.

This is the config from the role which uses both caches:

<dataCacheClients>
<dataCacheClient name="binaryConfig">
  <autoDiscover isEnabled="true" identifier="CacheRole" />
</dataCacheClient>
<dataCacheClient name="request-ids">
  <autoDiscover isEnabled="true" identifier="Api" />
  <localCache isEnabled="true" sync="TimeoutBased" objectCount="100000" ttlValue="300" />      
</dataCacheClient>

and we just create a cache client by doing

new DataCache(cacheName, clientConfigurationName)

Then calling Get and Put etc

Était-ce utile?

La solution

So I think this is a bug in the 1.7 SDK where if 2 caches are configured to use the same storage account to store their configuration then each instance seems to overwrite the other instances config, so you get the config of the last one to run. If we reboot one role the the config contains that roles config, and if we then reboot the other role then we get that roles config. Changing each cache to use a separate storage account seems to fix the issue.

Autres conseils

In my case this seem to happen because I had 2 roles in one azure project with different named caches (one role 4 named caches, the other role just 1 named cache). It happend that the cacheConfig.xml in my cacheclusterconfigs blob (storage account associated with the co-located cache) got overridden - it seems that for one deployment only one named cache configuration for all roles is allowed.

So I guess the same thing happend as in your case.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top