I am currently in the process of completing a data migration of two self-hosted Octopus servers in to one, however we are running in to an issue at the point of the import to the main server.
The error log is below and highlights padding being an issue, however I have looked through the Octopus documentation + forums and cannot see anything related to the specific issue being highlighted or mentioned.
The major versions of Octopus are the same, 2022.2, with the build versions differing:
Build v6764 â Export
Build v6729 â Import
The databases are the same (although on different servers) using the same collation and running on SQL server 2017.
Executable directory is C:\Program Files\Octopus Deploy\Octopus
Executable name or full path: Octopus.Migrator.exe
No user context provided. Running as current user.
Starting Octopus.Migrator.exe in working directory âC:\Program Files\Octopus Deploy\Octopusâ using âWestern European (DOS)â encoding running as âPARENTPAY\david.carthy.adminâ with the same environment variables as the launching process
Error: Padding is invalid and cannot be removed.
Error: System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed.
Error: at Internal.Cryptography.UniversalCryptoDecryptor.GetPaddingLength(ReadOnlySpan1 block) Error: at Internal.Cryptography.UniversalCryptoDecryptor.UncheckedTransformFinalBlock(ReadOnlySpan
1 inputBuffer, Span1 outputBuffer) Error: at Internal.Cryptography.UniversalCryptoDecryptor.UncheckedTransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) Error: at Internal.Cryptography.UniversalCryptoTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) Error: at System.Security.Cryptography.CryptoStream.FlushFinalBlockAsync(Boolean useAsync, CancellationToken cancellationToken) Error: at System.Security.Cryptography.CryptoStream.FlushFinalBlock() Error: at System.Security.Cryptography.CryptoStream.Dispose(Boolean disposing) Error: at System.IO.Stream.Close() Error: at System.IO.Stream.Dispose() Error: at Octopus.Core.Security.MasterKey.MasterKeyEncryption.ToPlaintext(Byte[] masterKey, EncryptedBytes encrypted) in ./source/Octopus.Core/Security/MasterKey/MasterKeyEncryption.cs:line 74 Error: at Octopus.Core.Security.MasterKey.StoredMasterKeyEncryption.ToPlaintext(EncryptedBytes encrypted) in ./source/Octopus.Core/Security/MasterKey/StoredMasterKeyEncryption.cs:line 71 Error: at Octopus.Core.Security.MasterKey.MasterKeyEncryptionExtensionMethods.ToPlaintextString(IMasterKeyEncryption encryption, EncryptedBytes encrypted) in ./source/Octopus.Core/Security/MasterKey/MasterKeyEncryptionExtensionMethods.cs:line 21 Error: at Octopus.Core.RelationalStorage.TypeHandlers.SensitiveStringConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) in ./source/Octopus.Core/RelationalStorage/TypeHandlers/SensitiveStringConverter.cs:line 55 Error: at Octopus.Core.RelationalStorage.TypeHandlers.SensitiveStringTypeHandler.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) in ./source/Octopus.Core/RelationalStorage/TypeHandlers/SensitiveStringTypeHandler.cs:line 58 Error: at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue) Error: at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ResolvePropertyAndCreatorValues(JsonObjectContract contract, JsonProperty containerProperty, JsonReader reader, Type objectType) Error: at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObjectUsingCreatorWithParameters(JsonReader reader, JsonObjectContract contract, JsonProperty containerProperty, ObjectConstructor
1 creator, String id)
Error: at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewObject(JsonReader reader, JsonObjectContract objectContract, JsonProperty containerMember, JsonProperty containerProperty, String id, Boolean& createdFromNonDefaultCreator)
Error: at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
Error: at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, 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 Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
Error: at Octopus.Migrator.Cli.Commands.ImportFilesCommand.Start() in ./source/Octopus.Migrator.Cli/Commands/ImportFilesCommand.cs:line 113
Error: at Octopus.Shared.Startup.AbstractCommand.Start(String[] commandLineArguments, ICommandRuntime commandRuntime, OptionSet commonOptions) in ./source/Octopus.Shared/Startup/AbstractCommand.cs:line 100
Error: at Octopus.Shared.Startup.OctopusProgram.Start(ICommandRuntime commandRuntime) in ./source/Octopus.Shared/Startup/OctopusProgram.cs:line 500
Error: at Octopus.Shared.Startup.ConsoleHost.Run(Action`1 start, Action shutdown) in ./source/Octopus.Shared/Startup/ConsoleHost.cs:line 34
Error: at Octopus.Shared.Startup.OctopusProgram.RunHost(ICommandHost host) in ./source/Octopus.Shared/Startup/OctopusProgram.cs:line 217
Error: at Octopus.Shared.Startup.OctopusProgram.Run() in ./source/Octopus.Shared/Startup/OctopusProgram.cs:line 168
Error: Sensitive data in this export cannot be decrypted
Error: This usually happens when you use the wrong password when importing. Check the password and try importing again. If that doesnât work, try exporting again and make sure to use the same password for both the export and import.
Error: See: âData Migration - Octopus Deployâ
Error: "-------------------------------------------------------------------------------
Error: Terminating process with exit code 100
Error: Full error details are available in the log files at:
Error: C:\Users\david.carthy.admin\AppData\Local\Octopus\Logs
Error: E:\Octopus\Logs
Error: If you need help, please send these log files to Help & Support - Octopus Deploy
Error: -------------------------------------------------------------------------------
Error: "
Process Octopus.Migrator.exe in C:\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: âC:\Program Files\Octopus Deploy\Octopus\Octopus.Migrator.exeâ import --instance âOctopusServerâ --directory âC:\Exports\OctopusExtractDevâ --password âdCarthy-Octop****â --dry-run