5

One of our clients is seeing these errors related to users, and appearing to be in part due to Coveo (Sitecore 8.1 Update 1, Coveo June 2016 instance with on-prem free version).

In the first two errors, referencing "GetUserMembers", the report is these are Sitecore user accounts they created but then deleted due to usernames they didn't like (usernames masked to protect the guilty). The third I've seen on another project when I tried to re-index the Coveo_master_index, but this is just cropping up during normal usage.

I know this isn't too much to go on, but I was wondering if anyone had insight to the errors and if there were resolutions, or if this is just normal and people shouldn't be obsessing over the Sitecore logs?


6420 00:00:49 ERROR An error occurred while calling method "GetUserMembers".
Exception: Coveo.Connectors.Sitecore2.SitecoreWebServiceExceptions.SitecoreWebServiceUserNotFoundException
Message: The user "sitecore\[USERNAME]" does not exist.
Source: Coveo.Connectors.Sitecore2.SitecoreWebService
   at Coveo.Connectors.Sitecore2.SitecoreWebService.Wrapper.BaseSitecoreWrapper.GetUserMembers(String p_UserName)
   at Coveo.Connectors.Sitecore2.SitecoreWebService.SitecoreWebService.<>c__DisplayClass1d.<GetUserMembers>b__1c()
   at Coveo.Connectors.Sitecore2.SitecoreWebService.SitecoreWebService.TryCatchWrapper[T](Func`1 p_Action, String p_MethodName)

16128 00:00:49 ERROR An error occurred while calling method "GetUserMembers".
Exception: Coveo.Connectors.Sitecore2.SitecoreWebServiceExceptions.SitecoreWebServiceUserNotFoundException
Message: The user "sitecore\[USERNAME]" does not exist.
Source: Coveo.Connectors.Sitecore2.SitecoreWebService
   at Coveo.Connectors.Sitecore2.SitecoreWebService.Wrapper.BaseSitecoreWrapper.GetUserMembers(String p_UserName)
   at Coveo.Connectors.Sitecore2.SitecoreWebService.SitecoreWebService.<>c__DisplayClass1d.<GetUserMembers>b__1c()
   at Coveo.Connectors.Sitecore2.SitecoreWebService.SitecoreWebService.TryCatchWrapper[T](Func`1 p_Action, String p_MethodName)

8772 00:00:30 ERROR An error occurred while calling method "GetUsersForDomain".
Exception: System.ArgumentException
Message: Item has already been added. Key in dictionary: '[USERNAME]'  Key being added: '[USERNAME]'
Source: mscorlib
   at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
   at System.Web.Security.MembershipUserCollection.Add(MembershipUser user)
   at System.Web.Security.SqlMembershipProvider.FindUsersByName(String usernameToMatch, Int32 pageIndex, Int32 pageSize, Int32& totalRecords)
   at Sitecore.Security.SwitchingMembershipProvider.<>c__DisplayClass4.<FindUsersByName>b__3(MembershipProviderWrapper wrapper, Int32 index, Int32 count, Int32& providerRecords)
   at Sitecore.Common.PagingHelper`2.GetInputRecords(TInput input, GetElements getElements, Int32 startRecord, Int32 recordCount, Int32& totalRecords)
   at Sitecore.Common.PagingHelper`2.GetRecords(Int32 pageIndex, Int32 pageSize, IEnumerable`1 inputList, GetElements getElements, Int32& totalRecords)
   at Sitecore.Security.SwitchingMembershipProvider.GetUsers(MembershipProviderWrapperList wrappers, Int32 pageIndex, Int32 pageSize, Int32& totalRecords, GetElements getElements)
   at Sitecore.Security.SwitchingMembershipProvider.FindUsersByName(String userNameToMatch, Int32 pageIndex, Int32 pageSize, Int32& totalRecords)
   at Sitecore.Security.SitecoreMembershipProvider.<>c__DisplayClass12.<FindUsersByName>b__11()
   at Sitecore.Data.DataProviders.NullRetryer.Execute[T](Func`1 action, Action recover)
   at Sitecore.Security.SitecoreMembershipProvider.FindUsersByName(String userNameToMatch, Int32 pageIndex, Int32 pageSize, Int32& totalRecords)
   at System.Web.Security.Membership.FindUsersByName(String usernameToMatch, Int32 pageIndex, Int32 pageSize, Int32& totalRecords)
   at Sitecore.Security.Domains.Domain.GetUsersByName(Int32 pageIndex, Int32 pageSize, String search, Int32& total)
   at Sitecore.Security.Domains.Domain.GetUsers(Int32 pageIndex, Int32 pageSize, Int32& total)
   at Sitecore.Security.Domains.Domain.GetUsers(Int32 pageIndex, Int32 pageSize)
   at Coveo.Connectors.Sitecore2.SitecoreWebService.Wrapper.BaseSitecoreWrapper.GetUsersForDomain(String p_DomainName, Int32 p_PageIndex, Int32 p_PageSize)
   at Coveo.Connectors.Sitecore2.SitecoreWebService.SitecoreWebService.<>c__DisplayClass1a.<GetUsersForDomain>b__19()
   at Coveo.Connectors.Sitecore2.SitecoreWebService.SitecoreWebService.TryCatchWrapper[T](Func`1 p_Action, String p_MethodName)
1
  • Have you tried updating the security cache for a specific role? In the Coveo Control Panel, under Actions > Update Security Cache > Update User Or Role. It will warn you that the user does not exist in Sitecore, but accept and it should remove the user from the security cache. Although it is still weird that this is happening in the first place... And the last error looks like a SitecoreMembershipProvider conflict error, does this instance have a custom provider that have colliding users? Mar 17 '17 at 12:11
1

This ended up coming back to find me again, and I was able to resolve it. I posted the answer on the Coveo Answers site: https://answers.coveo.com/questions/14254/secured-item-does-not-show-for-authorized-users.html?childToView=14530#answer-14530. You can check the link for some of the back-and-forth to figure out a resolution, but here's the accepted answer:

The answer turned out to be in the way Sitecore manages users, even if you're using an external membership database. Let's say you have a standard membership and roles database set up, with Sitecore configured to connect a custom domain and its users/roles to it. When you create a user, you'll find the record in the aspnet_Users/aspnet_Membership tables of your external database.

What Sitecore also does, however, is to create a record in the aspnet_Users table of the Core database. The user ID doesn't match (or have to), just the username is present with the domain (even if, in your external membership configuration, you specified to not store the domain with the username). This "marker" record is the key; without it, Coveo will throw those errors about not finding a user. (Also without it, setting security on a Sitecore item with an individual user won't work properly, though role-based security will.)

One thing I was doing was using a membership/role provider specifying the custom provider name. This is NOT necessary; use the standard provider calls and Sitecore will organize things correctly in the background. Since we migrated this external database from another application, we had to manually insert the "marker" records into the Core database. After doing that and clearing up the Coveo security cache, everything was good to go.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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