The other day I realised that my home server hadn't sent me it's daily "Health Report" email. Having done the usual simple test of "is the server up?" and "what happens if I reboot it?", I ended up digging through the Event Log and Google to work out what was wrong. In case this happens to me again, or happens to you, here's what I found:
While I wasn't seeing the health emails, nothing much else appeared obviously wrong. I was still getting my daily "backup has succeeded" email. My son's Minecraft server was happy, and my Git, RSS and music services were running fine.
Checking the Services admin tool, I noticed that the "Windows Server Essentials Management Service" was stopped. Trying to start it did not succeed, and each attempt put two events into the Event Log. The first was a standard "Windows could not start that service" message:
Faulting application name: SharedServiceHost.exe, version: 6.3.9600.16384, time stamp: 0x5215ca62 Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000 Exception code: 0x80131623 Fault offset: 0x00007ff8be8f2746 Faulting process id: 0x15f4 Faulting application start time: 0x01d1cead9c3cbcf9 Faulting application path: C:\Windows\System32\Essentials\SharedServiceHost.exe Faulting module path: unknown Report Id: dbae03fc-3aa0-11e6-8113-c03fd5600a64 Faulting package full name: Faulting package-relative application ID:
"SharedServiceHost.exe" is indeed the binary for the failed service:
Each of these event messages was accompanied by a bigger error about the actual failure that occurred:
Application: SharedServiceHost.exe Framework Version: v4.0.30319 Description: The application requested process termination through System.Environment.FailFast(string message). Message: Unhandled exception in OnStart: System.ArgumentNullException: The empty string '' is not a valid local name. Parameter name: name at System.Xml.XmlConvert.VerifyNCName(String name, ExceptionType exceptionType) at System.Xml.XmlUTF8TextReader.VerifyNCName(String s) at System.Xml.XmlUTF8TextReader.ReadQualifiedName(PrefixHandle prefix, StringHandle localName) at System.Xml.XmlUTF8TextReader.ReadStartElement() at System.Xml.XmlUTF8TextReader.Read() at System.Xml.XmlBaseReader.MoveToContent() at System.Xml.XmlBaseReader.IsStartElement() at System.Xml.XmlBaseReader.IsStartElement(XmlDictionaryString localName, XmlDictionaryString namespaceUri) at ReadArrayOfDevicePropertyFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString , XmlDictionaryString , CollectionDataContract ) at System.Runtime.Serialization.CollectionDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract& dataContract) at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Int32 id, RuntimeTypeHandle declaredTypeHandle, String name, String ns) at ReadKeyValueOfstringArrayOfDevicePropertyoy2JKP7OFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[] ) at System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) at ReadArrayOfKeyValueOfstringArrayOfDevicePropertyoy2JKP7OFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString , XmlDictionaryString , CollectionDataContract ) at System.Runtime.Serialization.CollectionDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract& dataContract) at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract dataContract, String name, String ns) at System.Runtime.Serialization.DataContractSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName, DataContractResolver dataContractResolver) at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver) at System.Runtime.Serialization.XmlObjectSerializer.ReadObject(XmlDictionaryReader reader) at Microsoft.WindowsServerSolutions.Common.Devices.DataContractObjectStore`1.Load(String path, IEnumerable`1 knownTypes) at Microsoft.WindowsServerSolutions.Common.Devices.DataContractObjectStore`1.Load() at Microsoft.WindowsServerSolutions.Common.Devices.DevicesXmlDataStore.Read() at Microsoft.WindowsServerSolutions.Common.Devices.DevicesProviderDataManager.ReadFromDataStore() at Microsoft.WindowsServerSolutions.Common.Devices.DevicesProviderDataManager.DoLoadDeviceData() at Microsoft.WindowsServerSolutions.Common.Devices.DeviceManagementActivity.CreateBackend() at Microsoft.WindowsServerSolutions.Common.Devices.DeviceManagementActivity.CreateProviderHosts() at Microsoft.WindowsServer.Essentials.WindowsService.WseServiceBase.CreateProviderHosts() at Microsoft.WindowsServerSolutions.Common.ProviderFramework.ProviderServiceBase._OpenHosts() at Microsoft.WindowsServer.Essentials.WindowsService.WseServiceBase.OnStartInner(String[] args) at Microsoft.WindowsServerSolutions.Common.ProviderFramework.ProviderServiceBase.OnStart(String[] args) Stack: at System.Environment.FailFast(System.String, System.Exception) at Microsoft.WindowsServerSolutions.Common.ProviderFramework.ProviderServiceBase.OnStart(System.String[]) at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(System.Object) at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch()
Armed with that information, I spent a bit of time Googling about these errors. There were assorted threads on Microsoft's support forums and similar places describing issues with this particular service. Most of the threads (this one for example) offered three potential solutions:
So putting the first option aside, I went looking in the folder
C:\ProgramData\Microsoft\Windows Server\Data
there is indeed a file of the name specified with a backup:
Removing "DevicesInfo.xml" and renaming "DevicesInfo.xml.bak" worked ok (though it requires elevated privileges). And with that done clicking "Start" for the broken service now works. Success!
Well running a diff between the working file and the broken one gives this:
That looks to me like at some point the process stopped while saving the file, as the right hand (broken) copy just stops without closing the attributes and tags properly.
I had a power cut recently – my money's on that...
Maybe I should invest in a UPS?