May 21, 2015 | Charlie Turano
Sitecore recently released Update 3 (150427) for Sitecore 8. This fixes a number of issues in the previous release, but it introduced a problem with the Update Installation Wizard.
When installing an update package that contains files, the installer fails with an error indicating a file was not found. I verified the presence of the file in the package, so there was something strange going on.
When I ran into this, the first thing I looked at was the logs in the [weboot]/temp/__UpgradeHistory folder. The InstallationLog.txt contained the following error:
5/18/2015-4:05 PM: Exception Could not find file 'C:\inetpub\Sitecore\newhhog.local\Website\_DEV\DeployedItems.xml'.(FileNotFoundException): at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy) at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) at System.Xml.XmlTextReaderImpl.FinishInitUriString() at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext) at System.Xml.Linq.XElement.Load(String uri, LoadOptions options) at HedgehogDevelopment.SitecoreProject.PackageInstallPostProcessor.DoPostDeployActions.Run(ITaskOutput output, NameValueCollection metaData)
This was the error I saw when installing the package, but I verified the presense of the file in the update package. Upon further investigation, I found the following error in InstallationHistory.txt:
ERROR:Some of the installation operation cannot be performed.<br/>An exception occured when trying to install '[s]addedfiles/_DEV/DeployedItems.xml[/s]'.<br/> Details: [s]System.NullReferenceException: Object reference not set to an instance of an object. at Sitecore.Update.Utils.ConfigurationUtils.GetConfiguration(ConfigReader reader) at Sitecore.Update.Utils.ConfigurationUtils.GetConfigNodes(String xpath, ConfigReader reader) at Sitecore.Update.Configuration.Factory.ReloadSettings() at Sitecore.Update.Commands.BaseFileCommand.Serialize(XmlWriter writer, SerializationContext context) at Sitecore.Update.Commands.SerializationCommandFactory.SerializeCommand(ICommand command, XmlWriter writer, SerializationContext context) at Sitecore.Update.Installer.CommandToEntryConverter.PlainConvert(ICommand entry) at Sitecore.Update.Installer.CommandInstallerContext.CommandWriter(ICommand command, BaseSink`1 writer) at Sitecore.Update.Installer.Items.AddFileCommandInstaller.RegisterRollbackCommand(String path, AddFileCommand command, CommandInstallerContext context) at Sitecore.Update.Installer.Items.AddFileCommandInstaller.AddFile(String path, AddFileCommand command, CommandInstallerContext context) at Sitecore.Update.Installer.Items.AddFileCommandInstaller.DoInstall(ICommand cmd, CommandInstallerContext context) at Sitecore.Update.Installer.Items.BaseItemCommandInstaller.Put(PackageEntry entry)[/s]
This looked suspiciously like an error I just fixed in the TDS update package builder. There were a few new items required in the Update Package Builder .config file. These items weren't previously needed to build a package, so I suspect something changed in the Sitecore.Update.dll.
To resolve the issue, you need to add a few lines to the Sitecore web.config.
The first few lines of the Sitecore web.config should look like:
<?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <section name="sitecore" type="Sitecore.Configuration.ConfigReader, Sitecore.Kernel" /> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, Sitecore.Logging" /> <section name="sitecorediff" type="Sitecore.Update.Configuration.ConfigReader, Sitecore.Update"/> </configSections> <sitecorediff/> <connectionStrings configSource="App_Config\ConnectionStrings.config" />
After making this simple change, the Update Installation Wizard was able to install my package. I have reported this issue to Sitecore, but thought it would be a good idea to blog about it in case someone else ran into the issue before there was an official patch.
UPDATE: A patch has been released and can be downloaded now.