Unable to Run CRM 2011 and CRM 2013 reports 'Sys' is undefined

As a continuation of one of the unique issues on CRM Reports which I have described in one of my old blogs https://blogs.msdn.com/b/arpita/archive/2012/07/21/microsoft-dynamics-crm-2011-unable-to-run-any-reports-due-to-missing-security-role-in-default-organization.aspx, I was surprised to see another cause of this issue which pops up with exactly same error message.  

If you see fiddler traces it fails exactly on these page WebResource.axd, ScriptResource.axd, Reserved.ReportViewerWebControl.axd as it used to in my last post.

ISSUE 

In CRM UI when we try and run the report from CRM we receive script error as follows:-

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: Fri, 5 Sep 2014 08:33:26 UTC

 Message: Syntax error

 Line: 1

Char: 1

Code: 0

URI: https://dynamics-app.mj.niksun.com/WebResource.axd?d=iTejnrBKj_lSxgH0zeqXUg7Hf6yGNH32DYgpUMJdCFrzVOMOGoL5TGoYlOLTxN6gYISiqx1NtzBzhEaJIQ9rW94zTEzTYfuoQUCQsrTOQnM1&t=634933840637882419

Message: 'Sys' is undefined

Line: 54

Char: 1

Code: 0

URI: https://dynamics-app.mj.niksun.com/NiksunDynamicsCRM/CRMReports/rsviewer/reportviewer.aspx

We also see that all the images in the report are missing, in case you do not get the script error pop up. 

 

I worked on this for hours together, ruled out all the possibilities of this script issue which I had mentioned in my previous blog but nothing helped. We checked all permissions for service accounts, all SPNs were good, made sure it is not IE issue, collected reporting and platform traces but none of these traces logged any errors which made my work even more difficult.  

After collecting all kinds of possible traces I was able to isolate this issue and crack it and hence decided to share my experience with you all who would come across this issue on CRM Reports.

 

RESOLUTION  

  • Updating the CRM web.config file is not supported but still we have seen many of us are not aware of this and we end up editing it and start facing all sorts of unexpected issues. 
  • We have various modules in it. One of the modules is <httpRedirect>. If you see our out of the box web.config file you won't find it in system.webserver unless we have done any changes in IIS in httpRedirect ,module. 
  • We found that someone had manually updated the web.config file of CRM website as follows:-

 

             

            As the clarity of the screenshot is not good, please see below from CRM web.config file:-

             <httpRedirect enabled="true" destination=https://crm.contoso.com/AbcCRM/main.aspx# exactDestination="false" childOnly="true" /> 

               <httpErrors> 

                 <remove statusCode="403" subStatusCode="-1" />

                 <error statusCode="403" subStatusCode="-1" path=https://crm.contoso.com responseMode="Redirect" />

             </httpErrors>

           <urlCompression doDynamicCompression="true" />

  

  • After we removed it completely after comparing it with default working CRM web,config file and did IISRESET on CRM we were able to run all reports with no issue.  

            Note: Editing Web.config file of crm is not supported and can cause unexpected behaviors in CRM like this 

  • Sometime this kind of scenarios become so complicated that it does not catch in crm plat traces too and hence becoming time consuming.  

 

ADDITIONAL CAUSES OF THIS ISSUE 

  • In IIS we have httpRedirect and UrlRewrite modules.
  • Please open it for Dynamics CRM website , if you see any custom rules in any of these for CRM, this can cause scripts error like this too on CRM reports. 
  • By default in UrlRewrite we should see three rules for CRM(do not touch them). If you see any other custom rules apart from these three default rules please remove them and do an IISRESET to see if the issue gets resolved.

 

            

 

  • By default httpRedirect in IIS looks like this for CRM website. 

           

 

Hope this blog will help many of us if we come across this issue on Report! 

 

This blog was continuation of below blog with same error different cause:-

https://blogs.msdn.com/b/arpita/archive/2012/07/21/microsoft-dynamics-crm-2011-unable-to-run-any-reports-due-to-missing-security-role-in-default-organization.aspx

1.png