SharePoint 2016 – Resolving exception – SPDistributedCachePointerWrapper::InitializeDataCacheFactory – No cache hosts are present in the farm Unexpected Exception in SPDistributedCachePointerWrapper:’DistributedLogonTokenCache’ – Exception ‘System.InvalidOperationException’

Hi All,

Greetings for the day 🙂 LIFE IS BEAUTIFUL 🙂

SharePoint Migration continues 🙂 Today new issue and solution

Details:

  • We have migrated our SharePoint 2013 application to SharePoint 2016
  • We had successful migration
  • There were some issue in opening few pages so started digging into ULS logs
  • In logs found that, logs are flooded with error related to Distributed Cache Service

Error Distributed Cache exception in SharePoint log

SPDistributedCachePointerWrapper::InitializeDataCacheFactory – No cache hosts are present in the farm.              

06/03/2021 01:26:47.38               w3wp.exe (0x1868)                                       0x2260  SharePoint Foundation                         DistributedCache                            ah24w   Unexpected       Unexpected Exception in SPDistributedCachePointerWrapper::InitializeDataCacheFactory for usage ‘DistributedLogonTokenCache’ – Exception ‘System.InvalidOperationException: SPDistributedCachePointerWrapper::InitializeDataCacheFactory – No cache hosts present in the farm.     at Microsoft.SharePoint.DistributedCaching.SPDistributedCachePointerWrapper.InitializeDataCacheFactory()’.        

06/03/2021 01:26:47.38               w3wp.exe (0x1868)                                       0x2260  SharePoint Foundation                         DistributedCache                            air4g      Monitorable       Token Cache: Failed to initialize SPDistributedSecurityTokenCache  Exception: ‘System.InvalidOperationException: SPDistributedCachePointerWrapper::InitializeDataCacheFactory – No cache hosts present in the farm.     at Microsoft.SharePoint.DistributedCaching.SPDistributedCachePointerWrapper.InitializeDataCacheFactory()     at Microsoft.SharePoint.DistributedCaching.SPDistributedCache..ctor(String name, TimeSpan timeToLive, SPDistributedCacheContainerType containerType, Boolean encryptData)     at Microsoft.SharePoint.IdentityModel.SPDistributedSecurityTokenCache..ctor(String name, TimeSpan timeToLive, SPDistributedCacheContainerType containerType, Boolean encrptyData, TimeSpan minimumTokenExpirationWindow)     at Microsoft.SharePoint.IdentityModel.SPDistributedSecurityTokenCacheInitializer…

Issue :

  • While preparing SharePoint server, we have missed the configuring Distributed Cache Service on WFEs
  • Distributed cache service is not registered
  • We were not able to see the “Distributed Cache service” listed on the “Service on Server”page in Central Administration

Solution : We need to Add a WFEs to the cache cluster and starting the Distributed Cache service by using SharePoint Management Shell

  • Start the SharePoint Management Shell on WFE which we need to add to cache-cluster
  • Execute the following CMDLET
Add-SPDistributedCacheServiceInstance

What is Distributed Cache Service :

  • Distributed Cache service provides caching functionality for following features
    • Authentication
    • Newsfeeds
    • OneNote client access
    • Security Trimming
    • Page load performance
  • For more details please have a look at references at reference section

Reference :

Thanks for reading 🙂 If its worth at least reading once, kindly please like and share 🙂 SHARING IS CARING 🙂

Enjoy the beautiful life 🙂 Have a FUN 🙂 HAVE A SAFE LIFE 🙂 TAKE CARE 🙂

Prasham Sabadra

LIFE IS VERY BEAUTIFUL :) ENJOY THE WHOLE JOURNEY :) Founder of Knowledge Junction and live-beautiful-life.com, Author, Learner, Passionate Techie, avid reader. Certified Professional Workshop Facilitator / Public Speaker. Scrum Foundation Professional certificated. Motivational, Behavioral , Technical speaker. Speaks in various events including SharePoint Saturdays, Boot camps, Collages / Schools, local chapter. Can reach me for Microsoft 365, Azure, DevOps, SharePoint, Teams, Power Platform, JavaScript.

You may also like...

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: