Thursday, April 19, 2012

Error running custom CRM reports

If you are getting the following errors running a custom CRM report:

Error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled. Details: Error parsing near ' <html> Do you want to continue running scripts on this page?

Or

System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception.
System.ComponentModel.Win32Exception: The target principal name is incorrect

Usually this happens if the SPNs of the CRM web service are not set properly and SRS server is unable to get a Service Ticket from the Ticket Granting Server.

To solve it, register the following SPNs:

  • setspn -a http/<CrmApplicationServerName> <CrmAppPoolServiceUserAccount> (E.g. setspn -a http/devcrmserver domain\crmappservice)
  • setspn -a http/<CrmApplicationServer FQDN> <CrmAppPoolServiceUserAccount> (E.g. setspn -a http/ devcrmserver.domainname.com domain\crmappservice)

NOTE: If you have multiple CRM Application servers, you would need to do this for each server.

NOTE: If after you make this change, your users start complaining they can no longer log into CRM, make the following changes on your CRM server ApplicationHost.config file:

1. Open the ApplicationHost.config file in a text editor.
By default, this file is located at %windir%\system32\inetsrv\config\ (Crm server).
For all folders under the Default Web Site location path, set the value of the WindowsAuthentication element and the useAppPoolCredentials attribute to true.

For example:
<system.webServer>
<security>
<authentication>
<windowsAuthentication enabled="true" useAppPoolCredentials="true" />
</authentication>
</security>
</system.webServer>

Try run any of customized reports again, they should work like other any out-of-the-box reports.

2. Run an iisreset

You can find more information here:
1. http://social.microsoft.com/Forums/en/crm/thread/f1c7384f-0eb0-4bf2-a175-bc7fa30e204b
2. http://blog.sonomapartners.com/2007/04/kerberos_and_de.html

No comments: