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

Forums / Bugs & Issues / Object Reference Error Adding a User

Object Reference Error Adding a User

3 posts, 1 answered
  1. alo
    alo avatar
    23 posts
    Registered:
    02 Jan 2009
    05 Aug 2010
    Link to this post
    I am getting an Object Reference Error when clicking on Users in the Sitefinity Admin.  Here is the error info:

    Object reference not set to an instance of an object.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [NullReferenceException: Object reference not set to an instance of an object.]
       Telerik.DataAccess.AspnetProviders.Role.GetUsers() +104
       Telerik.DataAccess.AspnetProviders.TelerikRoleProvider.GetUsersInRole(String roleName) +35
       Telerik.Security.UserManager.GetRoles() +116
       Telerik.Security.WebControls.RolesDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +18
       System.Web.UI.WebControls.Repeater.GetData() +35
       System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +220
       System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +51
       System.Web.UI.WebControls.Repeater.DataBind() +75
       System.Web.UI.WebControls.Repeater.EnsureDataBound() +55
       System.Web.UI.WebControls.Repeater.OnPreRender(EventArgs e) +15
       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.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842
    

    All other admin functions appear to be working.

    I recently migrated this Sitefinity project from VS2008, SQL 2005 and Windows XP to VS2010, SQL 2008, and Windows 7 (64 bit).  I suspect this could be related to the move.

    Any help would be appreciated to resolve this issue.

    Al
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    08 Aug 2010
    Link to this post
    Hello alo,

    The error is result of missing role in your database. It seems that the role has been removed manually from your database or using some script. Now in telerik_UsersInRole you have a users that are associated with the missing role and null exception is thrown. Please check telerik_UsersInRoles and its records for UserId or RoleId whether they reflect the user/roles from telerik_Users and telerik_Roles tables.
     
    Regards,
    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
    Answered
  3. alo
    alo avatar
    23 posts
    Registered:
    02 Jan 2009
    09 Aug 2010
    Link to this post
    It turned out to be records in the telerik_UsersInRoles table where the user_id no longer existed in the telerik_Users table.  I'm not sure how that happened because I'm not deleting any users or roles through custom code.

    Thanks for your help to resolve the problem..

    Al
Register for webinar
3 posts, 1 answered