SSRS rskeymgmt throwing error "The system cannot find the file specified"

Rhonda S 6 Reputation points Microsoft Employee

I had an instance of SSRS (2016) that was working fine. The server was running Windows Server 2016 and it was upgraded to Windows Server 2019. Immediately afterward, SSRS stopped working (I couldn't get to the website or ReportServer).

I can re-create an error just by running rskeymgmt; hence the reason I used it in the title. Here are more details on the errors I've seen.

The ReportServerService_xxxx.log log file indicates it's having trouble when it's attempting to start a service due to issues surrounding extracting the Public Key
"rpcserver!DefaultDomain!12a8!01/30/2021-22:19:59:: i INFO: Process monitoring started.
library!WindowsService_0!41dc!01/30/2021-22:19:59:: e ERROR: ServiceStartThread: Exception caught while starting service. Error: System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
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()
at Microsoft.ReportingServices.Library.ConnectionManager.<InitEncryption>b__0()
at Microsoft.ReportingServices.Diagnostics.RevertImpersonationContext.<>c__DisplayClass1.<Run>b__0(Object state)
at System.Security.SecurityContext.Run(SecurityContext securityContext, ContextCallback callback, Object state)
at Microsoft.ReportingServices.Diagnostics.RevertImpersonationContext.Run(ContextBody callback)
at Microsoft.ReportingServices.Library.ConnectionManager.InitEncryption()
at Microsoft.ReportingServices.Library.ServiceController.ServiceStartThread(Object firstStart)"

The Microsoft.ReportingServices.Portal.WebHost_xxxxx.log file indicates this error
"Microsoft.ReportingServices.Portal.WebHost!library!3!01/30/2021-22:20:40:: 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.;"

Using the SSRS configuration manager, I've attempted to delete Encryption Keys but receive the error "Failed to delete the encrypted content in the report server data database. Please execute the DeleteEncryptedContent stored procedure on the database manually." Running the sproc works. Even after using the sproc, the Configuration Managed delete option throws the same error.

I've tried uninstalling and re-installing SSRS. While it was uninstalled I deleted the ReportServer DB in case something stored in there was corrupted. None of this resolved the issue.

Using the configuration manager, all other features appear to be working: the SSRS service is started on the server, I can connect to the ReportServer database, the Web Service URL is created and the Web Portal URL is created. The instance is using the Virtual Service Account. The account SSRS service is running under appears to have correct access to the SQL database.

Since the problem appears to be related to key encryption, I decided to run rskeymgt to export any existing keys. It too throws a very similar error message. When executing: rskeymgmt -e -f keys -p somepassword I receive the error message: "The system cannot find the file specified. (Exception from HRESULT: 0x80070002)"

When I attempt to use rskeymgt to delete any encrypted keys, I get the same error.
rskeymgmt -d results in the error "The system cannot find the file specifed. (Exception from HRESULT: 0x80070002)"

Any ideas on what went wrong when the upgrade occurred and more importantly how to fix it?

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,824 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ZoeHui-MSFT 33,551 Reputation points

    Hi @Rhonda S ,

    One reason for this could be that the encryption key did not restore correctly.

    Did you restore the encryption key successfully after the upgrade completed?

    Did you restart the service after deleting the encryption keys?

    Go to Start > Run > services.msc > Restart the service.

    More details about the key see here.

    The report server was unable to validate the integrity of encrypted data in the database

    It might be related to the report server is unable to decrypt and use any data that is encrypted with the current key.

    Firstly, you need to check the connection between Reporting Service and Report Server Database in Reporting Service Configuration Manager.

    Click Database->Change Credential -> Test Connection.

    If the connection isn’t working, please fix it. Then you could try to delete the encryption keys using Reporting Services Configuration Tool or rskeymgmt utility.


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    Hot issues October