Wednesday, 18 April 2018

Dynamics 365 - SQL Server Custom Report run issue

Trace Log:

Webserver!ReportServer_0-10!187c!04/17/2018-05:26:11:: e ERROR: Reporting Services error Microsoft.ReportingServices.Diagnostics.Utilities.RSException: An error has occurred during report processing. ---> Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: An error has occurred during report processing. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Query execution failed for dataset 'DSMain'. ---> Microsoft.Crm.Reporting.DataExtensionShim.Common.ReportExecutionException:
Microsoft.Crm.CrmException: An unexpected error occurred.
System.ServiceModel.Security.SecurityNegotiationException: A call to SSPI failed, see inner exception.
System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception.
System.ComponentModel.Win32Exception: The target principal name is incorrect ---> Microsoft.Crm.Reporting.DataExtensionShim.Common.ReportExecutionException: An unexpected error occurred. ---> Microsoft.Crm.Reporting.DataExtensionShim.Common.ReportExecutionException: A call to SSPI failed, see inner exception. ---> Microsoft.Crm.Reporting.DataExtensionShim.Common.ReportExecutionException: A call to SSPI failed, see inner exception. ---> Microsoft.Crm.Reporting.DataExtensionShim.Common.ReportExecutionException: The target principal name is incorrect
   --- End of inner exception stack trace ---

Resolution:  

The error is due to a negotiate exception that is occurring with a fail to the SSPI.  Given the rsProcessingAborted and SSPI failure, we are looking at an SPN issue as none are registered under the domain account currently running the CRM AppPool. 

To check the list of spn's registered:
C:\>setspn -l <user running CRM app pool>

Run the following setspn commands on all CRM app servers which should resolve this reporting issue:

setspn -a HTTP/<CRM application server name> <user running CRM app pool>
setspn -a HTTP/<CRM application server FQDN> <user running CRM app pool>

Example:
setspn -a HTTP/CRM1 crmuser
setspn -a HTTP/CRM1.test.com test\crmuser

Do IIS reset and run the report.