I’m setting up octopus server as a container in EKS, and I have an MSSQL Express database setup in RDS. I created an empty database, octodb, in Express, and started up the container with the connectionstring. It blows up when trying to initialize the database. Here is the log output:
======== Initializing DB ========
Setting database connection string to: server=address,1433;database=octodb;user id=user;password=********
========== SQL Database Connection Details ========
SQL Server: address,1433
SQL Database: octodb
Authentication Type: SQL Server Credentials
User: octopus
===================================================
Testing connection to the 'master' database...
Successfully connected to 'master' database!
Database 'octodb' already exists on SQL Server at 'address,1433', no need to create it.
Checking the Octopus Master Key has been configured.
Generating a new Master Key for this Octopus Server...
Master Key saved; IMPORTANT: use the Octopus Manager or 'Octopus.Server.exe show-master-key' to back the key up.
Making sure it's safe to upgrade the database schema...
Ensuring pre-conditions for upgrading the database are satisfied...
Searching for indexes that might upset the database upgrade process...
- PASS: All columns use the default collation.
- PASS: Your Octopus Server will be compliant with your license after upgrading.
- PASS: We've done our best to remove any unexpected database indexes.
- PASS: The version of your SQL Server satisfies Octopus Server installation requirements.
Executing always run pre scripts...
Executing TSQL Database Server script 'Octopus.Core.UpgradeScriptsAlwaysPre.Script0000 - Database options.sql'
Ensuring COMPATIBILITY_LEVEL for octodb is set to 140
COMPATIBILITY_LEVEL for octodb is already 140 or higher
Checking to see if database schema upgrade is required...
Database already has the expected schema. No changes are required.
Executing always run post scripts...
Executing TSQL Database Server script 'Octopus.Core.UpgradeScriptsAlwaysPost.Script0000 - Refresh Views.sql'
Refreshing view dbo.Dashboard
Refreshing view dbo.IdsInUse
Refreshing view dbo.MultiTenancyDashboard
Refreshing view dbo.Release_WithDeploymentProcess
Refreshing view dbo.RunbookSnapshot_WithRunbookProcess
Refreshing view dbo.TenantProject
===============================================================================
Error reading row 1, column 1. Padding is invalid and cannot be removed..
Compiled reader expression:
(DbDataReader reader, DocumentReaderContext context) =>
{
Type deserializeAsType = Octopus.Core.Model.Configuration.CertificateConfiguration
context.Column = 0
String temp0 = IIF(reader.IsDBNull(0), null, reader.GetString(0))
context.Column = 1
CertificateConfiguration deserializedFromJson = context.DeserializeText(reader, 1, deserializeAsType)
CertificateConfiguration result = deserializedFromJson
if (result != null)
{
}
result
}
Nevermore.ReaderException
at Nevermore.Advanced.ReaderStrategies.Documents.DocumentReaderStrategy.<>c__DisplayClass4_1`1.<CreateReader>b__1(DbDataReader dbDataReader)
at Nevermore.Advanced.ReadTransaction.ProcessReader[TRecord](DbDataReader reader, PreparedCommand command)+MoveNext()
at Nevermore.Advanced.ReadTransaction.Stream[TRecord](PreparedCommand command)+MoveNext()
at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable`1 source, Boolean& found)
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
at Nevermore.Advanced.ReadTransaction.Load[TDocument](String id)
at Octopus.Core.RelationalStorage.RawRelationalTransaction.Load[TDocument](String id) in C:\buildAgent\work\7881e50627116cb\source\Octopus.Core\RelationalStorage\RawRelationalTransaction.cs:line 42
at Octopus.Core.Initialization.BuiltIn.OctopusCertificateInitializer.Initialize(IRawRelationalStore store) in C:\buildAgent\work\7881e50627116cb\source\Octopus.Core\Initialization\BuiltIn\OctopusCertificateInitializer.cs:line 40
at Octopus.Core.Initialization.StoreInitializer.Initialize() in C:\buildAgent\work\7881e50627116cb\source\Octopus.Core\Initialization\StoreInitializer.cs:line 22
at Octopus.Server.Commands.DatabaseCommand.Start() in C:\buildAgent\work\7881e50627116cb\source\Octopus.Server\Commands\DatabaseCommand.cs:line 203
at Octopus.Shared.Startup.AbstractCommand.Start(String[] commandLineArguments, ICommandRuntime commandRuntime, OptionSet commonOptions)
at Octopus.Shared.Startup.OctopusProgram.Start(ICommandRuntime commandRuntime)
at Octopus.Shared.Startup.ConsoleHost.Run(Action`1 start, Action shutdown)
at Octopus.Shared.Startup.OctopusProgram.RunHost(ICommandHost host)
at Octopus.Shared.Startup.OctopusProgram.Run()
--Inner Exception--
Padding is invalid and cannot be removed.
System.Security.Cryptography.CryptographicException
at Internal.Cryptography.UniversalCryptoDecryptor.DepadBlock(Byte[] block, Int32 offset, Int32 count)
at Internal.Cryptography.UniversalCryptoDecryptor.UncheckedTransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount)
at Internal.Cryptography.UniversalCryptoTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount)
at System.Security.Cryptography.CryptoStream.FlushFinalBlockAsync(Boolean useAsync)
at System.Security.Cryptography.CryptoStream.FlushFinalBlock()
at System.Security.Cryptography.CryptoStream.Dispose(Boolean disposing)
at System.IO.Stream.Close()
at System.IO.Stream.Dispose()
at Octopus.Core.Security.MasterKey.MasterKeyEncryption.ToPlaintext(Byte[] masterKey, EncryptedBytes encrypted) in C:\buildAgent\work\7881e50627116cb\source\Octopus.Core\Security\MasterKey\MasterKeyEncryption.cs:line 84
at Octopus.Core.Security.MasterKey.StoredMasterKeyEncryption.ToPlaintext(EncryptedBytes encrypted) in C:\buildAgent\work\7881e50627116cb\source\Octopus.Core\Security\MasterKey\StoredMasterKeyEncryption.cs:line 72
at Octopus.Core.Security.MasterKey.MasterKeyEncryptionExtensions.ToPlaintextString(IMasterKeyEncryption encryption, EncryptedBytes encrypted) in C:\buildAgent\work\7881e50627116cb\source\Octopus.Core\Security\MasterKey\MasterKeyEncryptionExtensions.cs:line 21
at Octopus.Core.RelationalStorage.TypeHandlers.SensitiveStringTypeHandler.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) in C:\buildAgent\work\7881e50627116cb\source\Octopus.Core\RelationalStorage\TypeHandlers\SensitiveStringTypeHandler.cs:line 74
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.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
at Nevermore.Advanced.Serialization.NewtonsoftDocumentSerializer.DeserializeSmallText(String text, Type type)
at Nevermore.Advanced.ReaderStrategies.Documents.DocumentReaderContext.DeserializeText[TDocument](DbDataReader reader, Int32 index, Type concreteType)
at lambda_method(Closure , DbDataReader , DocumentReaderContext )
at Nevermore.Advanced.ReaderStrategies.Documents.DocumentReaderStrategy.<>c__DisplayClass4_1`1.<CreateReader>b__1(DbDataReader dbDataReader)
-------------------------------------------------------------------------------
Terminating process with exit code 100
Full error details are available in the log files at:
/home/octopus/.octopus/OctopusServer/Server/Logs
Octopus/Logs
If you need help, please send these log files to https://octopus.com/support
-------------------------------------------------------------------------------
A little google came up with results regarding a migration and versions of Octopus being off, but this is a fresh, empty database. Any help would be appreciated.