SharePoint un-representable Datetime issue with Publishing sites

I recently had a serious issue with a SharePoint 2016 farm. Any site with Publishing enabled would fail to display giving a correlation error.

UPDATE: This issue is definitely related to Token Timeout settings. It was pretty common to adjust these settings in older SharePoint versions, but SharePoint 2016 doesn’t behave the same. See comments for more details.

Application error when access /Pages/Home.aspx, Error=The added or subtracted value results in an un-representable DateTime.  Parameter name: value   atSystem.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.TemplateRedirectionPage.ComputeRedirectionVirtualPath(TemplateRedirectionPage basePage)     at Microsoft.SharePoint.Publishing.Internal.CmsVirtualPathProvider.CombineVirtualPaths(String basePath, String relativePath)     at System.Web.Hosting.VirtualPathProvider.CombineVirtualPaths(VirtualPath basePath, VirtualPath relativePath)

I tested creating a new web application and site collection using the Team Site template. This worked successfully. I tried again using a Publishing Site template and the error above  appeared.

The issue appeared to be timezone related and so we checked the timezone and locale settings on all servers in the farm and the site collections to make sure they matched.

The ULS log also pointed us towards the Security Token Service and then the TokenTimeOut setting. Bingo! The SharePoint 2016 farm was using Mini-roles and the server host the Security Token Service had failed to pickup the configuration update with the timezone settings and so didn’t match the rest of the farm.

To resolve the issue we did the following:

Initially we had installed the farm with United States timezone, when a change was made to use New Zealand time, the configuration didn’t fully update on all servers and the Security Token Service was responding with US Date format making things very unhappy.

Publishing pages use the Security Token Service to validate pages. If the validation fails the page doesn’t load. Team sites without Publishing enabled are OK as they don’t do this validation.

2 comments

  1. Thank you! That article saved my tail with a new SP 2016 environment. My issue started when I set the Token-Timeout, sts.FormsTokenLifetime, sts.WindowsTokenLifetime and sts.LogonTokenCacheExpirationWindow values in 2016 like i would in SP 2013.
    After comparing the Security Token Service Properties in 2013 to 2016, I see that there are several more “*Lifetime” properties that needed to be adjusted. Until I find the correct values for those new properties, setting the above properties to their default fixed my issue. Thanks

    • I am glad this helped. I tried adjusting the Token-Timeout settings in my test environment and it caused the same problem. It’s definitely a bit of a trap!

Leave a comment