Nick Grattan's Blog

About Microsoft SharePoint, .NET, Natural Language Processing and Machine Learning

Exception in MergeAspSiteMapFiles for “SharePoint 2010 Products Configuration Wizard” (PSConfig)

with one comment

Recently, I’ve found that a SharePoint farm failed to update when running the “SharePoint 2010 Products Configuration Wizard” or when running PSConfig directly. The PSConfig log file in the 14 hive contained the following exception information:

07/12/2012 16:18:22  9  ERR                  Failed to install the application content files.
An exception of type System.Xml.XmlException was thrown.  Additional exception information: Name cannot begin with the '\' character, hexadecimal value 0x5C. Line 5, position 2.
System.Xml.XmlException: Name cannot begin with the '\' character, hexadecimal value 0x5C. Line 5, position 2.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.ParseQName(Boolean isQName, Int32 startOffset, Int32& colonPos)
   at System.Xml.XmlTextReaderImpl.ParseElement()
   at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
   at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
   at System.Xml.XmlDocument.Load(XmlReader reader)
   at System.Xml.XmlDocument.Load(String filename)
   at Microsoft.SharePoint.Administration.SPAspSiteMapFile.MergeAspSiteMapFiles(XmlDocument xmldocSiteMap, String strSrcFilePath, String strMergeFilePattern)
   at Microsoft.SharePoint.Administration.SPAspSiteMapFile.Copy(String strSrcDir, String strSrcLeaf, String strDestDir, Boolean bMergeMaps, Boolean bBackupExistingFile)
   at Microsoft.SharePoint.Administration.SPAdministrationWebApplication.CopyAdminAppDomainDirectories(DirectoryInfo virtualDirectoryPath, OverwriteSetting overwrite)
   at Microsoft.SharePoint.Administration.SPWebService.ApplyApplicationContentToLocalServer()
   at Microsoft.SharePoint.PostSetupConfiguration.ApplicationContentTask.Run()
   at Microsoft.SharePoint.PostSetupConfiguration.TaskThread.ExecuteTask()
07/12/2012 16:18:22  9  INF                  Entering function TaskDriver.NotifyTaskSummary

I suspected that this was caused by a application I had deployed to the SharePoint farm. However, it was not obvious what in the application was causing the problem.

The key to finding the problem was the call to ApplyApplicationContentToLocalServer in the stack trace. Reading up on the documentation for this method indicated that this is responsible for merging all the site map in the 14 hive and placing them in the _app_bin folder for each web application in the appropriate inetpub folders. These sitemap files are XML documents with “.sitemap.” somewhere in the name.

This post is useful in understanding this process:

Using this information I managed to find the sitemap file that was causing the problem – the XML document was invalid since in contained a “\” rather than “/”. And yes, it was installed by the application I had deployed.

Now, what I find interesting is that an issue in a site map deployed by an application can cause the SharePoint 2010 Products Configuration Wizard to fail, and therefore stop any updates from being applied. Not only interesting, but worrying too.

Written by Nick Grattan

July 16, 2012 at 7:49 pm

One Response

Subscribe to comments with RSS.

  1. Reblogged this on erdenbürgerblog and commented:
    That made my day!


    September 30, 2016 at 6:28 pm

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: