4

I have completed the Sitecore Commerce 8.2.1 setup. When I try to register a user on the live site, it shows this error on page:

Failed to persist profile to underlying stores

I have verified the columns of the UserObject table in the Profiles database with that of a working environment. They are the same.

When I check the User Manager in the CMS, the new user details are displayed there, but they are not present in the Customer & Order Manager.

Here is the log:

7296 15:33:39 ERROR Register failed
Exception: CommerceServer.Core.Runtime.Profiles.CommerceProfileSystemException
Message: Failed to persist profile to underlying stores.
Source: CommerceServer.Core.Runtime
   at CommerceServer.Core.Runtime.Profiles.Profile.Update()
   at Sitecore.Commerce.Connect.CommerceServer.Profiles.CommerceServerProfileProvider.GetUserProfile(String userName)
   at Sitecore.Commerce.Connect.CommerceServer.Profiles.CommerceServerProfileProvider.SetPropertyValues(SettingsContext context, SettingsPropertyValueCollection collection)
   at Sitecore.Security.SwitchingProfileProvider.SetPropertyValues(SettingsContext context, SettingsPropertyValueCollection collection)
   at System.Configuration.SettingsBase.SaveCore()
   at System.Configuration.SettingsBase.Save()
   at System.Web.Profile.ProfileBase.SaveWithAssert()
   at System.Web.Profile.ProfileBase.Save()
   at Sitecore.Security.UserProfile.Save()
   at Sitecore.Security.SecurityUtil.SetUserDigestCredentials(User user, String credentials, String credentialsWithoutDomain)
   at Sitecore.Security.SitecoreMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status)
   at System.Web.Security.Membership.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status)
   at System.Web.Security.Membership.CreateUser(String username, String password, String email)
   at Sitecore.Security.Accounts.User.Create(String userName, String password)
   at Sitecore.Commerce.Data.Customers.SitecoreUserRepository.Create(CommerceUser entity, String password)
   at Sitecore.Commerce.Pipelines.Customers.CreateUser.CreateUserInSitecore.CreateUser(CreateUserRequest request, CreateUserResult result)
   at (Object , Object[] )
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
   at Sitecore.Commerce.Pipelines.PipelineService.RunPipeline[TArgs](String pipelineName, TArgs args)
   at Sitecore.Commerce.Services.ServiceProvider.RunPipeline[TRequest,TResult](String pipelineName, TRequest request)
   at Sitecore.Foundation.Commerce.Website.Managers.AccountManager.RegisterUser(RegisterUserInputModel inputModel) in D:\Projects\External\TARH\Code\DCRMarketing\sitecore.demo.retail\src\Foundation\Commerce\Website\Sitecore.Foundation.Commerce.Website\Managers\AccountManager.cs:line 250
   at Sitecore.Feature.Commerce.Customers.Website.Controllers.CustomersController.Register(RegisterUserInputModel inputModel) in D:\Projects\External\TARH\Code\DCRMarketing\sitecore.demo.retail\src\Feature\Customers\Website\Sitecore.Feature.Commerce.Customers.Website\Controllers\CustomersController.cs:line 190

Nested Exception

Exception: System.Runtime.InteropServices.COMException
Message: Exception from HRESULT: 0x80040E2F
Source: CommerceServer.Core.Interop
   at CommerceServer.Core.Interop.Profiles.IProfileObject2.Update()
   at CommerceServer.Core.Runtime.Profiles.Profile.Update()

1 Answer 1

4
+50

Looks like your profile and/or encryption might not be set up properly.

Please check and optionally re-run these steps from the Sitecore Commerce 8.2.1 Deployment Guide. `

ProfileKeyManager.exe /kn /o "c:\profileEncryptionKeys.xml" /f

and

ProfileKeyManager.exe /ke /kf "c:\profileEncryptionKeys.xml" /reg HKEY_LOCAL_MACHINE\SOFTWARE\CommerceServer\Encryption\Keys\CFSolutionStorefrontSite /f

and finally

"C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin\SqlPackage.exe" /Action:Publish /SourceFile:".\Database\Profiles\Commerce.Storefront.ProfileDatabase.dacpac" /TargetDatabaseName:CFSolutionStorefrontSite_profiles /TargetServerName:"127.0.0.1"

Full information in the linked guide.

edited to add

This accepted answer from Community Forums. It is for Sitecore Commerce 9, but I think the underlying problem is the same.

2
  • I have checked this article and stuck at step 5 & 6. commercesdn.sitecore.net/SCpbCS81/SCpbCSRefSfGuide/en-us/… I am looking at a working instance's showconfig.aspx & also its web.config and do not find the encryption or profilewebservices nodes in them. We are using Sitecore 8.2 u5. Could you pls advise where to include those settings.
    – sukesh
    Commented Jun 27, 2018 at 4:58
  • 1
    You can check if the registry path in Website\App_Config\CommerceServer.Core.config is the same as the one you give on step 2 above - then check registry that there is indeed a profile encryption key defined
    – Mark Cassidy
    Commented Jun 27, 2018 at 7:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.