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?