SharePoint Publishing Cache Manager has Timed Out

After making a change in TokenTimeout value today, all publishing sites started throwing error with Correlation ID. ULS logs showing several error messages as shown below in red text.

System.ArgumentOutOfRangeException: The added or subtracted value results in an un-representable DateTime. Parameter name: value

at System.DateTime.AddTicks(Int64 value)

at Microsoft.SharePoint.Publishing.CacheManager.HasTimedOut()

OR

System.ArgumentOutOfRangeException: The added or subtracted value results in an un-representable DateTime. Parameter name: value

at System.DateTime.AddTicks(Int64 value)

at Microsoft.SharePoint.Publishing.CacheManager.HasTimedOut()

at Microsoft.SharePoint.Publishing.CacheManager.GetManager(SPSite site, Boolean useContextSite, Boolean allowContextSiteOptimization, Boolean refreshIfNoContext)

at Microsoft.SharePoint.Publishing.Internal.WebControls.PublishingRibbon.OnLoad(EventArgs e)

OR

Getting Error Message for Exception System.Web.HttpUnhandledException (0x80004005): Exception of type ‘System.Web.HttpUnhandledException’ was thrown. —> System.ArgumentOutOfRangeException: The added or subtracted value results in an un-representable DateTime. Parameter name: value

Resolution#1

Check if time zone for each web application in General Settings is same as your server time zone. Update time zone if nothing selected, run IISRESET and check if the issue is resolved.

Resolution #2

Check value of WindowsTokenLifetime , LogonTokenCacheExpirationWindow and TokenTimeout using the PS script below.

Trouble maker in this case was TokenTimeOut value set to a very small value.

Add-PSSnapin microsoft.sharepoint.powershell
$mysts = Get-SPSecurityTokenServiceConfig
$mysts.WindowsTokenLifetime
$mysts.LogonTokenCacheExpirationWindow
$TT = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$TT.TokenTimeout

If values are any different than default values, use the script below. Script will set these 3 values to its default.

$mysts = Get-SPSecurityTokenServiceConfig
$mysts.WindowsTokenLifetime =(New-TimeSpan -Hours 10)
$mysts.LogonTokenCacheExpirationWindow = (New-TimeSpan -Minutes 10)
$mysts.Update()
$TT = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$TT.TokenTimeout=(New-TimeSpan -Days 1)
$TT.Update()

Run IISReset and check if issue resolved.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: