+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Active Directory Error

Active Directory Error

4 posts, 0 answered
  1. Richard Baugh
    Richard Baugh avatar
    201 posts
    Registered:
    22 Aug 2012
    16 Jun 2010
    Link to this post
    We have an old site that is running 3.1. I know that this is an old version, but it has a lot of customization and cannot be upgraded at this time.

    We are having problems with Active Directory. The error I am getting when trying to access any admin page that tries to access the AD and load users is the following:
    Item has already been added. Key in dictionary: '***'  Key being added: '***'
    Stack Trace:
    ArgumentException: Item has already been added. Key in dictionary: '***' Key being added: '***'] System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) +7484392 System.Collections.Hashtable.Add(Object key, Object value) +11 System.Web.Security.MembershipUserCollection.Add(MembershipUser user) +129 System.Web.Security.ActiveDirectoryMembershipProvider.FindUsers(DirectoryEntry containerEntry, String filter, String sortKey, Int32 pageIndex, Int32 pageSize, Int32& totalRecords) +738 System.Web.Security.ActiveDirectoryMembershipProvider.FindUsersByName(String usernameToMatch, Int32 pageIndex, Int32 pageSize, Int32& totalRecords) +405 System.Web.Security.ActiveDirectoryMembershipProvider.GetAllUsers(Int32 pageIndex, Int32 pageSize, Int32& totalRecords) +52 Telerik.Security.UserManager.GetAllUsers(Int32 from, Int32 maxRows, String sortExpr, Int32& totalRows) +148 Telerik.Security.WebControls.UsersDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +292 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +19 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73 System.Web.UI.WebControls.GridView.DataBind() +4 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82 System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +72 System.Web.UI.Control.EnsureChildControls() +87 System.Web.UI.WebControls.GridView.get_Rows() +34 Telerik.Security.WebControls.ManageUsers.OnPreRender(EventArgs e) +113 System.Web.UI.Control.PreRenderRecursiveInternal() +80 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842

    Is there anything that you might think of that can help us resolve this issue? To me it almost seems as though the user account is added to an AD group more than once therefore it is added to the hashtable more than once.
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    17 Jun 2010
    Link to this post
    Hi Richard Baugh,

    To me it looks you are right.
    Since we are basically wrapping the standard MS AD provider, you may try to override it too and do a check before adding a user to the users collection. The other way would to override the method and put a break point after each iteration (each user). This way you could see which user is added twice and report it to the network admin. 

    Kind regards,
    Georgi
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Richard Baugh
    Richard Baugh avatar
    201 posts
    Registered:
    22 Aug 2012
    17 Jun 2010
    Link to this post
    How do you recommend overriding this? It appears to be the Add method of the MembershipUserCollection class. The only hashtable I see with the add action is a reference to a private variable of the MembershipUserCollection and it is wrapped in a try catch statement.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    23 Jun 2010
    Link to this post
    Hi Richard Baugh,

    The error you are getting comes from the ASP.NET classes. It looks like an user with the same ID has been added twice to the collection - MembershipUserCollection.Add(). Basically  one of the arguments provided to this method is not valid. Unfortunately I am not able to tell you what exactly the problem is and what exactly has caused it.

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
4 posts, 0 answered