locked
Object cache problem : The context has expired and can no longer be used. (Exception from HRESULT: 0x80090317) RRS feed

  • Question

  • Hi,

    Please see this post for a previous post about this problem. We came a long way since then.

    About two times a day, our SharePoint frontend server stops rendering pages to user, and serve them with "The context has expired and can no longer be used. (Exception from HRESULT: 0x80090317)" error pages. This only happen on publishing sites.

    In the ULS, we can clearly see that the expired context is either the super reader account or the super user account from the Object Cache configuration.

    SPRequest.SetHttpParameters: UserPrincipalName=, AppPrincipalName= ,bstrHttpMethod=POST ,bstrRequestDigest={cut},

    07 Nov 2016 13:31:07 -0000 ,flags=8 ,gTranLockerId=00000000-0000-0000-0000-000000000000 ,bIgnoreTimeout=False ,

    bstrUserLogin=i:0#.w|ourdomain\superreader ,bstrUserKey=i:0).w|s-1-5-21-3674953346-2531538043-824216363-11724 ,

    ulRoleCount=0 ,bstrRoles=<null> ,bWindowsMode=False ,bstrAppPrincipalName=<null> ,bIsHostHeaderAppPrincipal=False ,

    bstrOriginalAppPrincipalIdentifier=<null> ,bInvalidateCachedConfigurationProperties=False ,lAppDomainId=2 ,

    bCallstack=False

    And right after (same correlation ID)

    System.Runtime.InteropServices.COMException: The context has expired and can no longer be used. (Exception from HRESULT: 0x80090317), StackTrace:   
     at Microsoft.SharePoint.SPGlobal.CreateSPRequestAndSetIdentity(SPSite site, String name, Boolean bNotGlobalAdminCode, String strUrl, Boolean bNotAddToContext, Byte[] UserToken, SPAppPrincipalToken appPrincipalToken, String userName, Boolean bIgnoreTokenTimeout, Boolean bAsAnonymous)    
     at Microsoft.SharePoint.SPWeb.InitializeSPRequest()    
     at Microsoft.SharePoint.SPWeb.EnsureSPRequest()    
     at Microsoft.SharePoint.SPWeb.InitWebPublic()    
     at Microsoft.SharePoint.Publishing.CachedArea.CreateCachedArea(PublishingWeb area, CachedObjectFactory factory, String parentId)    
     at Microsoft.SharePoint.Publishing.CachedObjectFactory.CreateWebFromWebId(Guid webId)    
     at Microsoft.SharePoint.Publishing.CachedAreaLookup.EnsureLookup(Boolean errorsAsExceptions)    
     at Microsoft.SharePoint.Publishing.CachedAreaLookup.GetCachedAreaOrException()    
     at Microsoft.SharePoint.Publishing.Navigation.TaxonomyNavigationCache.GetCachedWebInfo(CachedAreaLookup cachedAreaLookup)    
     at Microsoft.SharePoint.Publishing.Navigation.TaxonomyNavigationCache.GetWebNavigationSettings(CachedAreaLookup cachedArea, CachedAreaLookup& parentCachedArea, Exception& loadError)    
     at Microsoft.SharePoint.Publishing.Navigation.TaxonomyNavigation.GetEffectiveProviderSettingsList(CachedAreaLookup cachedArea, Boolean includeInheritedSettings)    
     at Microsoft.SharePoint.Publishing.Navigation.TaxonomyNavigation.GetEffectiveProviderSettings[T](CachedAreaLookup cachedArea, String siteMapProviderName, Boolean includeInheritedSettings, CachedAreaLookup& cachedAreaWithSettings)    
     at Microsoft.SharePoint.Publishing.Navigation.TaxonomyNavigation.GetEffectiveProviderSettings[T](SPWeb web, String siteMapProviderName, Boolean includeInheritedSettings)    
     at Microsoft.SharePoint.Publishing.Navigation.SwitchableSiteMapProvider.GetCurrentWrappedProvider()    
     at Microsoft.SharePoint.Publishing.Navigation.SwitchableSiteMapProvider.get_RootNode()    
     at Microsoft.SharePoint.Publishing.Navigation.SwitchableDataSourceBehavior.AssignProperties(SiteMapProvider targetProvider)    
     at Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapDataSource.OnInit(EventArgs e)    
     at System.Web.UI.Control.InitRecursive(Control namingContainer)    
     at System.Web.UI.Control.AddedControl(Control control, Int32 index)    
     at Microsoft.SharePoint.WebControls.DelegateControl.AddControlResilient(Control ctl)    
     at Microsoft.SharePoint.WebControls.DelegateControl.CreateChildControlsInternal()    
     at Microsoft.SharePoint.WebControls.DelegateControl.CreateChildControls()    
     at System.Web.UI.Control.EnsureChildControls()    
     at Microsoft.SharePoint.WebControls.DelegateControl.OnInit(EventArgs e)    
     at System.Web.UI.Control.InitRecursive(Control namingContainer)    
     at System.Web.UI.Control.InitRecursive(Control namingContainer)    
     at System.Web.UI.Control.InitRecursive(Control namingContainer)    
     at System.Web.UI.Control.InitRecursive(Control namingContainer)    
     at System.Web.UI.Control.InitRecursive(Control namingContainer)    
     at System.Web.UI.Control.InitRecursive(Control namingContainer)    
     at System.Web.UI.Control.InitRecursive(Control namingContainer)    
     at System.Web.UI.Control.InitRecursive(Control namingContainer)    
     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)    
     at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)    
     at System.Web.UI.Page.ProcessRequest()    
     at System.Web.UI.Page.ProcessRequest(HttpContext context)    
     at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()    
     at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)    
     at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)    
     at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)    
     at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)    
     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)    
     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)    
     at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)    
     at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)    
     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)    
     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)  

    Since the object cache is used on every rendering a page in a publishing site, no one can access the site once those two security context are expired. Sometimes, higher level users (admin and such) can still access the site but normal users can't. Our guess is that the super reader account has expired somehow and the super user account hasn't.

    Our current token timeouts are :

    ContentService Token Timeout : 4 hours
    SPSecurityTokenService Windows Token Lifetime : 2 hours
    SPSecurityTokenService Forms Token Lifetime : 2 hours
    SPSecurityTokenService Logon Token Cache Expiration Window : 10 minutes

    What could we be missing here ? Why would the super user and super reader security context expire ?

    Regards,

    -homerggg

    Monday, November 7, 2016 3:44 PM

All replies

  • Hi,

    Please check if the web application time zone and the server time zone are identical.

    You can refer to the link:

    https://support.cloudshare.com/hc/en-us/articles/200701125-Sorry-something-went-wrong-The-context-has-expired-and-can-no-longer-be-used

    After that, do an IISRESET on each SharePoint server.

    Also, try to disable security context check for the web application:

    • Go to Central Administration
    • Go to  "Application management section
    • Go to "Web Application General Settings"
    • Go to "Web page Security validation"  disable this option.

    Thanks,

    Wendy


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Tuesday, November 8, 2016 7:58 AM
  • Hi,

    We already tried that, along with numerous solutions.

    In fact, with all due respect, if you find the solution to this problem in another post, you can consider that we already tried that and that it is not working as we are working on this problem for over a month now.

    We are looking for fresh ideas ;-)

    Regards,

    -homerggg


    Tuesday, November 8, 2016 2:33 PM
  • Hi,

    Have you had any luck on this issue? I am seeing the same error message. My config is very similar to yours.

    I can temporarily relieve the problem by recycling the web application's app pool.

    We have also tried bumping up the memory on the servers because they appeared to be under some pressure. Yet, this didn't solve the problem.

    Another thing to note, we added a site collection with its own database and it is this site collection we are seeing the context expiring.

    Thanks in advance!

    Tuesday, January 17, 2017 9:20 PM
  • Dear Lou, Could you please suggest if issue is resolved for you.. I'm facing the same issue, added site collection with its own database and in this site collection getting the error. Thanks

    Tuesday, November 27, 2018 8:36 AM
  • We opened a case with MS at the time and ended up reverting back to the default values.
    Tuesday, November 27, 2018 1:52 PM