Skip to content

Exporting using migrator CLI broken for AWS/Azure Accounts #9752

@Clare-Octopus

Description

@Clare-Octopus

Severity

Blocking Customers from using the Migrator if they have setup any Account Types

Version

2025.3.11974 onwards.

Latest Version

I could reproduce the problem in the latest build

What happened?

If you have Accounts set up in Octopus, you will get an error when using the Data Export feature (Octopus Migrator).

The error will depend on if you have the account as a variable within a project or not.

If you have the account setup on the Accounts page but its not included in any project variables you will see an error such as:

Error: System.Exception: Unable to determine type to deserialize. AccountType AzureServicePrincipal does not map to a known type

If you have that same Account as a variable in a project you will see errors such as:

Newtonsoft.Json.JsonSerializationException: Invalid Variable Type AzureAccount.

I have tested this for an Azure Account and an AWS account. It doesnt seem to error with an OIDC or Google Cloud account in my testing.

Image

Reproduction

  1. Create an AWS and Azure Account and save them.
  2. Try the Data Export from the Octopus Manager and see the errors.
  3. Add those same accounts as Project Variables - ensure they are of the 'Account' type.
  4. Try the data export and see different errors.

Error and Stacktrace

Error: Unable to determine type to deserialize. AccountType `AzureServicePrincipal` does not map to a known type
Error: System.Exception: Unable to determine type to deserialize. AccountType `AzureServicePrincipal` does not map to a known type
Error:    at Octopus.Server.Extensibility.JsonConverters.InheritedClassConverter`2.GetTypeInfoFromDerivedType(String derivedType) in ./source/Octopus.Server.Extensibility/JsonConverters/InheritedClassConverter.cs:line 30
Error:    at Octopus.Server.Extensibility.JsonConverters.InheritedClassConverterBase`2.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) in ./source/Octopus.Server.Extensibility/JsonConverters/InheritedClassConverterBase.cs:line 82
Error:    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
Error:    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
Error:    at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
Error:    at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
Error:    at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
Error:    at lambda_method3759(Closure, QueryContext, DbDataReader, ResultContext, SingleQueryResultCoordinator)
Error:    at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.MoveNext()
Error:    at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items)
Error:    at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)
Error:    at Octopus.Migrator.Core.ExportProcess.UnfilteredExportDataSource.Get[T]() in ./source/Octopus.Migrator.Core/ExportProcess/UnfilteredExportDataSource.cs:line 49
Error:    at Octopus.Migrator.Core.ExportProcess.UnfilteredExportDataSource.GetSpaceAccounts() in ./source/Octopus.Migrator.Core/ExportProcess/UnfilteredExportDataSource.cs:line 65
Error:    at Octopus.Migrator.Core.ExportProcess.ExportController.Export() in ./source/Octopus.Migrator.Core/ExportProcess/ExportController.cs:line 132
Error:    at Octopus.Migrator.Cli.Commands.ExportCommand.Start(ICommandRuntime commandRuntime, CancellationToken cancellationToken) in ./source/Octopus.Migrator.Cli/Commands/ExportCommand.cs:line 123
Error:    at Octopus.Shared.Startup.AbstractCommand.StartWithUnparsedArguments(String[] commandLineArguments, ICommandRuntime commandRuntime, OptionSet commonOptions, CancellationToken cancellationToken) in ./source/Octopus.Shared/Startup/AbstractCommand.cs:line 100
Error:    at Octopus.Shared.Startup.AbstractCommand.Start(String[] commandLineArguments, ICommandRuntime commandRuntime, OptionSet commonOptions, CancellationToken cancellationToken) in ./source/Octopus.Shared/Startup/AbstractCommand.cs:line 84
Error:    at Octopus.Core.Startup.OctopusServerProgram.<>c__DisplayClass18_1.<<Run>b__2>d.MoveNext() in ./source/Octopus.Core/Startup/OctopusServerProgram.cs:line 141
Error: --- End of stack trace from previous location ---
Error:    at Octopus.Shared.Startup.ConsoleHost.Run(Func`1 start, Func`1 shutdown) in ./source/Octopus.Shared/Startup/ConsoleHost.cs:line 32
Error:    at Octopus.Core.Startup.OctopusServerProgram.RunHost(ICommandHost host, Func`2 runCommand) in ./source/Octopus.Core/Startup/OctopusServerProgram.cs:line 312
Error:    at Octopus.Core.Startup.OctopusServerProgram.<>c__DisplayClass18_0.<<Run>b__1>d.MoveNext() in ./source/Octopus.Core/Startup/OctopusServerProgram.cs:line 139
Error: --- End of stack trace from previous location ---
Error:    at Octopus.Core.Startup.OctopusServerProgram.ExecuteProgram(String[] commandLineArguments, ApplicationInformation applicationInformation, ILogger logger, Func`2 buildContainer, Func`7 runCommand) in ./source/Octopus.Core/Startup/OctopusServerProgram.cs:line 254

More Information

Initial Customer Ticket (Internal) - https://octopuscd.zendesk.com/agent/tickets/177960
RnD Request (Internal) - https://octopusdeploy.slack.com/archives/CNHBHV2BX/p1763636394577459

Workaround

The only workaround at the moment to use the Data Migrator would be to delete any AWS/Azure Accounts you have in Octopus (which is not something we would want to recommend to customers so we will see if we can resolve this issue quickly).

You can use the project export feature in the meantime if you need to export some projects across. I can confirm this does work as expected and brings the AWS and Azure accounts over on the export.

Metadata

Metadata

Assignees

Labels

kind/bugThis issue represents a verified problem we are committed to solving

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions