I had some hard drive issues on my computer which forced me to reinstall windows. I was able to backup the database, plus my KeeStore with my Master Key in it, plus the directory C:\Octopus. I don’t even remember what version of Octopus I was running, but I figured it was time for an upgrade anyways, so I downloaded Octopus.2019.6.8-x64.msi and installed it. During the setup wizard part, I received a fatal error. I believe it was when running the “Octopus.Server.exe configure …” step but I am not sure.
Here is some more detail on the error message from the OctopusServer.txt log file:
2019-08-31 09:10:15.5902 10232 7 FATAL Unable to parse configuration key ‘Octopus.Storage.MasterKey’ as a ‘Byte[]’.
Key not valid for use in specified state.
System.FormatException: Unable to parse configuration key ‘Octopus.Storage.MasterKey’ as a ‘Byte[]’. —> System.Security.Cryptography.CryptographicException: Key not valid for use in specified state.
at System.Security.Cryptography.ProtectedData.Unprotect(Byte[] encryptedData, Byte[] optionalEntropy, DataProtectionScope scope)
at Octopus.Shared.Configuration.WindowsMachineKeyEncryptor.Decrypt(String encrypted)
at Octopus.Shared.Configuration.FlatDictionaryKeyValueStore.Get[TData](String name, TData defaultValue, ProtectionLevel protectionLevel)
— End of inner exception stack trace —
at Octopus.Shared.Configuration.FlatDictionaryKeyValueStore.Get[TData](String name, TData defaultValue, ProtectionLevel protectionLevel)
at Octopus.Core.Initialization.BuiltIn.EnsureMasterKeyIsConfiguredInitializer.GenerateMasterKeyIfNotAlreadyConfigured(IMasterKeyConfiguration config, ILog log)
at Nevermore.StoreInitializer.Initialize()
at Octopus.Server.OctopusServerEngine.Start()
at Octopus.Server.Commands.RunCommand.Start()
at Octopus.Shared.Startup.AbstractCommand.Start(String[] commandLineArguments, ICommandRuntime commandRuntime, OptionSet commonOptions)
at Octopus.Shared.Startup.WindowsServiceHost.<>c__DisplayClass1_0.b__0()
at Octopus.Shared.Startup.WindowsServiceAdapter.RunService()
2019-08-31 09:10:15.6337 10232 7 FATAL Unhandled AppDomain exception occurred: Unable to parse configuration key ‘Octopus.Storage.MasterKey’ as a ‘Byte[]’.
System.FormatException
at Octopus.Shared.Configuration.FlatDictionaryKeyValueStore.Get[TData](String name, TData defaultValue, ProtectionLevel protectionLevel)
at Octopus.Core.Initialization.BuiltIn.EnsureMasterKeyIsConfiguredInitializer.GenerateMasterKeyIfNotAlreadyConfigured(IMasterKeyConfiguration config, ILog log)
at Nevermore.StoreInitializer.Initialize()
at Octopus.Server.OctopusServerEngine.Start()
at Octopus.Server.Commands.RunCommand.Start()
at Octopus.Shared.Startup.AbstractCommand.Start(String[] commandLineArguments, ICommandRuntime commandRuntime, OptionSet commonOptions)
at Octopus.Shared.Startup.WindowsServiceHost.<>c__DisplayClass1_0.b__0()
at Octopus.Shared.Startup.WindowsServiceAdapter.RunService()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
–Inner Exception–
Key not valid for use in specified state.
System.Security.Cryptography.CryptographicException
at System.Security.Cryptography.ProtectedData.Unprotect(Byte[] encryptedData, Byte[] optionalEntropy, DataProtectionScope scope)
at Octopus.Shared.Configuration.WindowsMachineKeyEncryptor.Decrypt(String encrypted)
at Octopus.Shared.Configuration.FlatDictionaryKeyValueStore.Get[TData](String name, TData defaultValue, ProtectionLevel protectionLevel)
System.FormatException: Unable to parse configuration key ‘Octopus.Storage.MasterKey’ as a ‘Byte[]’. —> System.Security.Cryptography.CryptographicException: Key not valid for use in specified state.
at System.Security.Cryptography.ProtectedData.Unprotect(Byte[] encryptedData, Byte[] optionalEntropy, DataProtectionScope scope)
at Octopus.Shared.Configuration.WindowsMachineKeyEncryptor.Decrypt(String encrypted)
at Octopus.Shared.Configuration.FlatDictionaryKeyValueStore.Get[TData](String name, TData defaultValue, ProtectionLevel protectionLevel)
— End of inner exception stack trace —
at Octopus.Shared.Configuration.FlatDictionaryKeyValueStore.Get[TData](String name, TData defaultValue, ProtectionLevel protectionLevel)
at Octopus.Core.Initialization.BuiltIn.EnsureMasterKeyIsConfiguredInitializer.GenerateMasterKeyIfNotAlreadyConfigured(IMasterKeyConfiguration config, ILog log)
at Nevermore.StoreInitializer.Initialize()
at Octopus.Server.OctopusServerEngine.Start()
at Octopus.Server.Commands.RunCommand.Start()
at Octopus.Shared.Startup.AbstractCommand.Start(String[] commandLineArguments, ICommandRuntime commandRuntime, OptionSet commonOptions)
at Octopus.Shared.Startup.WindowsServiceHost.<>c__DisplayClass1_0.b__0()
at Octopus.Shared.Startup.WindowsServiceAdapter.RunService()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
My hunch is that it is trying to read a file with master key data in it or maybe from the database but it doesn’t exist or something like that, but I don’t know how to prove that. I can’t seem to find anything with the same error to point me in the right direction to fix the problem. Can someone please help?