Partilhar via


Intermittent E_ACCESSDENIED when opening SSRS related contents

Have you ever wondered why does your Reporting Services behave in a weird way when you either try to access report manager page or open a report or open a shared data source etc. by throwing errors like: (You'll find these errors either in the page itself on in the Reporting Services log files located under your installation directory)

processing!ReportServer_0-3!aa24!01/05/2017-12:44:46:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: , Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: An unexpected error occurred in Report Processing. ---> System.IO.FileLoadException: Could not load file or assembly 'Microsoft.SqlServer.Types, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. Access is denied.
File name: 'Microsoft.SqlServer.Types, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' ---> System.UnauthorizedAccessException: Access is denied.

processing!ReportServer_0-3!aa24!01/05/2017-12:44:46:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: , Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: An unexpected error occurred in Report Processing. ---> System.IO.FileLoadException: Could not load file or assembly System.Web.RegularExpressions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Access is denied.
File name: 'System.Web.RegularExpressions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ---> System.UnauthorizedAccessException: Access is denied.

library!ReportServer_0-2!e8c8!01/06/2017-13:06:22:: Call to GetSystemPropertiesAction().
ui!ReportManager_0-1!f8c0!01/06/2017-13:06:22:: e ERROR: System.IO.FileLoadException: Could not load file or assembly 'System.EnterpriseServices.Wrapper.dll' or one of its dependencies. Access is denied.
File name: 'System.EnterpriseServices.Wrapper.dll' ---> System.IO.FileLoadException: Could not load file or assembly 'System.EnterpriseServices.Wrapper.dll' or one of its dependencies. Access is denied.
File name: 'System.EnterpriseServices.Wrapper.dll' ---> System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

[UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))]
[FileLoadException: Could not load file or assembly 'System.Web.RegularExpressions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Access is denied.]
System.Web.Configuration.RegexWorker..cctor() +0
[TypeInitializationException: The type initializer for 'System.Web.Configuration.RegexWorker' threw an exception.]
System.Web.Configuration.RegexWorker.Lookup(String from) +0
System.Web.Configuration.BrowserCapabilitiesFactory2.IeProcess(NameValueCollection headers, HttpBrowserCapabilities browserCaps) +322
System.Web.Configuration.BrowserCapabilitiesFactory2.MozillaProcess(NameValueCollection headers, HttpBrowserCapabilities browserCaps) +1188
System.Web.Configuration.BrowserCapabilitiesFactory2.DefaultProcess(NameValueCollection headers, HttpBrowserCapabilities browserCaps) +4079
System.Web.Configuration.Browse

etc.

We believe that one of our patches https://support.microsoft.com/en-us/kb/3045999 has caused this issue. This has to do with CLR functionality where underlying file access is fails randomly with UnAuthorized exception causing issues.

To fix this issue, please follow the workaround:

1) Add a Key under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options and name it “ReportingServicesService.exe

2) Add a DWord named “UseImpersonatedDeviceMap” with a value of 1

3) Reboot the box

 The registry key UseImpersonatedDeviceMap is set if an application is allowed to call Kernel services with Impersonation. If the key doesn't exist (by default), then it is forbidden.

HTH!

Selva.

[All the posts are AS-IS without any warranty]