Monday, March 26, 2012

rsAccessDenied

I have a reportViewer control on a webform. In my partial class I set the report path, server and parameters in the Page_Load. When I run the report I get this error:

  • The permissions granted to user 'NT AUTHORITY\NETWORK SERVICE' are insufficient for performing this operation. (rsAccessDenied)

    Here is my code:

    Dim u As New UriTypeConverter
    Dim ReportParameters(0) As ReportParameter


    ReportParameters(0) = New ReportParameter("ProjectKey", 262)
    rv.ShowParameterPrompts = False
    rv.ServerReport.ReportServerUrl = u.ConvertFromString("http://localhost/ReportServer/")
    rv.ServerReport.ReportPath = "/Test/Duplicate_MIU_Report"
    rv.ServerReport.SetParameters(ReportParameters)

    Have you properly granted permission for your web user? Go to the configuration tool, and look for any red X on the left hand side. Open the "Web service identity" and make sure your web user is 'NT AUTHORITY\NETWORK SERVICE". Then go to "Database Setup" panel. I think you are using "Service Credentials". Reapply the settings may fix your problem.|||

    I have NT AUTHORITY\NetworkService as the service account (it is grayed out so it is not possible to change), and I have Service Credentials as the credentials type in the database setup. There are no red X's. Still get the same error.

    In addition, I get this DCOM error in the system log:

    The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID

    {BA126AD1-2166-11D1-B1D0-00805FC1270E}

    to the user NT AUTHORITY\NETWORK SERVICE SID (S-1-5-20). This security permission can be modified using the Component Services administrative tool.

    I'm not exactly sure what and how to do in Component Services admin tool.

    |||

    This thread may help you with the DCOM error:

    http://forums.microsoft.com/MSDN/showpost.aspx?postid=258889&siteid=1

    |||Netman has both local activation AND execution|||Do you see Network Services part of RSExec role in your report server catalog db and temp db?|||Yes|||Yes, Network Services is RSExec role in report server catalog db and temp db.|||It looks like Network Service account is not allowed to set parameters. I am not sure what is the mininum permission set. Can you try adding the account as a content manager to the home folder?|||If I right-click in design view in VS2005, the report runs fine. It doesn't work when I try to run in a browser and is being served up by my dev IIS server.|||I have added the NetworkService as administrator and still no go.|||That did it. Was confused in the ReportManager. Simple fix. Seems like lots of people having same problem. Thank you for your help|||Sorry--Don't follow what the fix was. What did it?|||

    Went into Report Manager and gave NT Authority\NetworkService the necessary role assignments.

    |||Thanks--got past that one, now I get to deal with the database access permissions lol...
  • No comments:

    Post a Comment