A local error has occurred (formatting fixed)

Last post 08-27-2009 9:10 PM by achenar. 6 replies.

Sort Posts:

  • A local error has occurred (formatting fixed)

    07-03-2007, 10:50 AM
    • Member
      18 point Member
    • andersoyvind
    • Member since 04-18-2007, 10:26 AM
    • Posts 18

    I'm making an intranet webapplication in ASP.NET, using Windows auth and accessing Active Directory using the LDAP-pattern found in one of the stickies on top of the LDAP-threads-list here on forums.asp.net.

    public static DataSet FindUsers(string sFilter, string[] columns, string path, bool useCached);

    I've got a domain controller installed by my side, and using the following in a test-application:

    string filter = "(objectClass=*)";
    string[] columns = new string[]{"sn", "sAMAccountName", "cn"};
    string path = "LDAP:///"; DataSet ds = FindUsers(filter, columns, path, false);
    dataGridView1.DataSource = ds; dataGridView1.AutoGenerateColumns = true;
    dataGridView1.DataMember = ds.Tables[0].ToString();

    I fetch stuff easily, and the DataGridView is filled with it. Nice. BUT. Even if it works right now, tomorrow, or after some amount of hours (not sure how many though), I get DirectoryServicesCOMException thrown at me, saying:

    "A local error has occurred.". It's triggered by the DirectorySearcher.FindAll()-function. Since it's working now, I don't have the exact output in front of me. Google gives me nada on the specific error message, and I get the error message in both my web app and the test-app I mentioned above.

    Anyone with experiences on this? I've set up the domain controller myself, and started wondering if THAT is a potential error source.

    Thanks in advance, Anders Øyvind

  • Cont: A local error has occurred (formatting fixed)

    07-04-2007, 8:24 AM
    • Member
      18 point Member
    • andersoyvind
    • Member since 04-18-2007, 10:26 AM
    • Posts 18

    Expanding the error description, in case someone notice something familiar:

    System.DirectoryServices.DirectoryServicesCOMException was unhandled by user code  Message="A local error has occurred.\r\n"  Source="System.DirectoryServices"  ErrorCode=-2147016645  ExtendedError=-2146893052  ExtendedErrorMessage=""  StackTrace:       at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)       at System.DirectoryServices.DirectoryEntry.Bind()       at System.DirectoryServices.DirectoryEntry.get_AdsObject()       at System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne)

           at System.DirectoryServices.DirectorySearcher.FindAll()

           etc... ExtendedError gave a friend of mine the idea of System Error 772 :ERROR_ROWSNOTRELEASED - The data provider requires that previously fetched data is released before asking for more data. I've inserted a dispose on the DirectorySearcher, but the error occurred once again just now.  In addition to the use of the DirectoryServices framework, I use System.Web.Security.ActiveDirectoryMembershipProvider to provide windows authentication to my web application. The following defines my setup in web.config.  

    <membership defaultProvider="ADMembershipProvider">
    <
    providers>
    <
    clear/>
    <
    add name="ADMembershipProvider" type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="ActiveDirectory"/>
    </
    providers>
    </
    membership>

    The connectionString-name is pointing to an LDAP-connectionString defined under the connectionStrings section of the web.config.

    It really bothers me that I have to reset my computer every hour, so any tip is appreciated ofcourse.

    Anders Ø

    Filed under:
  • Re: Cont: A local error has occurred (formatting fixed)

    11-25-2008, 2:21 PM
    • Member
      7 point Member
    • vbNullString
    • Member since 02-10-2006, 10:55 PM
    • Posts 2

     Hi,

    I'm getting exactly the same error. Have you figured out how to resolve the issue?

  • Re: Cont: A local error has occurred (formatting fixed)

    12-01-2008, 5:25 AM
    • Member
      2 point Member
    • Chris128
    • Member since 12-01-2008, 10:17 AM
    • Posts 1

    I had this problem today when trying to access a windows 2003 AD domain from my vb.net app and this page was pretty much the only thing I found on google when searching for a solution. I eventually found a solution myself so thought I would post it just in case it helps anyone else. The way I got it working was to define the Authentication Type of the DirectoryEntry object as Secure. So for example, instead of this:

    Dim MyUserDE As New DirectoryEntry(ldappath)

    I now do this:

    Dim MyUserDE As New DirectoryEntry(ldappath, username, password, AuthenticationTypes.Secure)

     

    Hope that helps someone out.

    Chris

  • Re: Cont: A local error has occurred (formatting fixed)

    06-25-2009, 11:55 AM
    • Member
      82 point Member
    • sashidhar
    • Member since 03-27-2006, 1:26 AM
    • Framingham, MA
    • Posts 20

    One potential reason would be that the accound that the membership provider is running on is locked. Unlock the user, and you should be fine.

    Sashidhar Kokku
    (Please mark the answer as Complete if you find the answer helpful)
  • Re: Cont: A local error has occurred (formatting fixed)

    08-26-2009, 8:57 AM

    Thanks for the tip.  I have a windows application which was giving me a System.DirectoryServices.DirectoryServicesCOMException of "A local error has occurred" this was due to the user account under which the application was running being locked.

  • Re: Cont: A local error has occurred (formatting fixed)

    08-27-2009, 9:10 PM
    • Member
      6 point Member
    • achenar
    • Member since 09-14-2007, 12:33 AM
    • Posts 3

    Just FYI, I had this "local error" in a one-way trust dev environment: I was trying to search - using FindOne() - for a user in the downstream domain.

    I fixed this by ensuring the upstream server's primary DNS was pointing to its own domain and the alternate DNS was pointing to the downstream domain.

Page 1 of 1 (7 items)