Wednesday, January 9, 2013

SharePoint Error Story

There was one JavaScript error which is killing every ones time.

Some time when we access a SSRS Drill thru in some scenario we go the following error.

Dialog

When we debug in IE it given long list of complaints.

SCRIPT5022: Sys.WebForms.PageRequestManagerServerErrorException: An unexpected error has occurred.
ScriptResource.axd, line 5 character 16485

HTML1202: http://server/sites/site/ is running in Compatibility View because 'Display intranet sites in Compatibility View' is checked.
SEC7115: :visited and :link styles can only differ by color. Some styles were not applied to :visited.
HTML1202: http://Set/sites/projec/Pages/RepName.aspx is running in Compatibility View because 'Display intranet sites in Compatibility View' is checked.
HTML1512: Unmatched end tag.
RepName.aspx, line 1095 character 105

SEC7115: :visited and :link styles can only differ by color. Some styles were not applied to :visited.
ReportName.aspx

SCRIPT5022: Sys.WebForms.PageRequestManagerServerErrorException: An unexpected error has occurred.
ScriptResource.axd, line 5 character 16485

SCRIPT5022: Sys.WebForms.PageRequestManagerServerErrorException: An unexpected error has occurred.
ScriptResource.axd, line 5 character 16485

SCRIPT5022: Sys.WebForms.PageRequestManagerServerErrorException: An unexpected error has occurred.
ScriptResource.axd, line 5 character 16485

As it is a JavaScript error, every one started looking into client configurations and then Web.Config.

We found many solutions they all worked in first go, as the error was intermittent after every setting change we believed the issue is fixed.  But the truth is the Error smiled to us once in a while!!

  • Turn off HTTP 1.1 in browser
  • Turn off Async Rendering in Report Viewer Web part
  • Recreate the page
  • aspnet:MaxHttpCollectionKeys
  • scriptResourceHandler enableCompression="false" enableCaching="true"

then what!!

Start from the beginning.  We started analyzing the all the logs, SharePoint, SSRS, IIS.  Try reproducing the error and get point in time error log.  The point in time error study helped.

We got the following error message in SharePoint log

Message

Unexpected error occurred in method 'GetObject' , usage 'SPViewStateCache' - Exception 'Microsoft.ApplicationServer.Caching.DataCacheException: ErrorCode<ERRCA0018>:SubStatus<ES0001>:The request timed out.. Additional Information : The client was trying to communicate with the server : net.tcp:/DEVSRV2.com:22233     at Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ResponseBody respBody, RequestBody reqBody)     at Microsoft.ApplicationServer.Caching.DataCache.InternalGet(String key, DataCacheItemVersion& version, String region, IMonitoringListener listener)     at Microsoft.ApplicationServer.Caching.DataCache.<>c__DisplayClass49.<Get>b__48()     at Microsoft.SharePoint.DistributedCaching.SPDistributedCache.GetObject(String key)'.

Unable to write SPDistributedCache call usage entry.

ViewStateLog: Failed to read from the velocity cache: http://ServerName/sites/ProjName/Pages/ReportName.aspx

So the culprit is Distributed Cache

  • Distributed Cache is the new service in SharePoint 2013
  • For View State, DistributedViewStateCache is used.
  • As the View State is not available while loading the page, we are getting the Java Script Error.

Lessons

  • Understand the problem first before jumping to solutions, try to get some pattern.  All Bing answers are not for you!!
  • Get as many logs as possible. especially the point in time log.  Get the log backup.
  • Widen the scope and thing broader for the intermittent issues.

Happy coding & debugging!!

Teams PowerShell

 The PowerShell helps to get quick meta data around Teams. Install-Module -Name MicrosoftTeams Connect-MicrosoftTeams Get-TeamAllChannel...