Encryption validation error when upgrading to K2 5.6

 When upgrading to K2 5.6, you may run into an Encryption Validation error that stops the upgrade and puts it in a 'Recover' stage:


Error in the installer trace log indicates:

However, after the K2 database was migrated, the following script was already completed to drop and re-add encryption:

OPEN MASTER KEY DECRYPTION BY PASSWORD = 'passwordhere'; 
ALTER MASTER KEY DROP ENCRYPTION BY SERVICE MASTER KEY; 
ALTER MASTER KEY ADD ENCRYPTION BY SERVICE MASTER KEY; 
CLOSE MASTER KEY;

And the following does show that data is property decrypted:

OPEN SYMMETRIC KEY SCSSOKey 
DECRYPTION BY CERTIFICATE SCHostServerCert; 
SELECT [VariableToken],
       CONVERT(nvarchar(max), DECRYPTBYKEY([VariableValue])) as 'Decrypted Value',
    [VariableValue]
    FROM [HostServer].[Configuration]
WHERE [Encrypted]=1

The issue was due to the [K2HOSTCONNECTIONSTRING_SYSTEM] row in the HostServer.Configuration table not being encrypted, but the [Encrypted] column was set to 1.

To resolve you can run:

UPDATE [HostServer].[Configuration]
SET [Encrypted] = 0
WHERE [VariableToken] = '[K2HOSTCONNECTIONSTRING_SYSTEM]'

And then re-run the Setup Manager and perform the 'Recover' option.  Once the upgrade is completed, this row should be properly encrypted again.




Comments

Popular posts from this blog

Blocking Error during K2 5.6 Server migration

Client Credentials flow with K2 Cloud with Odata, Workflow REST or SCIM

Blocking error RegisterServiceInstanceObjects when upgrading to K2 5.6/5.7