Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading from before 2021.1 to a modern version may no longer be a viable path due to DB column name error #9141

Open
garrettdass opened this issue Nov 22, 2024 · 0 comments
Labels
kind/bug This issue represents a verified problem we are committed to solving

Comments

@garrettdass
Copy link

Severity

Low

Version

<2021.1 to ~2023.4+

Latest Version

I could reproduce the problem in the latest build

What happened?

Customers trying to upgrade to latest versions of Octopus from before 2021.1.8018 may run into issues and be required to leapfrog major versions to avoid errors regarding Invalid column name 'DeploymentTargetType'.

This requires customers to upgrade from (for example) 2018.10 to 2021.1.8018 before they can do another major upgrade to later versions.

Reproduction

  1. Install Octopus v2021 or lower
  2. Apply newer PTM license
  3. Try to upgrade to 2023.4+

Error and Stacktrace

INFO  - "FAIL": "While testing that your Octopus Server would still be compliant with your license after upgrading, we encountered an error and cannot continue safely. Here is a summary of the error: Invalid column name 'DeploymentTargetType'.
Invalid column name 'DeploymentTargetType'.
Invalid column name 'DeploymentTargetType'.
Microsoft.Data.SqlClient.SqlException
   at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, SqlCommand command, Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at Microsoft.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at Microsoft.Data.SqlClient.SqlDataReader.get_MetaData()
   at Microsoft.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
   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)
   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String method)
   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at Microsoft.Data.SqlClient.SqlCommand.ExecuteScalar()
   at Octopus.Core.RelationalStorage.RawSqlQueryExecutor.ExecuteScalar[T](String commandText, IDictionary`2 commandParameters, String connectionString, Nullable`1 commandTimeout) in RawSqlQueryExecutor.cs:line 170
   at Octopus.Core.Features.Licensing.Schemes.Policies.TargetLimitUsageCalculator.FastQueryUsingLicenseHashCount_Post_2019_10(IRawSqlQueryExecutor queryExecutor, String[] targetTypes) in TargetLimitUsageCalculator.cs:line 130
   at Octopus.Core.Features.Licensing.Schemes.Policies.TargetLimitUsageCalculator.GetUsage(TargetsLicenseLimit targetsLicenseLimit, Int32 numberOfTargetsToAdd) in TargetLimitUsageCalculator.cs:line 45
   at Octopus.Core.Features.Licensing.Schemes.Policies.SelfHostedTargetLimitPolicy.Apply(LicenseCheckResultBuilder resultBuilder) in SelfHostedTargetLimitPolicy.cs:line 21
   at Octopus.Core.Features.Licensing.Schemes.Policies.SelfHostedLimitsLicensePolicy.Apply(LicenseCheckResultBuilder resultBuilder) in SelfHostedLimitsLicensePolicy.cs:line 49
   at Octopus.Core.Features.Licensing.Schemes.SelfHostedLicensingScheme.Check(LicenseKey licenseKey) in SelfHostedLicensingScheme.cs:line 53
   at Octopus.Core.Features.Licensing.LicenseChecker.Check(LicenseKey licenseKey) in LicenseChecker.cs:line 43
   at Octopus.Core.Features.Licensing.LicenseChecker.CheckCurrentLicense() in LicenseChecker.cs:line 36
   at Octopus.Core.Initialization.LicenseComplianceDatabaseUpgradePreCondition.TryEnsurePreConditionIsSatisfied(Boolean isUpgradeRequired, String& message) in LicenseComplianceDatabaseUpgradePreCondition.cs:line 49"

More Information

This is likely due to the PTM changes to licensing ~2023.4.8582 requiring this column.

Workaround

No response

@garrettdass garrettdass added the kind/bug This issue represents a verified problem we are committed to solving label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This issue represents a verified problem we are committed to solving
Projects
None yet
Development

No branches or pull requests

1 participant