Monday, August 5, 2013

SharePoint 30 Minute Time Out for Forms

When you open a form to fill out, Out-of-the-box SharePoint will time out that form after 30 minutes.
This is very annoying because the form will just disappear and the data will be gone so the user has to start filling the form all over again.

You see in the logs a Failed to find entry in cache error message:

 34823 04/08/2013 16:18:42.29   w3wp.exe (0x2D84)                         0x10A8  SharePoint Foundation           General                         ajb4t  Monitorable  ViewStateLog: Failed to find entry in cache: https://portal/sites/Site1/List1/CreateForm.aspx?RootFolder=&IsDlg=1, de60c66b-76f5-4f24-8582-2205a96a949f  94bf0f9c-dd82-80a3-b6fd-cdd46cdfc506
 34824 04/08/2013 16:18:42.33   w3wp.exe (0x2D84)                         0x10A8  SharePoint Foundation           Monitoring                      b4ly  High      Leaving Monitored Scope (EnsureListItemsData). Execution Time=33.8073  94bf0f9c-dd82-80a3-b6fd-cdd46cdfc506
 34826 04/08/2013 16:18:42.41   w3wp.exe (0x2D84)                         0x10A8  SharePoint Foundation           Database                        ahjqp  High      [Forced due to logging gap, cached @ 04/08/2013 16:18:42.36, Original Level: Verbose] SQL connection time: 0.0708  94bf0f9c-dd82-80a3-b6fd-cdd46cdfc506
 34827 04/08/2013 16:18:42.41   w3wp.exe (0x2D84)                         0x10A8  SharePoint Foundation           General                         g3ql  High      [Forced due to logging gap, Original Level: Verbose] GetUriScheme(/sites/Site1/List1/)  94bf0f9c-dd82-80a3-b6fd-cdd46cdfc506
 34828 04/08/2013 16:18:42.46   w3wp.exe (0x2D84)                         0x10A8  SharePoint Foundation           General                         af4yd  High      [Forced due to logging gap, cached @ 04/08/2013 16:18:42.46, Original Level: Verbose] TenantAppEtag record requested but there is no sitesubscription or tenantId for site {0} so we will use the WebApp Id for the cache.  94bf0f9c-dd82-80a3-b6fd-cdd46cdfc506
 34829 04/08/2013 16:18:42.46   w3wp.exe (0x2D84)                         0x10A8  SharePoint Foundation           General                         af4yd  High      [Forced due to logging gap, Original Level: Verbose] TenantAppEtag record requested but there is no sitesubscription or tenantId for site {0} so we will use the WebApp Id for the cache.  94bf0f9c-dd82-80a3-b6fd-cdd46cdfc506
 34830 04/08/2013 16:18:42.49   w3wp.exe (0x2D84)                         0x10A8  SharePoint Foundation           General                         aj007  Medium    skip refreshToken because the token in memory is not fresh  94bf0f9c-dd82-80a3-b6fd-cdd46cdfc506
 34831 04/08/2013 16:18:42.50   w3wp.exe (0x2D84)                         0x10A8  SharePoint Foundation           Monitoring                      nasq  Medium    Entering monitored scope (Render Ribbon.). Parent SharePointForm Control Render  94bf0f9c-dd82-80a3-b6fd-cdd46cdfc506
 34832 04/08/2013 16:18:42.51   w3wp.exe (0x2D84)                         0x10A8  SharePoint Foundation           Monitoring                      b4ly  Medium    Leaving Monitored Scope (Render Ribbon.). Execution Time=4.2422  94bf0f9c-dd82-80a3-b6fd-cdd46cdfc506
 34833 04/08/2013 16:18:42.51   w3wp.exe (0x2D84)                         0x10A8  SharePoint Server Search        Query                           dn4s  High      FetchDataFromURL start at(outside if): 1 param: start  94bf0f9c-dd82-80a3-b6fd-cdd46cdfc506
 34834 04/08/2013 16:18:42.53   w3wp.exe (0x2D84)                         0x10A8  SharePoint Foundation           Monitoring                      b4ly  Medium    Leaving Monitored Scope (Request (POST:https://portal/sites/Site1/List1/CreateForm.aspx?RootFolder=&IsDlg=1)). Execution Time=313.8202  94bf0f9c-dd82-80a3-b6fd-cdd46cdfc506

Solution


There are a so many types of timeouts so finding the right one to tamper was a real quest.

Here's the solution:


PS> $SPSite = Get-SPSite("https://portal")
PS> $webApp = $SPSite.WebApplication
PS> $webApp.FormDigestSettings

        Enabled           Expires Timeout       UpgradedPersistedProperties
        -------           ------- -------       ---------------------------
           True             False 0:30:00      {}      

PS> $webApp.FormDigestSettings.Timeout = New-TimeSpan -Hours 8
PS> $webApp.Update()

2 comments:

  1. Where should i put this code in? and How should I tested it?

    ReplyDelete
  2. set it in PowerShell Sharepoint 2013 and don't forget about 'PS>' dont't copy these symbols, just copy text after ''PS>'

    ReplyDelete