locked
Activating SharePoint Server Publishing Infrastructure gives an un-representable DateTime issue RRS feed

  • Question

  • Activating SharePoint Server Publishing Infrastructure crashed the main site collection with an un-representable DateTime issue

    In order to have Master Pages, SharePoint Server Publishing Infrastructure was activated resulting in the inability to access the main site collection, hence to deactivate the feature or do anything else for that matter.
    - https://kalmstrom.com/Tips/SharePoint-Online-Course/Publishing-Infrastructure-Activate.htm

    On all sites inheriting from the main site collection, the resulting error is

       
     DelegateControl: Exception thrown while adding control 'Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapDataSource': System.ArgumentOutOfRangeException: The added or subtracted value results in an un-representable DateTime. 
     nParameter name: value 
        in System.DateTime.AddTicks(Int64 value) 
        in Microsoft.SharePoint.Publishing.CacheManager.HasTimedOut() 
        in Microsoft.SharePoint.Publishing.CacheManager.GetManager(SPSite site, Boolean useContextSite, Boolean allowContextSiteOptimization, Boolean refreshIfNoContext)
    
        in Microsoft.SharePoint.Publishing.CachedAreaLookupBase.EnsureLookup(Boolean errorsAsExceptions)
    
        in Microsoft.SharePoint.Publishing.CachedAreaLookupBase.GetCachedAreaOrException()
    
        in Microsoft.SharePoint.Publishing.Navigation.TaxonomyNavigationCache.GetCachedWebInfo(CachedAreaLookupBase cachedAreaLookup)
    
        in Microsoft.SharePoint.Publishing.Navigation.TaxonomyNavigationCache.GetWebNavigationSettings(CachedAreaLookupBase cachedArea, CachedAreaLookupBase& parentCachedArea, Exception& loadError)
    
        in Microsoft.SharePoint.Publishing.Navigation.TaxonomyNavigation.GetEffectiveProviderSettingsList(CachedAreaLookupBase cachedArea, Boolean includeInheritedSettings)
    
        in Microsoft.SharePoint.Publishing.Navigation.TaxonomyNavigation.GetEffectiveProviderSettings[T](CachedAreaLookupBase cachedArea, String siteMapProviderName, Boolean includeInheritedSettings, CachedAreaLookupBase& cachedAreaWithSettings)
    
        in Microsoft.SharePoint.Publishing.Navigation.TaxonomyNavigation.GetEffectiveProviderSettings[T](SPWeb web, String siteMapProviderName, Boolean includeInheritedSettings)
    
        in Microsoft.SharePoint.Publishing.Navigation.SwitchableSiteMapProvider.GetCurrentWrappedProvider()
    
        in Microsoft.SharePoint.Publishing.Navigation.SwitchableSiteMapProvider.get_RootNode()
    
        in Microsoft.SharePoint.Publishing.Navigation.SwitchableDataSourceBehavior.AssignProperties(SiteMapProvider targetProvider)
    
        in Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapDataSource.OnInit(EventArgs e
    
        in System.Web.UI.Control.InitRecursive(Control namingContainer) 
        in System.Web.UI.Control.AddedControl(Control control, Int32 index)
    
        in Microsoft.SharePoint.WebControls.DelegateControl.AddControlResilient(Control ctl)
    
        [...] 
        Application error when access /_layouts/15/sitemanager.aspx, Error=The added or subtracted value results in an un-representable DateTime.  nParameter name: value
    
        in System.DateTime.AddTicks(Int64 value) 
        in Microsoft.SharePoint.Publishing.CacheManager.HasTimedOut() 
        in Microsoft.SharePoint.Publishing.CacheManager.GetManager(SPSite site, Boolean useContextSite, Boolean allowContextSiteOptimization, Boolean refreshIfNoContext)
    
        in Microsoft.SharePoint.Publishing.PublishingWeb.IsPublishingWeb(SPWeb web)
    
        in Microsoft.SharePoint.Publishing.Internal.WebControls.ObjectSerializer.castAsArea(SPWeb web)
    
        in Microsoft.SharePoint.Publishing.Internal.WebControls.ObjectSerializer..ctor(SPWeb web, String userData)
    
        in Microsoft.SharePoint.Publishing.Internal.WebControls.ObjectSerializer.GetObjectSerializer(SPWeb web, String userDefinedData)
    
        in Microsoft.SharePoint.Publishing.Internal.WebControls.SMTreeView.InitialLoadCreateRootNode()
    
        in Microsoft.SharePoint.Publishing.Internal.WebControls.EcbEnabledTreeView.OnLoad(EventArgs e)
    
        in Microsoft.SharePoint.Publishing.Internal.WebControls.SMTreeView.OnLoad(EventArgs e)
    
        in System.Web.UI.Control.LoadRecursive() 
        in System.Web.UI.Control.LoadRecursive() 
        in System.Web.UI.Control.LoadRecursive() 
        in System.Web.UI.Control.LoadRecursive() 
        in System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    
        [...] 
        calling GetCurrentGenericSetupPath for a versioned path: TEMPLATE\LAYOUTS
    
        SPRequestModule.PreSendRequestHeaders End 
        SPRequestModule.ErrorAppHandler End 
        SPRequestModule.PostLogRequestHandler Begin 
        SPRequestModule.PostLogRequestHandler End 
        [...]

    Can this be a solution ?
    - https://onehundredwatt.wordpress.com/2016/12/21/sharepoint-un-representable-datetime-issue-with-publishing-sites/
    - https://sharepointumar.wordpress.com/2017/12/03/sharepoint-publishing-cache-manager-has-timed-out/

    Related articles
    - https://social.technet.microsoft.com/Forums/en-US/3a5a177a-8190-4801-b61c-70df41445482/about-sharepoint-server-publishing-infrastructure
    - http://www.sharepointchick.com/archive/2011/06/23/sharepoint-publishing-features-functionality.aspx
    - https://technet.microsoft.com/en-gb/library/ff628963(v=office.14).aspx

    Old related post ?
    - https://social.technet.microsoft.com/Forums/en-US/a046b581-5bfa-44f1-9e14-5d1e889e2954/site-collections-something-went-wrong?forum=SP2016

    • Edited by Jc D Friday, April 13, 2018 6:54 PM updating links for the 4th time... no spam !!!
    Wednesday, April 11, 2018 7:48 PM

Answers

  • Issue solved

    // STEP#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.
    https://sharepointumar.wordpress.com/2017/12/03/sharepoint-publishing-cache-manager-has-timed-out/

    // STEP#2
    // SHAREPOINT 2016 MANAGEMENT SHELL
    // Checking Values
    // $mysts.WindowsTokenLifetime must be 10 hours
    // $mysts.LogonTokenCacheExpirationWindow must be 10 minutess
    // $$TT.TokenTimeout must be 1 day / 24 hours
    Add-PSSnapin microsoft.sharepoint.powershell
    $mysts = Get-SPSecurityTokenServiceConfig
    $mysts.WindowsTokenLifetime
    $mysts.LogonTokenCacheExpirationWindow
    $TT = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
    $TT.TokenTimeout
    // IF NOT, change timers
    $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()

    // STEP#3
    // CLEARING SHAREPOINT CONFIGURATION CACHE
    https://www.zubairalexander.com/blog/clearing-the-sharepoint-configuration-cache/
    or
    https://web.archive.org/web/20180412145114/https://www.zubairalexander.com/blog/clearing-the-sharepoint-configuration-cache/

    // STEP#4
    // RESET IIS
    // "& {iisreset}" and "invoke-command -scriptblock {iisreset}" can end with occasional failures.
    // "Start-Process "iisreset.exe" -NoNewWindow -Wait" waits for iisreset.exe to end gracefully.
    & {iisreset}

    // STEP#5 
    // RESTART ALL SERVERS IF NEEDED
    Was not needed in our case

           
    • Marked as answer by Jc D Thursday, April 12, 2018 4:58 PM
    • Edited by Jc D Friday, April 13, 2018 7:04 PM testing again
    Thursday, April 12, 2018 4:57 PM

All replies