Gravatar for

Question by coveo_admin, Sep 21, 2015 2:34 PM

Coveo for Sitecore 400 bad request Coveo Search REST Endpoint


Any ideas on how to begin troubleshooting the following error? My sitecore instance and my coveo instance are on different machines. The error below appears on the Sitecore Coveo Diagnostic page…

Coveo for Sitecore components state:

Coveo Search REST Endpoint ()

The remote server returned an error: (400) Bad Request. (Hide details) 
System.Net.WebException: The remote server returned an error: (400) Bad Request.
   at System.Net.HttpWebRequest.GetResponse()
   at Coveo.SearchProvider.Applications.StateVerifier.<>c__DisplayClassd.<GetRestEndpointState>b__c()
   at Coveo.SearchProvider.Applications.BaseVerifier.VerifyComponent(Func`1 p_VerifyMethod, String p_ComponentName)
1 Reply
Gravatar for

Answer by Jean-François L'Heureux, Sep 21, 2015 5:56 PM

With a Coveo Search REST endpoint error, you should check the logs of all the components involved in a search query to find which one is generating the error and possibly find its cause:

  • Sitecore logs ([Your Sitecore Instance Path]\Data\logs)
  • Coveo Search API logs (C:\Program Files\Coveo Search API 8\logs)
  • Coveo Enterprise Search query logs (C:\CES7\Index\Default\Log)

Also, you can load those services URLs to see which ones are working or not:

  • Coveo for Sitecore REST endpoint proxy (http://yourSitecoreInstanceUrl/coveo/rest)
  • Coveo Search API REST endpoint (http://yourCoveoSearchApiServer:8080/rest/search)
  • Coveo Enterprise Search Search Service (http://yourCoveoEnterpriseSearchServer:52810/7.0/CoveoSearchService)

Obviously all those services should be running on their host servers:

  • Sitecore IIS website
  • Coveo Search API service
  • Coveo Enterprise Search 7 x64 service

Main causes for that kind of error are:

  • Wrong <SearchApiUri> value in the Coveo.SearchProvider.Rest.config file (If must be http://yourCoveoSearchApiServer:8080/).
  • Wrong <ApplicationSecret> value in the Coveo.SearchProvider.Rest.config file (It must be the same as the application secret in the Coveo Search API config.yml file).
  • Coveo Search API was installed without checking the "This installation is part of a Sitecore integration" check box (missing allowImpersonate: true under the "Sample Application" section).
  • Wrong Coveo Search Service URL in the Coveo Search API config.yml file (It must be https://yourCoveoEnterpriseSearchServer:52810).
Gravatar for

Comment by coveo_admin, Sep 22, 2015 10:11 AM


I uninstalled and reinstalled the Coveo Search API service on the Coveo Search machine and started the Coveo Search API service, refreshed the Diagnostic page and everything now is green.

Ask a question