{"action":"closed","issue":{"url":"https://api.github.com/repos/OctopusDeploy/Issues/issues/1761","labels_url":"https://api.github.com/repos/OctopusDeploy/Issues/issues/1761/labels{/name}","comments_url":"https://api.github.com/repos/OctopusDeploy/Issues/issues/1761/comments","events_url":"https://api.github.com/repos/OctopusDeploy/Issues/issues/1761/events","html_url":"https://github.com/OctopusDeploy/Issues/issues/1761","id":96952517,"number":1761,"title":"Master key errors are ugly and unhelpful","user":{"login":"tothegills","id":171197,"avatar_url":"https://avatars.githubusercontent.com/u/171197?v=3","gravatar_id":"","url":"https://api.github.com/users/tothegills","html_url":"https://github.com/tothegills","followers_url":"https://api.github.com/users/tothegills/followers","following_url":"https://api.github.com/users/tothegills/following{/other_user}","gists_url":"https://api.github.com/users/tothegills/gists{/gist_id}","starred_url":"https://api.github.com/users/tothegills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tothegills/subscriptions","organizations_url":"https://api.github.com/users/tothegills/orgs","repos_url":"https://api.github.com/users/tothegills/repos","events_url":"https://api.github.com/users/tothegills/events{/privacy}","received_events_url":"https://api.github.com/users/tothegills/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OctopusDeploy/Issues/labels/enhancement","name":"enhancement","color":"009800"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-24T03:18:03Z","updated_at":"2015-08-06T06:26:19Z","closed_at":"2015-08-06T06:26:19Z","body":"Convert documents   An unexpected error occurred when processing document with source ID 'certificate-global': Padding is invalid and cannot be removed. System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed.    at System.Security.Cryptography.CapiSymmetricAlgorithm.DepadBlock(Byte[] block, Int32 offset, Int32 count)    at System.Security.Cryptography.CapiSymmetricAlgorithm.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount)    at System.Security.Cryptography.CryptoStream.FlushFinalBlock()    at System.Security.Cryptography.CryptoStream.Dispose(Boolean disposing)    at System.IO.Stream.Close()    at Octopus.Shared.Security.MasterKey.MasterKeyEncryption.ToPlaintext(Byte[] masterKey, EncryptedBytes encrypted) in y:\\work\\refs\\heads\\master\\source\\Octopus.Shared\\Security\\MasterKey\\MasterKeyEncryption.cs:line 86    at Octopus.Shared.Security.MasterKey.MasterKeyEncryptionExtensions.ToPlaintextString(IMasterKeyEncryption encryption, EncryptedBytes encrypted) in y:\\work\\refs\\heads\\master\\source\\Octopus.Shared\\Security\\MasterKey\\MasterKeyEncryptionExtensions.cs:line 20    at Octopus.Core.RelationalStorage.EncryptedValueConverter.Decrypt(EncryptedBytes bytes, Type objectType) in y:\\work\\refs\\heads\\master\\source\\Octopus.Core\\RelationalStorage\\EncryptedValueConverter.cs:line 91    at Octopus.Core.RelationalStorage.EncryptedValueConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) in y:\\work\\refs\\heads\\master\\source\\Octopus.Core\\RelationalStorage\\EncryptedValueConverter.cs:line 75    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)    at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)    at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)    at Newtonsoft.Json.Linq.JToken.ToObject[T](JsonSerializer jsonSerializer)    at Octopus.Migrator.DocumentImporters.CertificateImporter.Convert(ImportedDocument source, ImportContext context, String id, Certificate existing) in y:\\work\\refs\\heads\\master\\source\\Octopus.Migrator\\DocumentImporters\\CertificateImporter.cs:line 18    at Octopus.Migrator.DocumentImporters.ConventionBasedImporter`2.Import(ImportedDocument document, ImportContext context) in y:\\work\\refs\\heads\\master\\source\\Octopus.Migrator\\DocumentImporters\\ConventionBasedImporter.cs:line 103    at Octopus.Migrator.ImportProcess.ImportController.ConvertDocuments(ImportContext context) in y:\\work\\refs\\heads\\master\\source\\Octopus.Migrator\\ImportProcess\\ImportController.cs:line 339   The document content was: {   \"$type\": \"Octopus.Core.Model.Certificates.Certificate, Octopus.Core\",   \"Id\": \"certificate-global\",   \"CertificateData\": \"[deletedToSaveSpace]\",   \"Thumbprint\": \"3DC35FA45E8779BDC162FBE35BB9DCDA7C9A77FA\",   \"Name\": \"CN=Octopus Portal\" } ------------------------------------------------------------------------------- Error: Argument passed in is not serializable. Parameter name: value ------------------------------------------------------------------------------- Full error details are available in the log files. At: C:\\Octopus\\Logs System.ArgumentException: Argument passed in is not serializable. Parameter name: value    at System.Collections.ListDictionaryInternal.Add(Object key, Object value)    at Octopus.Migrator.ImportProcess.ImportController.ConvertDocuments(ImportContext context) in y:\\work\\refs\\heads\\master\\source\\Octopus.Migrator\\ImportProcess\\ImportController.cs:line 354    at Octopus.Migrator.ImportProcess.ImportController.Import(IImportedDocumentSource backup) in y:\\work\\refs\\heads\\master\\source\\Octopus.Migrator\\ImportProcess\\ImportController.cs:line 93    at Octopus.Shared.Startup.AbstractCommand.Octopus.Shared.Startup.ICommand.Start(String[] commandLineArguments, ICommandRuntime commandRuntime, OptionSet commonOptions) in y:\\work\\refs\\heads\\master\\source\\Octopus.Shared\\Startup\\AbstractCommand.cs:line 57    at Octopus.Shared.Startup.ConsoleHost.Run(Action`1 start, Action shutdown) in y:\\work\\refs\\heads\\master\\source\\Octopus.Shared\\Startup\\ConsoleHost.cs:line 36 Argument passed in is not serializable. Parameter name: value Error: The previous command returned a non-zero exit code of: 1 Error: The command that failed was: \"C:\\Program Files\\Octopus Deploy\\Octopus\\Octopus.Migrator.exe\" import --instance \"OctopusServer\" --directory \"D:\\Export\" --password \"[obfuscated!]\" --overwrite"}}