Exception in MergeAspSiteMapFiles for “SharePoint 2010 Products Configuration Wizard” (PSConfig)
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: http://sharepointinterface.com/tag/features/
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.