Hi
We have 3 new projects on a dev octopus instance (running version 3.11.1) which I want to import from, into our production octopus instance (running octopus 3.8.2).
I performed an export on the dev server and then copied the relevant folders/files to the prod server and i try performing an import.
2 of the projects are OK (preview goes well when i have only them in the import folder, but the 3rd (one i have all 3 in the import folder) causes the import to break with the following error:
ERROR An unexpected error occurred when processing document with source ID ‘deploymentprocess-Projects-103’: 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.Core.Security.MasterKey.MasterKeyEncryption.ToPlaintext(Byte[] masterKey, EncryptedBytes encrypted) in Z:\buildAgent\workDir\eec88466c176b607\source\Octopus.Core\Security\MasterKey\MasterKeyEncryption.cs:line 84
at Octopus.Core.Security.MasterKey.MasterKeyEncryptionExtensions.ToPlaintextString(IMasterKeyEncryption encryption, EncryptedBytes encrypted) in Z:\buildAgent\workDir\eec88466c176b607\source\Octopus.Core\Security\MasterKey\MasterKeyEncryptionExtensions.cs:line 21
at Octopus.Core.RelationalStorage.PropertyValueConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) in Z:\buildAgent\workDir\eec88466c176b607\source\Octopus.Core\RelationalStorage\PropertyValueConverter.cs:line 58
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateDictionary(IDictionary dictionary, JsonReader reader, JsonDictionaryContract contract, JsonProperty containerProperty, 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.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.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
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.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.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
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.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.DeploymentProcessImporter.Convert(ImportedDocument source, ImportContext context, String id, DeploymentProcess existing) in Z:\buildAgent\workDir\eec88466c176b607\source\Octopus.Migrator\DocumentImporters\DeploymentProcessImporter.cs:line 32
at Octopus.Migrator.DocumentImporters.ConventionBasedImporter2.InsertNewDocument(ImportedDocument document, ImportContext context, Identity identity) in Z:\buildAgent\workDir\eec88466c176b607\source\Octopus.Migrator\DocumentImporters\ConventionBasedImporter.cs:line 156 at Octopus.Migrator.DocumentImporters.ConventionBasedImporter
2.Import(ImportedDocument document, ImportContext context) in Z:\buildAgent\workDir\eec88466c176b607\source\Octopus.Migrator\DocumentImporters\ConventionBasedImporter.cs:line 115
at Octopus.Migrator.ImportProcess.ImportController.ConvertDocuments(ImportContext context) in Z:\buildAgent\workDir\eec88466c176b607\source\Octopus.Migrator\ImportProcess\ImportController.cs:line 497
2017-03-06 17:35:27.7932 1 INFO The document content was:
{
…json content which i will ommit…
}
2017-03-06 17:35:27.9651 1 ERROR ===============================================================================
2017-03-06 17:35:28.0120 1 FATAL Padding is invalid and cannot be removed.
System.Security.Cryptography.CryptographicException
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.Core.Security.MasterKey.MasterKeyEncryption.ToPlaintext(Byte[] masterKey, EncryptedBytes encrypted) in MasterKeyEncryption.cs:line 84
at Octopus.Core.Security.MasterKey.MasterKeyEncryptionExtensions.ToPlaintextString(IMasterKeyEncryption encryption, EncryptedBytes encrypted) in MasterKeyEncryptionExtensions.cs:line 21
at Octopus.Core.RelationalStorage.PropertyValueConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) in PropertyValueConverter.cs:line 58
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateDictionary(IDictionary dictionary, JsonReader reader, JsonDictionaryContract contract, JsonProperty containerProperty, 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.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.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
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.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.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
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.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.DeploymentProcessImporter.Convert(ImportedDocument source, ImportContext context, String id, DeploymentProcess existing) in DeploymentProcessImporter.cs:line 32
at Octopus.Migrator.DocumentImporters.ConventionBasedImporter2.InsertNewDocument(ImportedDocument document, ImportContext context, Identity identity) in ConventionBasedImporter.cs:line 156 at Octopus.Migrator.DocumentImporters.ConventionBasedImporter
2.Import(ImportedDocument document, ImportContext context) in ConventionBasedImporter.cs:line 115
at Octopus.Migrator.ImportProcess.ImportController.ConvertDocuments(ImportContext context) in ImportController.cs:line 488
at Octopus.Migrator.ImportProcess.ImportController.ExecuteWithTimer(ImportContext ctx, String name, Action1 work) in ImportController.cs:line 160 at Octopus.Migrator.ImportProcess.ImportController.ImportDocuments(IImportedDocumentSource backup) in ImportController.cs:line 102 at Octopus.Migrator.ImportProcess.ImportController.Import(IImportedDocumentSource backup) in ImportController.cs:line 80 at Octopus.Migrator.Commands.ImportFilesCommand.Start() in ImportFilesCommand.cs:line 97 at Octopus.Shared.Startup.AbstractCommand.Octopus.Shared.Startup.ICommand.Start(String[] commandLineArguments, ICommandRuntime commandRuntime, OptionSet commonOptions, String displayName, String version, String informationalVersion, String[] environmentInformation, String instanceName) in AbstractCommand.cs:line 78 at Octopus.Shared.Startup.OctopusProgram.Start(ICommandRuntime commandRuntime) in OctopusProgram.cs:line 214 at Octopus.Shared.Startup.ConsoleHost.Run(Action
1 start, Action shutdown) in ConsoleHost.cs:line 77
at Octopus.Shared.Startup.OctopusProgram.Run() in OctopusProgram.cs:line 104
2017-03-06 17:35:28.0432 1 ERROR ===============================================================================
2017-03-06 17:35:28.1214 1 ERROR The master key does not match the encryption used in the database
2017-03-06 17:35:28.1370 1 ERROR -------------------------------------------------------------------------------
2017-03-06 17:35:28.1682 1 ERROR A new install creates a new master key. If you then restore data from another instance with a different master key you will get this exception. This error can also occur if you try to upgrade a 2.5 instance to 3.0 without first upgrading to 2.6.
2017-03-06 17:35:28.1995 1 ERROR See: http://g.octopushq.com/SecurityAndEncryption
I’ve found the following discussions in the forum, but they didn’t help me in resolving the problem:
- http://help.octopusdeploy.com/discussions/problems/35187-padding-is-invalid-and-cannot-be-removed-error-in-30-preview
- http://community.octopusdeploy.com/t/error-in-import/428
I used to be able to import projects in the past (older versions) between these 2 instances and having the sensitive variables empty instead of failing the import - is this something which was changed?
Is there a way to workaround or solve the problem?
Thanks
Nir