Can't install Octopus on Server2012 R2 Standard (CryptographicException)

Hi,
Getting the following error when trying to install octopus server on Windows Server 2012 R2 Standard:


Creating default Octopus Server certificate

Error: The key has invalid size for this algorithm // translated from Russian, may differ from the original

System.Security.Cryptography.CryptographicException: The key has invalid size for this algorithm
в System.Security.Cryptography.AesCryptoServiceProvider.set_Key(Byte[] value)
в Octopus.Shared.Security.MasterKey.MasterKeyEncryption.CreateAlgorithm(Byte[] key, Boolean generateSalt) in Y:\Work\refs\tags\3.4.7\source\Octopus.Shared\Security\MasterKey\MasterKeyEncryption.cs:сline 32
в Octopus.Shared.Security.MasterKey.MasterKeyEncryption.ToCiphertext(Byte[] masterKey, Byte[] plaintext, Boolean generateSalt) in Y:\Work\refs\tags\3.4.7\source\Octopus.Shared\Security\MasterKey\MasterKeyEncryption.cs:line 52
в Octopus.Core.RelationalStorage.EncryptedValueConverter.WriteJson(JsonWriter writer, Object value, JsonSerializer serializer) in Y:\Work\refs\tags\3.4.7\source\Octopus.Core\RelationalStorage\EncryptedValueConverter.cs:line 42
в Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeConvertable(JsonWriter writer, JsonConverter converter, Object value, JsonContract contract, JsonContainerContract collectionContract, JsonProperty containerProperty)
в Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
в Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)
в Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)
в Newtonsoft.Json.JsonConvert.SerializeObjectInternal(Object value, Type type, JsonSerializer jsonSerializer)
в Octopus.Core.RelationalStorage.RelationalTransaction.InstanceToParameters(Object instance, DocumentMap mapping) in Y:\Work\refs\tags\3.4.7\source\Octopus.Core\RelationalStorage\RelationalTransaction.cs:line 403
в Octopus.Core.RelationalStorage.RelationalTransaction.Insert[TDocument](String tableName, TDocument instance, String customAssignedId, String tableHint) в Y:\Work\refs\tags\3.4.7\source\Octopus.Core\RelationalStorage\RelationalTransaction.cs:line 137
в Octopus.Core.RelationalStorage.RelationalTransaction.Insert[TDocument](TDocument instance, String customAssignedId) in Y:\Work\refs\tags\3.4.7\source\Octopus.Core\RelationalStorage\RelationalTransaction.cs:строка 118
в Octopus.Core.Initialization.BuiltIn.OctopusCertificateInitializer.Initialize(IRelationalStore store) in Y:\Work\refs\tags\3.4.7\source\Octopus.Core\Initialization\BuiltIn\OctopusCertificateInitializer.cs:line 41
в Octopus.Core.Initialization.StoreInitializer.Initialize() in Y:\Work\refs\tags\3.4.7\source\Octopus.Core\Initialization\StoreInitializer.cs:line 22
в Octopus.Server.Commands.AdminCommand.Start() in Y:\Work\refs\tags\3.4.7\source\Octopus.Server\Commands\AdminCommand.cs:line 65
в Octopus.Shared.Startup.AbstractCommand.Octopus.Shared.Startup.ICommand.Start(String[] commandLineArguments, ICommandRuntime commandRuntime, OptionSet commonOptions) in Y:\Work\refs\tags\3.4.7\source\Octopus.Shared\Startup\AbstractCommand.cs:line 57
в Octopus.Shared.Startup.OctopusProgram.Start(ICommandRuntime commandRuntime) in Y:\Work\refs\tags\3.4.7\source\Octopus.Shared\Startup\OctopusProgram.cs:line 221
в Octopus.Shared.Startup.ConsoleHost.Run(Action`1 start, Action shutdown) in Y:\Work\refs\tags\3.4.7\source\Octopus.Shared\Startup\ConsoleHost.cs:line 72
в Octopus.Shared.Startup.OctopusProgram.Run() в Y:\Work\refs\tags\3.4.7\source\Octopus.Shared\Startup\OctopusProgram.cs:line 94
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 “admin” --password “********” // hidden
Deregistered OctopusServer from the database
Deleted instance: OctopusServer

Hi Aleksander,

Thanks for reaching out! Sorry to hear you’re having this trouble! I’d love to help, but first I’d need some more information. Would you be able to send me the server log after you attempt to install? After the install fails, it will point you to a specific directory where the logs are located. And which directory are you trying to install to?

This should get us on the track to determine what’s causing it to fail.

Kind regards,

Kenny

Thanks for the answer.
Installation directory: C:\Octopus
I attached the server logs. There are two attempts: with existence database and with the new.
Restart of the server did not help me.
P.s. I had already installed Octopus on another server, there were no problems. The version of the server, I unfortunately do not remember.

OctopusServer.txt (23 KB)

Hi Aleksander,

Thanks for the additional information! The error you’re getting is a security setting:
System.Security.Cryptography.CryptographicException: The key has invalid size for this algorithm
We’ve seen this error before, which was due to authentication settings being changed. The resolution with that issue was uninstalling the setup tool, deleting everything, and reinstalling from scratch. Doing that may do the trick for you.

To be thorough, which PowerShell version are you running on that server? Version 2 handles cryptography differently, so if you’re using version 2, upgrading could help!

Kind regards,

Kenny

Thank you so much.
I deleted the old version (3.4.7) and cleaned the path C:\Octopus. Then I downloaded version 3.4.8 and installed from scratch. It worked!