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 Microsoft 365 Junction, Speaker, Author, Learner, Developer, Passionate Techie. Certified Professional Workshop Facilitator / Public Speaker. Believe in knowledge sharing. Around 20+ years of total IT experience and 17+ years of experience in SharePoint and Microsoft 365 services Please feel free me to contact for any SharePoint / Microsoft 365 queries. I am also very much interested in behavioral (life changing) sessions like motivational speeches, Success, Goal Setting, About Life, How to live Life etc. My book - Microsoft 365 Power Shell hand book for Administrators and Beginners and 100 Power Shell Interview Questions - https://www.amazon.in/Microsoft-Administrators-Beginners-Interview-Questions/dp/9394901639/ref=tmm_pap_swatch_0?_encoding=UTF8&qid=1679029081&sr=8-11

You may also like...

Leave a Reply

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