Service fails to run and errors

We had a weekend of repeated powercuts that seem to have corrupted our octopus installation. The service will no longer start and I get the below error in event viewer:

2021-03-09 12:21:08.7595 2016 7 FATAL There is an error in XML document (1, 1).
Data at the root level is invalid. Line 1, position 1.
System.InvalidOperationException: There is an error in XML document (1, 1). β€”> System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
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(IDictionary2 settingsToFill) at Octopus.Shared.Configuration.DictionaryKeyValueStore.Load() at System.Lazy1.CreateValue()
at System.Lazy1.LazyInitValue() at Octopus.Shared.Configuration.DictionaryKeyValueStore.Read(String key) at Octopus.Shared.Configuration.FlatDictionaryKeyValueStore.Get[TData](String name, TData defaultValue, Nullable1 protectionScope)
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.b__0()
at Octopus.Shared.Startup.WindowsServiceAdapter.RunService()

I dont have recent backups of this system, so hoping there is a way to either identify the faulty xml and repair or to somehow repair octopus server without losing our data.

Hi @ch4ncy!

From the looks of this error, it would appear that your config file might be corrupt, or have superfluous data in it that is not making it valid XML? To look at this, I would open up your config, which should be stored on disk. By default it’s C:\Octopus\OctopusServer.config

The good news is that this file rarely changes, so in the event that the file is corrupt or deleted, you should be able to restore it from an older backup.

Hope this helps, and please let me know if you have any further questions.

Hi Justin
You were correct. Luckily I had a VM image backed up of the install drive where I could find the config and replace and it is all working again.

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.