views:

213

answers:

0

I found a couple other postings discussing this error, but my situation is slightly different than the others I've seen First let's get the platform/settings out of the way:

* CS 2007 SP2
* Windows 2008 Server Standard x64 SP1
* Using the user name field instead of the email field.  Field type is nvarchar.
* User name is trimmed before assigning it to the profile
* Using the membership log in control that comes with Visual Studio 2008

When a user tries to log in using an existing account, the error found in the title of this post is thrown intermittently. If we recycle the app pool, the problem goes away. Here's the stack trace from the error. The bold line below is where it gets weird:

[COMException (0xc1004043): A duplicate value for unique key member GeneralInfo.Username found while building indices for profile Contact. Check the underlying store for uniqueness of the property. ] Microsoft.CommerceServer.Interop.Profiles.ProfileServiceClass.GetProfileByKey(String bstrKeyMemberName, Object sValue, String bstrType, Boolean bReturnError) +0 Microsoft.CommerceServer.Runtime.Profiles.Profile..ctor(ProfileContext profileService, String keyName, String keyValue, String profileType) +156

[CommerceProfileSystemException: Failed to retrieve profile.] Microsoft.CommerceServer.Runtime.Profiles.Profile..ctor(ProfileContext profileService, String keyName, String keyValue, String profileType) +504 Microsoft.CommerceServer.Runtime.Profiles.ProfileContext.GetProfile(String keyName, String keyValue, String profileType) +647 Microsoft.CommerceServer.Runtime.Profiles.UpmMembershipProvider.CreateMembershipUser(String userName) +97 Microsoft.CommerceServer.Runtime.Profiles.UpmMembershipProvider.ValidateUser(String username, String password) +24 Sitecore.Security.SwitchingMembershipProvider.ValidateUser(String userName, String password) +103 Sitecore.Security.SitecoreMembershipProvider.ValidateUser(String username, String password) +39 System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(AuthenticateEventArgs e) +75 System.Web.UI.WebControls.Login.AttemptLogin() +152 System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +124 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +70 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981


Version Information: Microsoft .NET Framework Version:2.0.50727.3074; ASP.NET Version:2.0.50727.3074

Why is the UPM provider attempting to create a user during a log in? I suspect the error is thrown when the profile system tries to insert the "new" user. At wit's end with this issue. Any help/insight is appreciated.