Posts Tagged ‘SSRS’

Troubleshooting CRM Data Connector

The background:

So, I was called in to troubleshoot a CRM Reporting issue a client had, they had CRM Server front end, SQL Server 2008 + SSRS on the backend server – simple setup.

First thing first, CRM Data Connector is just another name (the real name) for Microsoft Dynamics CRM 4.0 Connector for SQL Reporting Services.

A quick revision and the purpose of the Data Connector

From Barry Givens’ post:

  1. Reports in CRM 4.0 are running out of this thing called “SQL Reporting Services Report Viewer” which is plainly an ASP.Net control that runs on the CRM 4.0 Web server. So when users view reports in CRM 4.0, they are hitting up a URL on the CRM 4.0 Web Server.
  2. Because of this, CRM 4.0 reports are always run in a delegated mode, the CRM and SSRS integration has to handle security. This requires us to use integrated authentication and configure trust for delegation between the CRM server, the SSRS server and the SQL server with the CRM database. [Refer to HOW TO: Configure Kerberos authentication for Microsoft CRM 3.0 and Microsoft SQL Server Reporting Services and Microsoft CRM 3.0: Additional Setup Tasks Required if Reporting Services Is Installed on Different Server.]
  3. MSFT decided to make our life less miserable by shipping this Data Connector with CRM 4.0. It is essentially an SSRS Data Processing Extension and handles all of the delegation for us so that we no longer have to fiddle around Kerberos etc, which wasn’t an option in version 3.0.

Right, back to our problem at hand;

The symptoms:

1. When users try to run a SSRS report via CRM Web App, they get a 401.

[{date time}] Process: w3wp |Organization:{Org Guid}
|Thread: 5
|Category: Application
|User: 00000000-0000-0000-0000-000000000000
|Level: Error
| ErrorInformation.LogError
>MSCRM Error Report:
--------------------------------------------------------------------------------------------------------
Error: Exception of type 'System.Web.HttpUnhandledException' was thrown.
Error Number: 0x80040494
Error Message: The request failed with HTTP status 401: Unauthorized.
Error Details: The request failed with HTTP status 401: Unauthorized.
Source File: Not available
Line Number: Not available
Request URL: http://{IPAddress}:5555/{OrgName}/CRMReports/rsviewer/reportviewer.aspx
Stack Trace Info: [WebException: The request failed with HTTP status 401: Unauthorized.]
at Microsoft.SqlServer.ReportingServices2005.Execution.RSExecutionConnection.GetSecureMethods()
at Microsoft.SqlServer.ReportingServices2005.Execution.RSExecutionConnection.IsSecureMethod(String methodname)
at Microsoft.SqlServer.ReportingServices2005.Execution.RSExecutionConnection.LoadReport(String Report, String HistoryID)
at Microsoft.Reporting.WebForms.ServerReport.GetExecutionInfo()
at Microsoft.Reporting.WebForms.ServerReport.SetParameters(IEnumerable`1 parameters)
at Microsoft.Crm.Web.Reporting.SrsReportViewer.ConfigurePage()
[CrmReportingException: The request failed with HTTP status 401: Unauthorized.]
at Microsoft.Crm.Web.Reporting.SrsReportViewer.ConfigurePage()
at Microsoft.Crm.Application.Controls.AppUIPage.OnPreRender(EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
[HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown.]
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.{OrgName}_crmreports_rsviewer_reportviewer_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

2. However, users can directly run the reports via report server URL.

3. When user click on the Preview arrow to the left of each report, like the one shown below;

image

They are greeted with the following error message;

“Reports cannot be run because the Connector for Microsoft SQL Server Reporting Services, a required component for reporting, is not installed on the server that is running Microsoft SQL Server Reporting Services.”

image

4. This is accompanied by the following error message in the CRM Web trace;

[{Date & Time}] Process: w3wp
|Organization:{Org Guid}
|Thread: 6
|Category: Application
|User: 00000000-0000-0000-0000-000000000000
|Level: Error
| ErrorInformation.LogError
>MSCRM Error Report:
--------------------------------------------------------------------------------------------------------
Error: Exception of type 'System.Web.HttpUnhandledException' was thrown.
Error Number: 0x80040492
Error Message: MSCRM Data Connector Not Installed
Error Details: MSCRM Data Connector Not Installed
Source File: Not available
Line Number: Not available
Request URL: http://{IPAddress}:5555/{OrgName}/_grid/preview.aspx?type=9100&id={Report Guid}
Stack Trace Info: [CrmException: MSCRM Data Connector Not Installed]
at Microsoft.Crm.ObjectModel.ReportService.GetReportServer(ExecutionContext context, Boolean verifyAndConfigDataConnector)
at Microsoft.Crm.ObjectModel.ReportService.ListSnapshots(Guid reportId, ExecutionContext context, String[]& HistoryIds, DateTime[]& CreatedDates)
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
at Microsoft.Crm.Application.Utility.Util.RaiseXMLError(Exception exception)
at Microsoft.Crm.Application.Pages.Grids.PreviewPage.ConfigurePage()
at Microsoft.Crm.Application.Controls.AppUIPage.OnPreRender(EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
[HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown.]
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.{OrgName}__grid_preview_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Diagnosis and resolution:

The fact that users are able to browse to the reports via report server and getting a 401 via CRM Web application, suggests the Data Connector is playing up. The second error message about Data Connector confirms this assumption. So we decided to reinstall Data Connector. The steps we did this in are the following;

1. Uninstall Data Connector from Add and Remove Programs.

2. Reinstall Data Connector from command line and the following configuration file.

3. Restart SSRS.

4. Recycle CRM AppPool or IISRESET.

5. Verify it works by firing up new IE and run up the reports.

6. Ask for your managers for a pay rise.

IMPORTANT points to remember when installing CRM Data Connector:

  1. Data Connector must be installed on the same server as the SQL Server Reporting Services instance that your CRM Server is using!
  2. If CRM is using a SQL Server 2008 backend, we must download an installer update file (.msp) from this KB article [How to obtain the setup updates for Microsoft Dynamics CRM 4.0] and install it via command line and a XML configuration file. (Refer to page 97 of the Install Guide for details.)
  3. If there are more than more SQL Server Reporting Services instances on the same server, the Reporting Server Uri and the instance name must be specified in the configuration file. (Like the one shown below.)
  4. Always remember to restart SSRS and IISRESET the CRM Web application before verify this has worked.

<crmsetup>
<srsdataconnector>
<configdbserver></configdbserver>
<autoupdateconfigdb>1</autoupdateconfigdb>
<reportserverurl>http://servername/reportserver_SSRS2008</reportserverurl>
<autogroupmanagementoff>0</autogroupmanagementoff>
<instancename>SSRS2008</instancename>
<configsku>OnPremise</configsku>
<!-- Set enabled = true for DB webstore integration.  Set configdb="true" for config db webstore integration-->
<webstore enabled="false" configdb="false" />
<monitoring>
<!-- Monitoring service account name and password. It can not be local system or network service account -->
<serviceaccountname></serviceaccountname>
<serviceaccountpassword></serviceaccountpassword>
</monitoring>
</srsdataconnector>
</crmsetup>

There you go, happy CRM’in 🙂

Advertisements