An Index Should Be Configured for Database Web Error Is Preventing the REST Service From Loading

In this article

Symptoms

When loading the Coveo for Sitecore REST endpoint proxy, any Coveo Search component, or the Diagnostic page, you might get the following 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)

Cause

There are several causes for this issue. You’re encouraged to look through Coveo Connect (Collaborate tab) to identify your problem. If this doesn’t solve your issue, be aware that there’s a Sitecore bug which binds new indexes configuration to item buckets.

Therefore, if the following setting value is false:

<setting name="BucketConfiguration.ItemBucketsEnabled" value="false" />

Then ContentSearchManager.SearchConfiguration is initialized as an empty one.

Workaround

To solve the issue, enable item buckets in the Sitecore configuration:

<setting name="BucketConfiguration.ItemBucketsEnabled" value="true" />