The specified key is not a valid size for this algorithm

Every time I try to install a new instance of Octopus Deploy Server, keep getting this error

i’ve uninstalled everything / rebooted multiple times and still get the same error!

Creating default Octopus Server certificate

Error: The specified key is not a valid size for this algorithm.

Full error details are available in the log files.
At: C:\Users\octopus.deploy\AppData\Local\Octopus\Logs

The specified key is not a valid size for this algorithm.
System.Security.Cryptography.CryptographicException: The specified key is not a valid size for this algorithm.
at System.Security.Cryptography.AesCryptoServiceProvider.set_Key(Byte[] value)
at Octopus.Shared.Security.MasterKey.MasterKeyEncryption.CreateAlgorithm(Byte[] key, Boolean generateSalt) in Y:\work\refs\tags\3.3.11\source\Octopus.Shared\Security\MasterKey\MasterKeyEncryption.cs:line 32
at Octopus.Shared.Security.MasterKey.MasterKeyEncryption.ToCiphertext(Byte[] masterKey, Byte[] plaintext, Boolean generateSalt) in Y:\work\refs\tags\3.3.11\source\Octopus.Shared\Security\MasterKey\MasterKeyEncryption.cs:line 50
at Octopus.Core.RelationalStorage.EncryptedValueConverter.WriteJson(JsonWriter writer, Object value, JsonSerializer serializer) in Y:\work\refs\tags\3.3.11\source\Octopus.Core\RelationalStorage\EncryptedValueConverter.cs:line 40
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeConvertable(JsonWriter writer, JsonConverter converter, Object value, JsonContract contract, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)
at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)
at Newtonsoft.Json.JsonConvert.SerializeObjectInternal(Object value, Type type, JsonSerializer jsonSerializer)
at Octopus.Core.RelationalStorage.RelationalTransaction.InstanceToParameters(Object instance, DocumentMap mapping) in Y:\work\refs\tags\3.3.11\source\Octopus.Core\RelationalStorage\RelationalTransaction.cs:line 331
at Octopus.Core.RelationalStorage.RelationalTransaction.Insert[TDocument](String tableName, TDocument instance, String customAssignedId) in Y:\work\refs\tags\3.3.11\source\Octopus.Core\RelationalStorage\RelationalTransaction.cs:line 114
at Octopus.Core.RelationalStorage.RelationalTransaction.Insert[TDocument](TDocument instance, String customAssignedId) in Y:\work\refs\tags\3.3.11\source\Octopus.Core\RelationalStorage\RelationalTransaction.cs:line 102
at Octopus.Core.Initialization.BuiltIn.OctopusCertificateInitializer.Initialize(IRelationalStore store) in Y:\work\refs\tags\3.3.11\source\Octopus.Core\Initialization\BuiltIn\OctopusCertificateInitializer.cs:line 41
at Octopus.Core.Initialization.StoreInitializer.Initialize() in Y:\work\refs\tags\3.3.11\source\Octopus.Core\Initialization\StoreInitializer.cs:line 22
at Octopus.Server.Commands.AdminCommand.Start() in Y:\work\refs\tags\3.3.11\source\Octopus.Server\Commands\AdminCommand.cs:line 65
at Octopus.Shared.Startup.AbstractCommand.Octopus.Shared.Startup.ICommand.Start(String[] commandLineArguments, ICommandRuntime commandRuntime, OptionSet commonOptions) in Y:\work\refs\tags\3.3.11\source\Octopus.Shared\Startup\AbstractCommand.cs:line 58
at Octopus.Shared.Startup.ConsoleHost.Run(Action`1 start, Action shutdown) in Y:\work\refs\tags\3.3.11\source\Octopus.Shared\Startup\ConsoleHost.cs:line 72
at Octopus.Shared.Startup.OctopusProgram.Run() in Y:\work\refs\tags\3.3.11\source\Octopus.Shared\Startup\OctopusProgram.cs:line 87
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.Server.exe” admin --instance “OctopusServer” --username "james.matthews"
Deregistered OctopusServer from the database
Deleted instance: OctopusServer

It turns out the trial license I was requesting, it didnt work, as soon as I used my valid email account rather than my team group email address, it worked a treat!

Hi James,

Thanks for getting in touch and sharing the solution. It’s great to hear you up and running.

Happy deploying! :slight_smile:

Rob