Microsoft Dynamics CRM 2011 - Unable to run any reports due to missing security role in Default Organization

This blog talks about an issue we face while running out of the box or custom reports from Microsoft Dynamics CRM 2011. We will observe that few users in CRM organization are able to run the report. Few other users would suddenly start getting script errors and unable to run any reports from CRM. In this scenario we receive different script errors. Following are the script errors we receive with the error message :- 

'Sys' is undefined

Reportviewer.aspx

Code:0

 

OR
Message: 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>

<head>

<t'.

Line:5

Char:84093

Code:0

URI: https://xx.xx.xx=74AQt8L28NlXxchvwXlsYTo2VcsDEcCgU-G7K7WIvjkCNhS4tK4pjW7bpQ_-pZg7pxIw-38HwOyhg7e83kXd0DnQUrpVJ4oLEUYKYtciF5JSSDZNGeszMARFLR2zrNYV_vrExgs67ryL4NYu9BADLs-UurxMAXQu1U5i44ZyVSc1&t=2610f696

OR

Webpage error details:

User Agent:Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2;.NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E)

Timestamp: Tue, 17 Jul 2012 22:43:06 UTC

Message: Object expected

Line: 60

Char: 1

Code: 0

URI: https://crm2011:5555/CRMTest/CRMReports/rsviewer/reportviewer.aspx

Message: Object expected

Line: 60

Char: 1

Code: 0

URI: https://crm2011:5555/CRMTest/CRMReports/rsviewer/reportviewer.aspx

 

Following are the screenshots of the error we see when running reports from web client:-

 

 

 

 

 

Following is the screenshot of the error message we receive from CRM outlook client :-

 

 

 

 

I collected the CRM platform traces and found we see below error message which is weird as my user has a system administrator security role in the CRM organization from here the user is unable to run the report and receive the script errors:-

 

Error: The user is not assigned any privileges.

Error Number: 0x80042F09

Error Message: The user is not assigned any privileges.

Error Details: The user is not assigned any privileges.

Source File: Not available

Line Number: Not available

Request URL: https://xxxxx/WebResource.axd?d=Mih2KhqNXiMEZcdPxFxoPU35ZpqXzx5IgE22KWlLHEGWElPjg7jxqVW8lNuhobKyfviBzEIss0CJLe14lrREo7AchKHgzXS7E5qUN7rDMW41&t=634670320007546920

Stack Trace Info: [CrmException: The user is not assigned any privileges.]

at Microsoft.Crm.MainApplication.Application_OnPostAuthenticateRequest(Object sender, EventArgs eventArguments)

----------------------------------

An error occurred during the Application_OnPostAuthenticateRequest :

Error: The user is not assigned any privileges.

Stack Trace: at Microsoft.Crm.MainApplication.Application_OnPostAuthenticateRequest(Object sender, EventArgs eventArguments)

----------------------------------

 

This issue looked really different to me until I found out how the authentication works when a user runs a report from a particular organization in CRM.

  

CAUSE OF THIS ISSUE

  

This issue occurs when a user does not have Security Role assigned to him in his default organization in CRM . Now, by user's default organization we mean that organization in entire CRM deployment where the user was first created.

 

For instance I have 3 organization ORG1, ORG2 and ORG3 in CRM . I created a user say user1 in AD and then created this user as a CRM user in ORG 1 for the first time. Thus, ORG1 becomes the default organization for this user. Next, if I create the same user user1 in ORG2 it will not make a difference ORG1 still will be the default organization for USER1.

 

Thus, if future if we remove the security role of user1 from ORG1 , USER1 will not be able to run any reports from ORG2 or ORG3. The user will get all the above mentioned script errors.

 

REASON FOR THE AUTHENTICATION FAILURE 

   

The issue is caused when the user is being authenticated to access the ScriptResource.axd, WebResource.axd and Reserved.ReportViewerWebControl.axd controls. The UserCache is being examined while running any report to authenticate the user using the default  organization information and since the user doesn't have any privileges in that organization, the authentication fails and throws an exception. 

 

 

RESOLUTION

To resolve this issue we should give a security role to the user in his default organization. Please follow the steps mentioned in the last section on how to find default organization for any CRM user.

I have also seen this issue occurring in scenarios where user's has security role in his default organization but that default organization  is being disabled and no more in use but still present in deployment manager. Hence, in such cases either delete the disabled or unused organization from CRM deployment or enable the organization. 

 

To know HOW TO FIND DEFAULT ORGANIZATION FOR ANY USER IN MULTIPLE ORGANIZATION CRM DEPLOYMENT please refer to following blog :-

 

https://blogs.msdn.com/b/arpita/archive/2013/01/23/how-to-find-default-organization-for-any-user-in-multiple-organization-crm-deployment.aspx

 

Continuation of this issue in case this blog does not resolve the problem:-

https://blogs.msdn.com/b/arpita/archive/2014/09/24/unable-to-run-crm-2011-and-crm-2013-reports-sys-is-undefined.aspx