Coveo for Sitecore 5 is now available!

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

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 are encouraged to look through the Coveo Q&A forum to identify your problem. If this does not solve your issue, be aware that there is a Sitecore bug which binds new indexes configuration to item buckets.

Thus, if the following setting value is false:

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

Then ContentSearchManager.SearchConfiguration is initialized as an empty one.

The bug was confirmed on Sitecore 7.5

Workaround

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

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