I’ve been setting up a new VM with TeamCity and Octopus and it was all going great, except today I booted up my VM and saw that Octopus didn’t start. I tried starting the service manually but it just stops instantly.
I’ve checked the Windows logs and this is the error that I get:
2019-07-11 17:26:22.2362 7920 7 FATAL There is an error in XML document (0, 0).
Root element is missing.
System.InvalidOperationException: There is an error in XML document (0, 0). ---> System.Xml.XmlException: Root element is missing.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlReader.MoveToContent()
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderXmlSettingsRoot.Read4_octopussettings()
--- End of inner exception stack trace ---
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
at Octopus.Shared.Configuration.XmlKeyValueStore.LoadSettings(IDictionary`2 settingsToFill)
at Octopus.Shared.Configuration.DictionaryKeyValueStore.Load()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at Octopus.Shared.Configuration.DictionaryKeyValueStore.Read(String key)
at Octopus.Shared.Configuration.FlatDictionaryKeyValueStore.Get[TData](String name, TData defaultValue, ProtectionLevel protectionLevel)
at Octopus.Shared.Configuration.HomeConfiguration.get_HomeDirectory()
at Octopus.Shared.Configuration.LoggingConfiguration.get_LogsDirectory()
at Octopus.Shared.Configuration.LogInitializer.InitializeLogs()
at Octopus.Shared.Configuration.ApplicationInstanceSelector.LoadCurrentInstance()
at Octopus.Shared.Configuration.ApplicationInstanceSelector.GetCurrentInstance()
at Octopus.Server.Commands.RunCommand.Start()
at Octopus.Shared.Startup.AbstractCommand.Start(String[] commandLineArguments, ICommandRuntime commandRuntime, OptionSet commonOptions)
at Octopus.Shared.Startup.WindowsServiceHost.<>c__DisplayClass1_0.<Run>b__0()
at Octopus.Shared.Startup.WindowsServiceAdapter.RunService()
This has been running fine for weeks, so I’m not sure why this is only now starting to occur. I’m also due to be working on getting this VM image working on a production critical server this Saturday.