Troublesome report troubleshooting

Troublesome report troubleshooting

Creating reports in SSRS and uploading to CRM can be a pain sometimes. The report works just fine in SSRS (well, the CRM-Autofilters don’t of course, but still), but when trying to upload it you get this fine and informative error message:

Not very helpful, so maybe the log file is:
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: An error occurred while trying to add the report to Microsoft Dynamics CRM. Try adding the report again. If this problem persists, contact your system administrator.Detail: 
<OrganizationServiceFault xmlns:i=”http://www.w3.org/2001/XMLSchema-instance” xmlns=”http://schemas.microsoft.com/xrm/2011/Contracts”>
  <ErrorCode>-2147188072</ErrorCode>
  <ErrorDetails xmlns:d2p1=”http://schemas.datacontract.org/2004/07/System.Collections.Generic” />
  <Message>An error occurred while trying to add the report to Microsoft Dynamics CRM. Try adding the report again. If this problem persists, contact your system administrator.</Message>
  <Timestamp>2015-06-29T14:16:35.6330269Z</Timestamp>
  <InnerFault i:nil=”true” />
  <TraceText i:nil=”true” />
</OrganizationServiceFault>

If you are not very used to reading this, the important part is:
An error occurred while trying to add the report to Microsoft Dynamics CRM. Try adding the report again. If this problem persists, contact your system administrator.

Not really sure who that guy is. Anybody know him or her please leave a comment.

Ok. So, maybe the SSRS tracelogs have something. Let.s go to there, in my case it was in this path:
C:Program FilesMicrosoft SQL ServerMSRS11.MSSQLSERVERReporting ServicesLogFiles

Yours is probably something similar.

The last entries in the log were:
library!ReportServer_0-2!1870!06/29/2015-16:28:36:: i INFO: Call to GetItemTypeAction(/Contoso_MSCRM/CustomReports/{f27fb971-691e-e511-93fe-00155d01ac02}).
library!ReportServer_0-2!1870!06/29/2015-16:28:36:: i INFO: Call to CreateReportAction({f27fb971-691e-e511-93fe-00155d01ac02}, /Contoso_MSCRM/CustomReports, False).
processing!ReportServer_0-2!1870!06/29/2015-16:28:36:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.ReportPublishingException: , Microsoft.ReportingServices.ReportProcessing.ReportPublishingException: Exception of type ‘Microsoft.ReportingServices.ReportProcessing.ReportPublishingException’ was thrown.;
library!ReportServer_0-2!1870!06/29/2015-16:28:36:: i INFO: Call to CreateReportAction({f27fb971-691e-e511-93fe-00155d01ac02}, /Contoso_MSCRM/CustomReports, False).
processing!ReportServer_0-2!1870!06/29/2015-16:28:36:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.ReportPublishingException: , Microsoft.ReportingServices.ReportProcessing.ReportPublishingException: Exception of type ‘Microsoft.ReportingServices.ReportProcessing.ReportPublishingException’ was thrown.;
library!ReportServer_0-2!1870!06/29/2015-16:28:36:: i INFO: Call to CreateReportAction({f27fb971-691e-e511-93fe-00155d01ac02}, /Contoso_MSCRM/CustomReports, False).
processing!ReportServer_0-2!1870!06/29/2015-16:28:37:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.ReportPublishingException: , Microsoft.ReportingServices.ReportProcessing.ReportPublishingException: Exception of type ‘Microsoft.ReportingServices.ReportProcessing.ReportPublishingException’ was thrown.;

Again we are all filled with joy and happiness as it is all too clear what is wrong… Well, if you can see it, please tell me, because I can’t. The logg seems to be a dead end as well.

And I am all out of logs to look for, I don’t really think the IIS-log will help.

However, all hope is not lost and we must trust the force, and the force says that the problem is probably that we have some UI component that is weird or that there is some reference that is bad. So I went back to my report, and just for the hell of it, not that I use it that much anyway, pressed the “Preview” tab, and behold, I had replaced a datasets query with a new SQL statement and missed that a tablix had a reference to a field.

So, these are some ways to troubleshoot a report. Maybe I should have done it the other way round. 🙂

Gustaf Westerlund
MVP, Founder and CTO at CRM-konsulterna AB
www.crmkonsulterna.se

Today I was deploying a solution to a production environment and ran into a quite difficult problem; the custom report we had made could not be uploaded to CRM and the error description was rather cryptic. This error description was independent on if we tried to import the entire solution or just added the report directly. The error we received was the following:

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]:

An error occurred while trying to add the report to Microsoft Dynamics CRM. Try adding the report again. If this problem persists, contact your system administrator.Detail:

http://www.w3.org/2001/XMLSchema-instance” xmlns=”http://schemas.microsoft.com/xrm/2011/Contracts“>
  -2147188072
  http://schemas.datacontract.org/2004/07/System.Collections.Generic” />
  An error occurred while trying to add the report to Microsoft Dynamics CRM. Try adding the report again. If this problem persists, contact your system administrator.
  2011-06-16T07:43:12.1856313Z
 
 

I Binged/Googled the webb some and found that this article probably describes this error as it fits our environmen setup:

http://support.microsoft.com/kb/2491352

The error was due to the fact that reports written for SQL 2008 R2 are not compatible with SQL 2008. This has some very important effects as many customers might be running SQL 2008 for the production environments and many developers work with SQL 2008 R2 when developing. This difference might not be noticeable in general but this fact will cause these reports  to not be importable into the production environment.
So, a general suggestion is to have all environments, development, development test, acceptance test, training and production on exactly the same version of both Windows server and SQL-server to avoid any errors showing up in one of the environments but not the other, something that can be very problematic to solve due to the difficulty of finding the error since it by definition cannot be replicated on some of the environments.
Gustaf Westerlund
CEO, Chief Architect and co-Founder at CRM-konsulterna AB
www.crmkonsulterna.se

Installing CRM 4.0 on Windows Server 2008 (R2)

Windows Server 2008 (R2) brings a lot of new and nice features. IIS 7 being one of them and fact that you need to install the features you want to use also makes it more slim and generally better.

However, it does add some extra complexity to installing Dynamics CRM since it requires some components. The installation check that Dynamics CRM runs during installation is not complete in this aspect either and it misses out on some critical components.

I am preparing a virtual machine for a customer of mine and it came with everything installed, but not verified. The Dyn CRM installation did not work. After some checking I found that the following role services were missng:

Static Content Handler
Windows Authentication

and I also added

Digest Authentication and
Static Content Compression

Also the SQL Reporting Services (SSRS) was configured to run with an Execution Account, which I found on some bloggs was erroneous. This is not strange since SSRS with Dynamics CRM is designed for sending the user credentials all the way to the SQL-server, which means that SSRS must impersonate the user. So I disabled this.

After fixing these issues, the best way forward is to reinstall Dyn CRM since trying to fix a faulty installation is a lot harder and takes a lot more time. If you have data that you need, try reinstalling and then redeploying the database.

I am also using VirtuaBox as virtualization and I strongly advise against using the snapshot functionality, it seems very unstable.

Gustaf Westerlund
CEO, Chief Architect and co-Founder at CRM-konsulterna AB

www.crmkonsulterna.se