2

I am unable to build the Coveo for Sitecore master index. While the rebuild is supposedly happening, the number of items processed is always 0. In the Sources of the cloud panel, the index doesn't even show that it is rebuilding. After about 3-5 minutes, I see this message in Indexing Manager: An error occurred while rebuilding the search index.

In the Sitecore logs, this is what I see in the latest log every time I rebuild the index:

20132 12:19:40 WARN  A duplicate setting "ContentSearch.SearchMaxResults" has been detected in the Sitecore.ContentSearch.Solr.DefaultIndexConfiguration.config file. The value of the setting will be changed to "15000".
20132 12:19:41 WARN  Unable to validate the Sitecore credentials. You can disable this validation using the "SkipSitecoreLoginCheck" configuration element. But, be aware that wrong Sitecore credentials will prevent the permissions from being applied correctly on indexed documents.
Exception: System.Web.HttpException
Message: Request is not available in this context
Source: System.Web
   at System.Web.HttpContext.get_Request()
   at System.Web.Profile.SqlProfileProvider.GetPropertyValuesFromDatabase(String userName, SettingsPropertyValueCollection svc)
   at System.Web.Profile.SqlProfileProvider.GetPropertyValues(SettingsContext sc, SettingsPropertyCollection properties)
   at System.Configuration.SettingsBase.GetPropertiesFromProvider(SettingsProvider provider)
   at System.Configuration.SettingsBase.SetPropertyValueByName(String propertyName, Object propertyValue)
   at System.Configuration.SettingsBase.set_Item(String propertyName, Object value)
   at System.Web.Profile.ProfileBase.SetInternal(String propertyName, Object value)
   at System.Web.Profile.ProfileBase.set_Item(String propertyName, Object value)
   at Sitecore.Security.UserProfile.<>c__DisplayClassf.<SetPropertyValueCore>b__e()
   at Sitecore.Data.DataProviders.NullRetryer.ExecuteNoResult(Action action, Action recover)
   at Sitecore.Security.UserProfile.SetPropertyValueCore(String propertyName, Object value)
   at Sitecore.Security.UserProfile.get_CustomProperties()
   at Sitecore.Security.UserProfile.GetCustomProperty(String propertyName)
   at Sitecore.Security.SecurityUtil.GetUserDigestCredentials(User user, Boolean withoutDomain)
   at Sitecore.Security.SecurityUtil.UpdateDigestCredentials(String username, String password)
   at Sitecore.Security.SitecoreMembershipProvider.ValidateUser(String username, String password)
   at Coveo.Framework.Utils.AuthenticationManagerWrapper.ValidateCredentials(String p_Username, String p_Password)
   at Coveo.Framework.Configuration.CoveoIndexConfiguration.ValidateSitecoreCredentials()

20132 12:19:41 WARN  Unable to validate the Sitecore website. You can disable this validation using the "SkipSiteNameValidation" configuration element. But, be aware that using an invalid site name will prevent the Coveo security provider from resolving permissions.
Exception: System.Web.HttpException
Message: Response is not available in this context.
Source: System.Web
   at System.Web.HttpContext.get_Response()
   at Sitecore.Security.Authentication.AuthenticationHelper.HandleAuthenticationError()
   at Sitecore.Security.Authentication.FormsAuthenticationHelper.GetCurrentUser()
   at Sitecore.Security.Authentication.AuthenticationHelper.GetActiveUser()
   at Sitecore.Security.Authentication.AuthenticationManager.GetActiveUser()
   at Sitecore.Context.get_Culture()
   at Sitecore.Caching.HtmlCache..ctor(SiteInfo site, Int64 maxSize)
   at Sitecore.Web.SiteInfo.CreateCaches(StringDictionary properties)
   at Sitecore.Web.SiteInfo..ctor(StringDictionary properties)
   at Sitecore.Sites.SiteContextFactory.GetSites()
   at Sitecore.Sites.SiteContextFactory.GetSiteInfo(String name)
   at Sitecore.Sites.SiteContextFactory.GetSiteContext(String name)
   at Coveo.Framework.Sites.SiteContextFactoryWrapper.GetSiteContext(String p_SiteName)
   at Coveo.Framework.Configuration.CoveoIndexConfiguration.ValidateSiteName()

20132 12:19:41 WARN  Unable to validate the Sitecore credentials. You can disable this validation using the "SkipSitecoreLoginCheck" configuration element. But, be aware that wrong Sitecore credentials will prevent the permissions from being applied correctly on indexed documents.
Exception: System.Web.HttpException
Message: Request is not available in this context
Source: System.Web
   at System.Web.HttpContext.get_Request()
   at Sitecore.Web.WebUtil.GetCookieValue(String key, String defaultValue)
   at Sitecore.Web.WebUtil.GetCookieValue(String key)
   at Sitecore.Configuration.ClientDataStore.GetValue(String name)
   at Sitecore.Security.Authentication.FormsAuthenticationHelper.GetAuthenticationData(String key)
   at Sitecore.SecurityModel.UserRuntimeSettings.Load()
   at Sitecore.Security.Accounts.User.get_RuntimeSettings()
   at Sitecore.Security.UserProfile.IsUserVirtual()
   at Sitecore.Security.UserProfile.SetPropertyValueCore(String propertyName, Object value)
   at Sitecore.Security.UserProfile.get_CustomProperties()
   at Sitecore.Security.UserProfile.GetCustomProperty(String propertyName)
   at Sitecore.Security.SecurityUtil.GetUserDigestCredentials(User user, Boolean withoutDomain)
   at Sitecore.Security.SecurityUtil.UpdateDigestCredentials(String username, String password)
   at Sitecore.Security.SitecoreMembershipProvider.ValidateUser(String username, String password)
   at Coveo.Framework.Utils.AuthenticationManagerWrapper.ValidateCredentials(String p_Username, String p_Password)
   at Coveo.Framework.Configuration.CoveoIndexConfiguration.ValidateSitecoreCredentials()

20132 12:19:41 WARN  Unable to validate the Sitecore website. You can disable this validation using the "SkipSiteNameValidation" configuration element. But, be aware that using an invalid site name will prevent the Coveo security provider from resolving permissions.
Exception: System.Web.HttpException
Message: Response is not available in this context.
Source: System.Web
   at System.Web.HttpContext.get_Response()
   at Sitecore.Security.Authentication.AuthenticationHelper.HandleAuthenticationError()
   at Sitecore.Security.Authentication.FormsAuthenticationHelper.GetCurrentUser()
   at Sitecore.Security.Authentication.AuthenticationHelper.GetActiveUser()
   at Sitecore.Security.Authentication.AuthenticationManager.GetActiveUser()
   at Sitecore.Context.get_Culture()
   at Sitecore.Caching.HtmlCache..ctor(SiteInfo site, Int64 maxSize)
   at Sitecore.Web.SiteInfo.CreateCaches(StringDictionary properties)
   at Sitecore.Web.SiteInfo..ctor(StringDictionary properties)
   at Sitecore.Sites.SiteContextFactory.GetSites()
   at Sitecore.Sites.SiteContextFactory.GetSiteInfo(String name)
   at Sitecore.Sites.SiteContextFactory.GetSiteContext(String name)
   at Coveo.Framework.Sites.SiteContextFactoryWrapper.GetSiteContext(String p_SiteName)
   at Coveo.Framework.Configuration.CoveoIndexConfiguration.ValidateSiteName()

20132 12:19:41 WARN  The index Coveo_master_index has already been initialized.
20132 12:19:41 WARN  The index Coveo_web_index has already been initialized.
3360 12:19:49 WARN  Could not find constructor in ReflectionUtil.CreateObject: Sitecore.ListManagement.Analytics.UnlockContactListsAgent. The constructor parameters may not match or it may be an abstract class. Parameter info: Count: 0
3360 12:19:49 ERROR Error while instantiating agent. Definition: <agent type="Sitecore.ListManagement.Analytics.UnlockContactListsAgent, Sitecore.ListManagement.Analytics" interval="00:30:00" patch:source="Performance.config" xmlns:patch="http://www.sitecore.net/xmlconfig/" />
Exception: Sitecore.Exceptions.ConfigurationException
Message: Could not create instance of type: Sitecore.ListManagement.Analytics.UnlockContactListsAgent. No matching constructor was found.
Source: Sitecore.Kernel
   at Sitecore.Configuration.Factory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert)
   at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)
   at Sitecore.Tasks.Scheduler.ReadAgents()


20132 12:19:54 WARN  [Sitecore Mvc]: Failed to register : Admin, A route named 'Admin_default' is already in the route collection. Route names must be unique.
Parameter name: name
20132 12:19:54 WARN  [Path Analyzer](ApplicationContainer.RegisterType) Failed for Sitecore.PathAnalyzer.Contracts.IWebRequestFactory. Config entry pathAnalyzer/webRequestFactory doesn't exist
17404 12:20:13 WARN  No session Id managers were found to manage the session Id for the current request. Default asp.net session manager will be used.

There are multiple errors going on, and I'm not sure which is causing the issue. I just tried updating the Coveo for Sitecore login, but no luck.

  • Have you tried skipping the site name validation, as it suggests, to see if it works without that? – Søren Kruse Oct 25 '17 at 10:39
  • @SørenKruse I added <skipSiteNameValidation>true</skipSiteNameValidation> but no luck - still seeing this message in the logs. – Paul Oct 26 '17 at 13:50
  • Okay so, it looks like I added it to the configuration in the site files, but at some point I added the config file to my solution, built the solution and overwrote the change. I added the following elements to my config file: <SkipSitecoreLoginCheck>true</SkipSitecoreLoginCheck> <SkipSiteNameValidation>true</SkipSiteNameValidation> and the error no longer appears. But, this does not fix the issue at hand. I will post an answer shortly. – Paul Nov 8 '17 at 18:18
1

For the solution to the Request / Response errors, please see my comment under my question.

The real solution to this problem was the following:

  1. First we realized we were indexing way too many items without layout, so we added a HasLayoutInboundFilter. Thanks to Coveo for suggesting this and providing the samples:

    <processor type="Coveo.SearchProvider.CoveoInboundFilters.HasLayoutInboundFilter, Coveo.SearchProviderBase">
      <ApplyToPaths>/sitecore/content</ApplyToPaths>
    </processor>
    
  2. We deleted the Sitecore content indexes from the admin platform UI and recreated them with just one crawler pointing to one item. The rebuild succeeded. We gradually increased this to hundreds and thousands of items and the rebuild still works. There is still a little delay at the beginning, but usually not much more than 15 seconds unless I'm debugging. We also added a media library crawler with <patch:delete> inside it, because the main search provider config has a crawler for the media library files, which we didn't want or need. Here is what that looks like - you would add this to your custom search provider config above the <scheduling> node:

    <contentSearch> <configuration> <indexes> <index id="Coveo_master_index"> <locations> <crawler name="ContentCrawler" type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch"> <database>master</database> <root>/sitecore/content/Sites/Redacted/Website/News and Media/All News/2017</root> <stopOnError>true</stopOnError> </crawler> <crawler name="MediaLibraryCrawler" type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch"> <patch:delete /> </crawler> </locations> </index> <index id="Coveo_web_index"> <locations> <crawler name="ContentCrawler" type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch"> <database>web</database> <root>/sitecore/content/Sites/Redacted/Website/News and Media/All News/2017</root> <stopOnError>true</stopOnError> </crawler> <crawler name="MediaLibraryCrawler" type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch"> <patch:delete /> </crawler> </locations> </index> </indexes> </configuration> </contentSearch>

  3. Refactored custom computed index field code using Glass Mapper which has increased the rebuild speed.

  4. Additionally there were some "corrupt" Sitecore items in our master/web databases that were causing the rebuilds to error out. Coveo Support outlined which items appeared corrupt. You could also figure this out by checking the Sitecore logs as the rebuild happens.

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.