Gravatar for mark.saad@velir.com

Question by msaad, Sep 3, 2015 10:16 PM

An index should be configured for database "web"

I'm seeing the following error in the Sitecore logs, even if I don't perform any search.

ERROR Application error. Exception: System.InvalidOperationException Message: An index should be configured for database "web". Source: Coveo.UIBase at Coveo.UI.Helpers.SitecoreHelper.GetSearchIndex() at Coveo.SearchProvider.Rest.SitecoreRestHttpHandler.GetSecurityProviderName() at Coveo.SearchProvider.Rest.SitecoreRestHttpHandler.OnInitializeSettings() at Coveo.Search.Api.Proxy.ProxyHttpHandler.OnInitialize() at Coveo.Search.Api.Proxy.ProxyHttpHandler.EnsureInitialized() at Coveo.Search.Api.Proxy.ProxyHttpHandler.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

When I try to use the site search, which should be querying coveowebindex, I get 500 error in the Chrome console and the query doesn't make it through to the coveo server.

http:///api/coveo/get/?errorsAsSuccess=1&q=test

Those errors may or may not be related, but I had to put them all in the question for completeness.

Thanks, Mark

2 Replies
Gravatar for dsoriano@littelfuse.com

Answer by Dean, Sep 4, 2015 3:41 AM

What does the Coveo Diagnostics page in Sitecore tell you when you open it? Have to ask, have you checked if there were any changes to the index names etc

Gravatar for mark.saad@velir.com

Comment by msaad, Sep 4, 2015 11:01 AM

The coveo diagnostics page has all green. Index names are unchanged. I can't see the query in the coveo console on the backend server so I assume it isn't making it this far.

Gravatar for dan@getfishtank.ca

Answer by Dan Cruickshank, Sep 5, 2015 3:51 PM

I've seen this error come up when quite literally, a "web" database doesn't have an associated index.

I'd suggest two things.

1) load http://yoursite/sitecore/admin/ShowConfig.aspx and do a find for: <Database>web</Databse>. It should be located indside of the Coveo.SearchProvider.config

<index id="Coveo_web_index" type="Coveo.SearchProvider.ProviderIndex, Coveo.SearchProvider">
  <param desc="p_Name">$(id)</param>
  <locations hint="list:AddCrawler">
    <crawler type="Coveo.SearchProvider.CoveoItemCrawler, Coveo.SearchProviderBase">
    <Database>web</Database>
    <Root>/sitecore</Root>
    <StopOnError>true</StopOnError>
    </crawler>
  </locations>
  <strategies hint="list:AddStrategy">
    <strategy type="Sitecore.ContentSearch.Maintenance.Strategies.OnPublishEndAsynchronousStrategy, Sitecore.ContentSearch">
    <param desc="database">web</param>
    <CheckForThreshold>true</CheckForThreshold>
    </strategy>
  </strategies>
  <propertyStore type="Sitecore.ContentSearch.Maintenance.IndexDatabasePropertyStore, Sitecore.ContentSearch">
    <Key>$(id)</Key>
    <Database>core</Database>
  </propertyStore>
</index>

Occasionally in disabling/enabling the configs to switch between Lucene & Coveo the index tied to the web DB can disappear.

2) Go: Control Panel -> Indexing > Index Manager -> And re-index "coveowebindex" and confirm that works. This will create the web index (if its wired up)

That's where I'd start having a look.

Ask a question