SSRS Troubleshooting: The report server was unable to validate the integrity of encrypted data in the database.
Won Gold award https://msdnshared.blob.core.windows.net/media/2016/05/0640_NinjaAwardTinyGold.png feb 2019
Introduction
After restoring the databases to a new test database server, configuring the new test Reporting Services server and restoring the encryption key from the 2008 version, we are getting an error for which I haven't been able to find a resolution. The encrypted data for the data sources is accessible, reports execute properly and subscriptions execute properly but the My Subscriptions page shows this error:
Error
The report server was unable to validate the integrity of encrypted data in the database. (rsCannotValidateEncryptedData)
Screenshot
SSRS log
crypto!WindowsService_0!2a64!01/30/2015-14:39:58:: i INFO: Exporting public key
crypto!WindowsService_0!2a64!01/30/2015-14:39:58:: e ERROR: ExportPublicKey failed: System.Runtime.InteropServices.COMException (0x8009000B): Key not valid for use in specified state. (Exception from HRESULT: 0x8009000B)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at RSManagedCrypto.RSCrypto.ExportPublicKey()
at Microsoft.ReportingServices.Diagnostics.SymmetricKeyEncryption.GetPublicKey_Locked()
at Microsoft.ReportingServices.Diagnostics.SymmetricKeyEncryption.GetPublicKey()
library!WindowsService_0!2a64!01/30/2015-14:39:58:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.CannotValidateEncryptedDataException: , Microsoft.ReportingServices.Diagnostics.Utilities.CannotValidateEncryptedDataException: The report server was unable to validate the integrity of encrypted data in the database.;
library!WindowsService_0!2a64!01/30/2015-14:39:58:: e ERROR: ServiceStartThread: Exception caught while starting service. Error: Microsoft.ReportingServices.Diagnostics.Utilities.CannotValidateEncryptedDataException: The report server was unable to validate the integrity of encrypted data in the database. library!WindowsService_0!2a64!01/30/2015-14:39:58:: e ERROR: ServiceStartThread: Attempting to start service again...
Solution
The report server is unable to decrypt and use any data that is encrypted with the current key. To work around this issue.
Backup a key
Select * into keys_backup from keys;
Delete a key
Delete from keys where machine=' ';
Then delete from cmd. as mention in following
The following two steps illustrate how to delete encryption keys using the Reporting Services Configuration Tool or the rskeymgmt utility.
- Using the Reporting Services Configuration Tool
- Start the Reporting Services Configuration tool, and then connect to the report server instance you want to configure.
- Click Encryption Keys, and then click Delete. Click OK.
- Restart the Report Server Windows Service.
- Using the rskeymgmt utility
- Run rskeymgmt.exe locally on the computer that hosts the report server. Use the following syntax: rskeymgmt –d
- Restart the Report Server Windows Service.
To re-specify encrypted values, you need to retype the connection string for each data source and retype the user name and password for each data source that uses stored credentials.