Timeout exporting backup from Octopus Manager

Hi team,

We got the following error while trying to export the Octopus DB from the feature that’s on the Octopus manager.

Any advice on how to get past this?

Process reader took 4398ms in transaction 'ExportController.Export': SELECT *
FROM [dbo].[Event]
ORDER BY [Id]
Error: ===============================================================================
Error: SQL Error -2 - Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
Error: Microsoft.Data.SqlClient.SqlException
Error:    at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
Error:    at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
Error:    at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
Error:    at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
Error:    at Microsoft.Data.SqlClient.SqlDataReader.TryCloseInternal(Boolean closeReader)
Error:    at Microsoft.Data.SqlClient.SqlDataReader.Close()
Error:    at Microsoft.Data.SqlClient.SqlDataReader.Dispose(Boolean disposing)
Error:    at Nevermore.Advanced.ReadTransaction.Stream[TRecord](PreparedCommand command)+System.IDisposable.Dispose()
Error:    at Octopus.Migrator.Core.ExportProcess.ExportController.WriteDocuments[TDocument,TKey](String singularNoun, IEnumerable`1 documents, ExportFileNameOption fileNameOption)+<>m__Finally1()
Error:    at Octopus.Migrator.Core.ExportProcess.ExportController.WriteDocuments[TDocument,TKey](String singularNoun, IEnumerable`1 documents, ExportFileNameOption fileNameOption)+System.IDisposable.Dispose()
Error:    at Octopus.Migrator.Core.ExportProcess.ExportController.WriteDocuments[TDocument,TKey](String singularNoun, IEnumerable`1 documents, ExportFileNameOption fileNameOption)+MoveNext() in ExportController.cs:line 839
Error:    at Octopus.Migrator.Core.ExportProcess.ExportController.Write(String singularNoun, IEnumerable`1 documents, ExportFileNameOption fileNameOption) in ExportController.cs:line 590
Error:    at Octopus.Migrator.Core.ExportProcess.ExportController.Export() in ExportController.cs:line 119
Error:    at Octopus.Migrator.Cli.Commands.ExportCommand.Start() in ExportCommand.cs:line 98
Error:    at Octopus.Shared.Startup.AbstractCommand.Start(String[] commandLineArguments, ICommandRuntime commandRuntime, OptionSet commonOptions)
Error:    at Octopus.Shared.Startup.OctopusProgram.Start(ICommandRuntime commandRuntime)
Error:    at Octopus.Shared.Startup.ConsoleHost.Run(Action`1 start, Action shutdown)
Error:    at Octopus.Shared.Startup.OctopusProgram.RunHost(ICommandHost host)
Error:    at Octopus.Shared.Startup.OctopusProgram.Run()
Error: 
Error: --Inner Exception--
Error: The wait operation timed out.
Error: System.ComponentModel.Win32Exception
Error: -------------------------------------------------------------------------------
Error: Terminating process with exit code 100
Error: Full error details are available in the log files at:
Error: C:\Users\matthew.spiteri\AppData\Local\Octopus\Logs
Error: D:\Octopus\Logs
Error: If you need help, please send these log files to https://octopus.com/support
Error: -------------------------------------------------------------------------------
Error: 
Process Octopus.Migrator.exe in D:\Program Files\Octopus Deploy\Octopus exited with code 100
Error: The previous command returned a non-zero exit code of: 100
Error: The command that failed was: "D:\Program Files\Octopus Deploy\Octopus\Octopus.Migrator.exe" export --instance "OctopusServer" --directory "C:\Users\matthew.spiteri\Desktop\data" --password "xxxxxxxx"

Should we be doing this at a time with less traffic?

Best regards,
Dalmiro

The process gets stuck after an hour or so. Server resources look OK. Same on the SQL side

image

Would it be easier if we restore the DB from SQL from one instance to another? If that’s the case, can you help me find the documentation for that as I cannot find it :slight_smile:

Hi Dalmiro,

Thanks for getting in touch!

The events table can swell pretty large, this could be a case of it being so large that the timeout is being hit before it completes the task.

Is the desire to create a brand new instance using the same data, or are you trying to import the data from this instance into a currently existing instance?

If it is the former, then the best option would be to perform a database backup and restore for the new instance. Doing this should be as simple as copying the master key and then performing a backup and restore within SQL. The best documentation we have around this would be: Creating a test instance - Octopus Deploy

If it is the latter, then an alternative may be to try using the SpaceCloner tool.

Regards,
Paul