SharePoint – Distributed Cache – Cache referred to does not exist
Posted On December 21, 2020
You may find that certain functions within the farm that rely on Distributed Cache are not working. You review the SharePoint ULS logs and find errors like the following:
Unexpected Exception in SPDistributedCachePointerWrapper::InitializeDataCacheFactory for usage ‘DistributedBouncerCache’ – Exception ‘Microsoft.ApplicationServer.Caching.DataCacheException: ErrorCode:SubStatus:Cache referred to does not exist. Contact administrator or use the Cache administration tool to create a Cache. at Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ResponseBody respBody, RequestBody reqBody) at Microsoft.ApplicationServer.Caching.DataCacheFactory.GetCacheProperties(RequestBody request, IClientChannel channel) at Microsoft.ApplicationServer.Caching.DataCacheFactory.GetCache(String cacheName) at Microsoft.SharePoint.DistributedCaching.SPDistributedCachePointerWrapper.InitializeDataCacheFactory()’.
Unexpected Exception in SPDistributedCachePointerWrapper::InitializeDataCacheFactory for usage ‘DistributedLogonTokenCache’ – Exception ‘Microsoft.ApplicationServer.Caching.DataCacheException: ErrorCode:SubStatus:Cache referred to does not exist. Contact administrator or use the Cache administration tool to create a Cache.
Usually we see this when something went wrong with Distributed Cache provisioning. The cache service is up, but none of the caches got created.
However, it’s also possible that just a single cache (or a few) are missing. That’s why it’s important to check which caches you currently have and compare to a known-good.
You can use this PowerShell to check which caches you currently have:
Here’s an example output from a SharePoint 2019 farm:
Then you can use PowerShell to re-create the missing caches.
Each version of SharePoint has slightly different caches, so the recreation script is slightly different for each.
If you find you are just missing a few caches, the script would have to be adjusted to only recreate the missing ones.
## PowerShell DISCLAIMER:
## This script is made available to you without any express, implied, or statutory warranty,
## not even the implied warranty of merchantability or fitness for a particular purpose,
## or the warranty of title or non-infringement.
## The entire risk of the use or the results from the use of this script remains with you