Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Travis 19 posts 46 karma points
    Sep 17, 2010 @ 11:12
    Travis
    0

    Duplicate User name when trying to add new member.

    I have hit a wall (again, seems to be a daily thing for me at the moment) and just can not work out what is going on.

    When I try to create a new member with the code below (all samples are in a c# user control)

    MemberType mt = MemberType.GetByAlias("WebsiteUser");
                    Member newMember = Member.MakeNew(Email.Text, Email.Text, mt, new umbraco.BusinessLogic.User(0));

    or (because it seems like the above sample is depreciated)

    MembershipUser user = Membership.CreateUser(Email.Text,Password.Text);

    or via the CreateNewUserWizard

    I get "Duplicate User name".  Every time, for every user name I try.  Now, I know there is no user in the dbase called 333DeadCatOnTheHighway.  But just in case I somehow missed it when looking through the dbase I tried about 20 different other names just to confirm it wasn't bad luck.

     

    My web.config has an UmbracoMembershipProvider pointing to WebsiteUser as its default member type.  WebsiteUser does have a few custom properties but at this point I am not trying to do anything with them. I have confirmed I can add new members via the Umbraco UI.  

    Anyone have any ideas why I am getting a Duplicate User Name error? 

  • Travis 19 posts 46 karma points
    Sep 20, 2010 @ 08:00
    Travis
    7

    Resolved - Prior to an update to 4.5.2 a user with blank details was added as a member - this member was probably in the database for weeks without any issue.  Something in 4.5.2 caused that blank user to be returned for every create member function hence Duplicate member errors.

  • Andrew Waegel 126 posts 126 karma points
    Oct 08, 2010 @ 03:45
    Andrew Waegel
    0

    This is weird but I had the same problem and same resolution - removed the member with the blank login id from the cmsMember table

  • Simon steed 376 posts 688 karma points
    Nov 25, 2010 @ 17:28
    Simon steed
    0

    This was so frickin annoying and i've wasted so much time and lost face with one of my clients because of this bug! So glad I found this post! Cheers guys.

  • Dave Rollins 35 posts 48 karma points
    Nov 30, 2010 @ 12:00
    Dave Rollins
    0

    I'm on v4.5 and this still has not been fixed. Great post though - scratchin' my head on this one until I found this.

  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Nov 30, 2010 @ 12:07
    Hendy Racher
    0

    (it does beg the question as to how corrupt data originally got into the cmsMember table tho)

  • MVJ 6 posts 26 karma points
    Jan 14, 2011 @ 15:27
    MVJ
    0

    We too had the same issue and thanks for this post. The issue was solved though we spent whole day in debugging.

  • Marcus 41 posts 61 karma points
    Feb 17, 2011 @ 19:33
    Marcus
    0

    same here, thanks! very annoying

  • Marcus 41 posts 61 karma points
    Feb 17, 2011 @ 20:01
    Marcus
    0

    though, for me it creates a blank user even though i have a check to see if emailfield is not null before creating user. but still i get "

    The parameter 'username' must not be empty.
    Parameter name: username
    "

     

    and then it creats the user with blank émail and loginname.

     

    any thoughs on solution?

     

    regards / Marcus

  • TimNape 12 posts 32 karma points
    Apr 07, 2011 @ 10:10
    TimNape
    0

    Removing empty entry from the members table also solved my problem. thank Umbracos

  • Jason Prothero 422 posts 1243 karma points MVP c-trib
    Aug 05, 2011 @ 20:14
    Jason Prothero
    0

    Yep, fixed my problem as well.

     

    As far as the cause, in my case someone had entered spaces at the beginning and end of their username.  Somehow that cause the username to be spaces.  So now I'm trim()ming any user names before creating users.

     

Please Sign in or register to post replies

Write your reply to:

Draft