xslt time out in SharePoint 2010: System.StackOverflowException: Operation caused a stack overflow

We have a dataview webpart created by SharePoint designer. Since we upgraded it from SharePoint 2007 to SharePoint 2010, the web part throws error intermittently.

“Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Microsoft SharePoint Foundation-compatible HTML editor such as Microsoft SharePoint Designer. If the problem persists, contact your Web server administrator”

if you look into SharePoint logs you will find the following Exception

Error while executing web part: System.StackOverflowException: Operation caused a stack overflow.
at Microsoft.Xslt.NativeMethod.CheckForSufficientStack()
at SyncToNavigator(XPathNavigator , XPathNavigator )
at (XmlQueryRuntime , IList`1 , Double , XPathNavigator )
at (XmlQueryRuntime , XPathNavigator )
at Root(XmlQueryRuntime )
at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer, Boolean closeWriter)
at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter results)
at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results)
at Microsoft.SharePoint.WebPartPages.DataFormWebPart.ExecuteTransform(XslCompiledTransform xslCompiledTransform, XsltArgumentList xmlArguments, Boolean bDeferExecuteTransform)
at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform(Boolean bDeferExecuteTransform)

Microsoft has a KB article describing this problem

this thread has more detailed info.

the reason for this problem was because the timeout value for XSL Tranform is set to 1. anything longer than 1 second will cause this error.

The solution is available after 2012 FEB CU using the following PowerShell Commands:

$farm = Get-SPFarm
$farm.XsltTransformTimeOut = 5
$farm.Update()

Xin

2 thoughts on “xslt time out in SharePoint 2010: System.StackOverflowException: Operation caused a stack overflow

Leave a Reply

Your email address will not be published. Required fields are marked *