Restore functionality not working

Hi,

I recently tried to move my installation of octopus server onto a different hard drive and thought the best way would be to just do a restore from a backup.
I uninstalled octopus server, re-installed to the new location and the ran the restore process with the octopus manager. It failed with the same error regardless of whether I entered the master key manually or used the server one. I also tried many different install locations including back onto the original hard drive.

I managed to get around using the restore function as I had a copy of the ravendb database and I could simply copy this into my new installation directory while the service was stopped, but it is worrying that the restore won’t work for me when I have a real failure.

The error in the logs was (didn’t attach entire log as it has some sensitive details, let me know if you need more details):

@@@
2014-08-09 15:03:32.4156 INFO Purging directory D:\OctopusHomeNew\OctopusServer\Messages
2014-08-09 15:03:32.4156 INFO Purging directory D:\OctopusHomeNew\OctopusServer\ActivityLogs
2014-08-09 15:05:17.3086 INFO You can browse the RavenDB server at: http://localhost:10931/
2014-08-09 15:05:17.3456 FATAL System.AggregateException: One or more errors occurred. —> System.InvalidOperationException: There is an error in XML document (0, 0). —> System.Xml.XmlException: Root element is missing.
at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)
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) in y:\work\refs\heads\master\source\Octopus.Shared\Configuration\XmlKeyValueStore.cs:line 24 at Octopus.Shared.Configuration.DictionaryKeyValueStore.Load() in y:\work\refs\heads\master\source\Octopus.Shared\Configuration\DictionaryKeyValueStore.cs:line 35 at System.Lazy1.CreateValue()
at System.Lazy1.LazyInitValue() at Octopus.Shared.Configuration.DictionaryKeyValueStore.Read(String key) in y:\work\refs\heads\master\source\Octopus.Shared\Configuration\DictionaryKeyValueStore.cs:line 23 at Octopus.Shared.Configuration.AbstractKeyValueStore.Get(String name, Nullable1 protectionScope) in y:\work\refs\heads\master\source\Octopus.Shared\Configuration\AbstractKeyValueStore.cs:line 16
at Octopus.Server.Storage.ImportExport.Importer.ReadConfiguration(Package package) in y:\work\refs\heads\master\source\Octopus.Server\Storage\ImportExport\Importer.cs:line 111
at Octopus.Server.Storage.ImportExport.Importer.d__0.MoveNext() in y:\work\refs\heads\master\source\Octopus.Server\Storage\ImportExport\Importer.cs:line 61
— End of inner exception stack trace —
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Octopus.Server.Commands.RestoreCommand.Start() in y:\work\refs\heads\master\source\Octopus.Server\Commands\RestoreCommand.cs:line 83
at Octopus.Shared.Startup.ConsoleHost.Run(Action1 start, Action shutdown) in y:\work\refs\heads\master\source\Octopus.Shared\Startup\ConsoleHost.cs:line 36 ---> (Inner Exception #0) System.InvalidOperationException: There is an error in XML document (0, 0). ---> System.Xml.XmlException: Root element is missing. at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res) 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) in y:\work\refs\heads\master\source\Octopus.Shared\Configuration\XmlKeyValueStore.cs:line 24
at Octopus.Shared.Configuration.DictionaryKeyValueStore.Load() in y:\work\refs\heads\master\source\Octopus.Shared\Configuration\DictionaryKeyValueStore.cs:line 35
at System.Lazy1.CreateValue() at System.Lazy1.LazyInitValue()
at Octopus.Shared.Configuration.DictionaryKeyValueStore.Read(String key) in y:\work\refs\heads\master\source\Octopus.Shared\Configuration\DictionaryKeyValueStore.cs:line 23
at Octopus.Shared.Configuration.AbstractKeyValueStore.Get(String name, Nullable`1 protectionScope) in y:\work\refs\heads\master\source\Octopus.Shared\Configuration\AbstractKeyValueStore.cs:line 16
at Octopus.Server.Storage.ImportExport.Importer.ReadConfiguration(Package package) in y:\work\refs\heads\master\source\Octopus.Server\Storage\ImportExport\Importer.cs:line 111
at Octopus.Server.Storage.ImportExport.Importer.d__0.MoveNext() in y:\work\refs\heads\master\source\Octopus.Server\Storage\ImportExport\Importer.cs:line 61<—
@@@

Thanks for getting in touch Kym. I’ve created an issue to track this at: https://github.com/OctopusDeploy/Issues/issues/1145

Can you please let me know which version a) the backup was created with and b) is being restored to?

Many thanks,
Nick

Hi Nicholas,

thanks for getting in touch.
I was actually restoring from backups taken on the same day as well as very
old backups with the same error so I would guess the problem is occurring
irrespective of the backup version. My current octopus server version is
2.4.9.167.
I could upgrade to the latest version to try again if you want or stick
where I am for now.

Regards,
Kym.

Thanks for the extra details Kym; staying on the current version sounds fine if it’s meeting your needs - we’ll update the linked ticket once we’ve tracked down the root cause.

Regards,
Nick