Problems upgrading Octopus Server to latest version

Hi,

I just tried to upgrad the server to the latest version (from 2019.4.x) and run into some problems.
When I try to start the server, the following error is shown:

========== SQL Database Connection Details ========
SQL Server: (local)\SQL2014
SQL Database: octopus
Authentication Type: SQL Server Credentials
User: octopus

===================================================
Preparing to upgrade the database ‘octopus’ on SQL Server at ‘(local)\SQL2014’ to the expected schema running as ‘octopus’…
Making sure it’s safe to upgrade the database schema…
Executing always run pre scripts…
Executing TSQL Database Server script ‘Octopus.Core.UpgradeScriptsAlwaysPre.Script0000 - Database options.sql’
Ensuring COMPATIBILITY_LEVEL for octopus is set to 140
Error: SQLException has occured in statement #0 of this TSQL script: ‘Octopus.Core.UpgradeScriptsAlwaysPre.Script0000 - Database options.sql’; Line: 1; Procedure: ; Error Number: 15048; Excerpt: ‘PRINT ‘Ensuring COMPATIBILITY_LEVEL for octopus is set to 140’’; Message: Gültige Werte für den Datenbank-Kompatibilitätsgrad sind 100, 110 oder 120.
Error: COMPATIBILITY_LEVEL for octopus changed to 140
Error: Upgrade failed due to an unexpected exception:
Error: Microsoft.Data.SqlClient.SqlException (0x80131904): Gültige Werte für den Datenbank-Kompatibilitätsgrad sind 100, 110 oder 120.
Error: COMPATIBILITY_LEVEL for octopus changed to 140
Error: at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) Error: at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 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.TryConsumeMetaData()
Error: at Microsoft.Data.SqlClient.SqlDataReader.get_MetaData()
Error: at Microsoft.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
Error: at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean isAsync, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
Error: at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String method) Error: at Microsoft.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) Error: at Microsoft.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) Error: at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader() Error: at DbUp.Support.ScriptExecutor.ExecuteAndLogOutput(IDbCommand command) Error: at Octopus.Core.Initialization.DatabaseUpgrader.OctopusUpgradeScriptExecutor.<>c__DisplayClass7_0.<ExecuteTransactSqlUpgradeScript>b__0(Func1 commandFactory)
Error: at DbUp.Engine.Transactions.NoTransactionStrategy.Execute(Action1 action) Error: at DbUp.Engine.Transactions.DatabaseConnectionManager.ExecuteCommandsWithManagedConnection(Action1 action)
Error: at Octopus.Core.Initialization.DatabaseUpgrader.OctopusUpgradeScriptExecutor.ExecuteTransactSqlUpgradeScript(IConnectionManager connectionManager, IJournal journal, IUpgradeLog log, SqlScript script, IDictionary2 variables) in C:\buildAgent\work\6099152b9b48bea6\source\Octopus.Core\Initialization\DatabaseUpgrader.cs:line 387 Error: at Octopus.Core.Initialization.DatabaseUpgrader.OctopusUpgradeScriptExecutor.Execute(SqlScript script, IDictionary2 variables) in C:\buildAgent\work\6099152b9b48bea6\source\Octopus.Core\Initialization\DatabaseUpgrader.cs:line 309
Error: at DbUp.Engine.UpgradeEngine.PerformUpgrade()
Error: ClientConnectionId:d16cf07c-fcaf-4b82-8609-704caee4d91c
Error: Error Number:15048,State:1,Class:16
Error: Failed running always run pre scripts. This may leave your database in an inconsistent state. Please contact support@octopus.com as soon as possible and we will help you get up and going. SQL Error 15048 - Gültige Werte für den Datenbank-Kompatibilitätsgrad sind 100, 110 oder 120.
Error: COMPATIBILITY_LEVEL for octopus changed to 140
Error: Microsoft.Data.SqlClient.SqlException
Error: at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) Error: at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 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.TryConsumeMetaData()
Error: at Microsoft.Data.SqlClient.SqlDataReader.get_MetaData()
Error: at Microsoft.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
Error: at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean isAsync, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
Error: at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String method) Error: at Microsoft.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) Error: at Microsoft.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) Error: at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader() Error: at DbUp.Support.ScriptExecutor.ExecuteAndLogOutput(IDbCommand command) Error: at Octopus.Core.Initialization.DatabaseUpgrader.OctopusUpgradeScriptExecutor.<>c__DisplayClass7_0.<ExecuteTransactSqlUpgradeScript>b__0(Func1 commandFactory)
Error: at DbUp.Engine.Transactions.NoTransactionStrategy.Execute(Action1 action) Error: at DbUp.Engine.Transactions.DatabaseConnectionManager.ExecuteCommandsWithManagedConnection(Action1 action)
Error: at Octopus.Core.Initialization.DatabaseUpgrader.OctopusUpgradeScriptExecutor.ExecuteTransactSqlUpgradeScript(IConnectionManager connectionManager, IJournal journal, IUpgradeLog log, SqlScript script, IDictionary2 variables) in DatabaseUpgrader.cs:line 387 Error: at Octopus.Core.Initialization.DatabaseUpgrader.OctopusUpgradeScriptExecutor.Execute(SqlScript script, IDictionary2 variables) in DatabaseUpgrader.cs:line 309
Error: at DbUp.Engine.UpgradeEngine.PerformUpgrade()
Error: Logs:
Error:
Error: The previous command returned a non-zero exit code of: 1
Error: The command that failed was: “D:\Octopus\Octopus.Server.exe” database --instance “OctopusServer” --upgrade

I followed the steps described in the upgrade guide. What can I do to resolve the problem?
Any help would be welcome.

Hi Heurazio,

Thank you for contacting Octopus support.

To upgrade to 2020.1.X+, you will need to be running SQL 2017 or higher. SQL 2014 is not supported in our latest versions. You may see our full list of system requirements here.

You may also see the breaking changes for this upgrade here by clicking the “Show/Hide” buttons.

Let me know if you have any additional questions.

Regards,
Donny

Thanks for the reply. If I understand this correctly, 2020.1.21 is the latest version compatible with SQL2014? Can I just downgrade as the “upgrade” didn’t work?

Ok, installing 2020.1.21 worked without problems. Thanks for your help. In my opinion, there should be a much bigger disclaimer for the SQL server version requirements or a check when installing.

Hi Heurazio,

I’m glad to hear you have it figured out.

I appreciate the suggestion of a more noticeable disclaimer. I’ll bring this up with the team.

If you have any more questions, please don’t hesitate to ask.

Regards,
Donny