An operations error has occured

Last post 09-11-2008 3:38 AM by PerG. 3 replies.

Sort Posts:

  • An operations error has occured

    11-20-2007, 1:35 AM

    Ok, I've scoured the net for days now, and I cannot for the life of me find anything that could help with this. We have an ASP.Net application, using Active Directory as the authentication mechanism. However, on random occasions, we get this happening when trying to retrieve user details from AD:

    System.Runtime.InteropServices.COMException (0x80072020): An operations error occurred.

       at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
       at System.DirectoryServices.DirectoryEntry.Bind()
       at System.DirectoryServices.DirectoryEntry.get_AdsObject()
       at System.DirectoryServices.PropertyCollection.Contains(String propertyName)
       at ISL.Security.ActiveDirectory.Utils.GetProperty(DirectoryEntry entry, String name) in C:\Source Control\ISL.CommonServices\ISL\Security\ActiveDirectory\Utils.cs:line 194
       at ISL.Security.ActiveDirectory.ActiveDirectoryManager.PopulateUser(DirectoryEntry entry) in C:\Source Control\ISL.CommonServices\ISL\Security\ActiveDirectory\ActiveDirectoryManager.cs:line 1135
       at ISL.Security.ActiveDirectory.ActiveDirectoryManager.GetUser(UserLookupFilterType lookupFilterType, String lookupfilter, String domainName, Boolean getGroupCollection) in C:\Source Control\ISL.CommonServices\ISL\Security\ActiveDirectory\ActiveDirectoryManager.cs:line 161
       at _Default.InitialiseSession()
       at _Default.InitialisePage()
       at _Default.Page_Load(Object sender, EventArgs e)
       at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
       at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
       at System.Web.UI.Control.OnLoad(EventArgs e)
       at ISL.Web.WebPageBase.OnLoad(EventArgs e) in C:\Source Control\ISL.CommonServices\ISL.Web\WebPageBase.cs:line 624
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)/n/nSystem.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Runtime.InteropServices.COMException (0x80072020): An operations error occurred.

       at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
       at System.DirectoryServices.DirectoryEntry.Bind()
       at System.DirectoryServices.DirectoryEntry.get_AdsObject()
       at System.DirectoryServices.PropertyCollection.Contains(String propertyName)
       at ISL.Security.ActiveDirectory.Utils.GetProperty(DirectoryEntry entry, String name) in C:\Source Control\ISL.CommonServices\ISL\Security\ActiveDirectory\Utils.cs:line 194
       at ISL.Security.ActiveDirectory.ActiveDirectoryManager.PopulateUser(DirectoryEntry entry) in C:\Source Control\ISL.CommonServices\ISL\Security\ActiveDirectory\ActiveDirectoryManager.cs:line 1135
       at ISL.Security.ActiveDirectory.ActiveDirectoryManager.GetUser(UserLookupFilterType lookupFilterType, String lookupfilter, String domainName, Boolean getGroupCollection) in C:\Source Control\ISL.CommonServices\ISL\Security\ActiveDirectory\ActiveDirectoryManager.cs:line 161
       at _Default.InitialiseSession()
       at _Default.InitialisePage()
       at _Default.Page_Load(Object sender, EventArgs e)
       at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
       at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
       at System.Web.UI.Control.OnLoad(EventArgs e)
       at ISL.Web.WebPageBase.OnLoad(EventArgs e) in C:\Source Control\ISL.CommonServices\ISL.Web\WebPageBase.cs:line 624
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
       --- End of inner exception stack trace ---
       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.default_aspx.ProcessRequest(HttpContext context)
       at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

     

    Has anyone else ever experienced this? and if so, how do I resolve it?

    Thanks

    Lyndon

  • Re: An operations error has occured

    11-20-2007, 2:20 AM
    Answer
    • All-Star
      18,335 point All-Star
    • Svante
    • Member since 02-12-2007, 12:15 PM
    • Stockholm, Sweden
    • Posts 2,298
    • Moderator

    This is probably an authentication error. Check how your bind with the AD is done, with what user credentials etc, and ensure that the user does have permission to retrieve that particular user. Error codes from the ADSI layer are notoriously obscure... The error you get map to "ERROR_DS_OPERATIONS_ERROR", which often does mean "ACCESS DENIED", sort of.

    Svante
    AxCrypt - Free Open Source File Encryption & Online Password Manager - http://www.axantum.com
    [Disclaimer: Code snippets usually uncompiled, beware typos.]
    ______
    Don't forget to click "Mark as Answer" on the post(s) that helped you.
  • Re: An operations error has occured

    05-16-2008, 3:55 PM
    • Member
      2 point Member
    • viren_soni
    • Member since 05-16-2008, 7:52 PM
    • Posts 1

    I too faced the similar error. I passed the username and password while creating the Directory object and it worked perfectly. On my development machine WinXP it did not require to do that but once on Win2k3 server iis6.0 I had to pass user name and Password.

  • Re: An operations error has occured

    09-11-2008, 3:38 AM
    • Member
      2 point Member
    • PerG
    • Member since 09-11-2008, 3:30 AM
    • Posts 1

    Hi! 

    This problem is related to the fact that when a user is authenticated against an IIS with Windows Integrated Authentication enabled, a "secondary" token is used. This token cannot be used to authenticate against another server (e.g. domain controller) when the page is impersonated (impersonation="true" in web.config) which means that the user will not be authenticated against Active Directory.

    This can be solved with Kerberos delegation, or by using Basic Authentication instead (which does creates a primary token) or by reverting the impersonation temporary while communicating with Active Directory. I wrote a blogentry with a sample here: http://sharepoint-tweaking.blogspot.com/2007/12/impersonation-in-aspnet-causes.html

Page 1 of 1 (4 items)