Recently I have been working with a fairly large SharePoint 2013 farm hosted on Azure platform. This platform uses an external authentication provider to authenticate users visiting the public facing website.

Updated this post here http://wellytonian.com/2015/01/sharepoint-2013-distributed-cache-timeout-issue-resolved/

Symptoms:

  • Users who have passed the login page and authenticated by the provider would get kicked back to the login page while browsing through the pages.
  • Those users also noticed that the page didn’t seem to load properly especially images on the page – it seemed as if the web requests to the Azure Load Balanced Web Front Ends didn’t seem to complete and the page hasn’t loaded properly.

ULS logs:

1
2
3
4
5
6
7
01/30/2014 01:19:43.69 w3wp.exe (SHAREPOINT_SERVER:0x2180) 0x3F34 SharePoint Foundation DistributedCache air4a Monitorable Token Cache: Failed to get token from distributed cache for 'EXTERNAL_PROVIDER|USER_ACCOUNT'.(This is expected during the process warm up or if data cache Initialization is getting done by some other thread).

01/30/2014 01:19:43.69 w3wp.exe (SHAREPOINT_SERVER:0x2180) 0x3F34 SharePoint Foundation DistributedCache air4b Monitorable Token Cache: Reverting to local cache to get the token for 'EXTERNAL_PROVIDER|USER_ACCOUNT'.

01/30/2014 01:19:43.69 w3wp.exe (SHAREPOINT_SERVER:0x2180) 0x2C18 SharePoint Foundation DistributedCache air4a Monitorable Token Cache: Failed to get token from distributed cache for 'EXTERNAL_PROVIDER|USER_ACCOUNT'.(This is expected during the process warm up or if data cache Initialization is getting done by some other thread).

01/30/2014 01:19:43.69 w3wp.exe (SHAREPOINT_SERVER:0x2180) 0x2C18 SharePoint Foundation DistributedCache air4b Monitorable Token Cache: Reverting to local cache to get the token for 'EXTERNAL_PROVIDER|USER_ACCOUNT'.

Resources Used:

  • Much credits to Jason Warren for his post found here DCache Issues Fix Post . This post was pretty much the Bible for fixing this issue. I would like to carry on from this post and point out where the ‘Garbage’ handling addition to the Dcache Config file had issues and how to fix it.
  • KB Article for this fix can be found here
  • Premier Support Folks – Many thanks guys !

Resolution:

  1. Stop Distributed Cache on the specific Distributed Cache servers within your SharePoint farm. This can be done via PowerShell or Central Admin. Make sure the service is stopped by checking under Services Tab on the server.
  2. Download the CU4 (at the point of writing this post) for AppFabric from AppFabric CU4 .
  3. Install the update on all the SharePoint servers within your farm.
  4. Restart the farm.
  5. Verify that the update is installed from the Installed Updates tab on the servers.
  6. Increase the SPDistributedCacheClientSetting by running the following piece of script
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    Get-SPDistributedCacheClientSetting -ContainerType DistributedLogonTokenCache

    $DLTC = Get-SPDistributedCacheClientSetting -ContainerType DistributedLogonTokenCache
    $DLTC.maxBufferPoolSize = "1073741824"
    $DLTC.maxBufferSize = "33554432"
    $DLTC.requestTimeout = "3000"
    $DLTC.channelOpenTimeOut = "3000"
    $DLTC.MaxConnectionsToServer = "100"
    Set-SPDistributedCacheClientSetting -ContainerType DistributedLogonTokenCache $DLTC
    Restart-Service -Name AppFabricCachingService
  7. Increase the SecurityTokenService Config by running the following piece of script ( we had to increase these numbers later on)
    1
    2
    3
    4
    $sts = Get-SPSecurityTokenServiceConfig
    $sts.MaxServiceTokenCacheItems = "1500"
    $sts.MaxLogonTokenCacheItems = "1500"
    $sts.Update()
  8. The next piece of change is to “DistributedCacheService.exe.config” found here “C:\Program Files\AppFabric 1.1 for Windows Server“. If using your Text Editor to modify this file, make sure you open the application in administrator mode to edit this file, most likely get access denied to open the file if not 🙂
  9. Make sure the following text :
    1
     

    Is placed here as shown with the config file. Any other placement of this line within the config file will result in AppFabric Service showing as stopped and not wanting to start inspite of showing as Started within CA.

  10. Start the Distributed Cache either via PowerShell or CA.
  11. Fingers crossed this would have solved your problem.

Cheers