Troubleshooting a Coveo Search REST Endpoint Error
If your Coveo index and Sitecore instance are on separate machines or if you use a Network Load Balancer (NLB), you might see the following error in the Coveo for Sitecore Diagnostic Page:
The remote server returned an error: (400) Bad Request. 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)
This error message means that the Coveo for Sitecore Diagnostic Page could not verify the REST endpoint connectivity.
This can happen for many reasons:
Having an invalid
<searchApiUri>value in the
Having an invalid
<applicationSecret>value in the
The Coveo Search API was installed without checking the This installation is part of a Sitecore integration check box.
Having an invalid Coveo Search Service URI in the Coveo Search API
config.ymlfile. You can find this URI under the
serversection (see red frame in the code below).
clientCertificatePathattributes could have empty values in the
config.ymlfile (see green frames in the code below). The values provided for these attributes could also be invalid, which means they would lead to nonexistent files.
The following list contains the respective solutions to the causes mentioned in the previous section.
- The value of
Coveo.SearchProvider.Rest.Custom.configfile must be
- Replace the
value in the `Coveo.SearchProvider.Rest.Custom.config` file with the one specified in the Coveo Search API `config.yml` file.
- Make sure that
allowImpersonate: trueis located under the
Sample Applicationsection in the
- The Coveo Search Service URL must be set to
https://<yourCoveoEnterpriseSearchServer>:52810in the Coveo Search API
There are two different solution to the ` serverCertificatePath
/clientCertificatePath` attributes issue depending on the machine the Coveo Search API has been installed on:
- If the Coveo Search API has been installed on the same machine as the Sitecore instance or on an external machine, fill in attributes values by hand. Copy local certificates from the Coveo index to the machine hosting the Coveo Search API. Then, add pathways to the file locations.
- If the Coveo Search API has been installed on the same machine as the Coveo index, simply use the local certificates to fill in the attribute values.
Solving this issue also implies that you check the logs of all components involved in a search query. When done, you should have found which one generates the error.
[Your Sitecore Instance Data Path]\logs
Coveo Search API logs:
C:\Program Files\Coveo Search API 8\logs
Coveo Enterprise Search query logs:
You should then load the following URLs, which are in fact services, to see whether they are accessible or not.
Coveo for Sitecore REST endpoint proxy :
Coveo Search API REST endpoint :
Search Service of Coveo Enterprise Search :
Then, ensure that these services are running on their respective host servers. The service names are:
Sitecore IIS website
Coveo Search API service
Coveo Enterprise Search 7 x64 service
If the issue is still not resolved at this point, try the following steps:
- Uninstall and reinstall the Coveo Search API service, either on the Sitecore instance machine, the Coveo index machine or on a separate machine. If you want, you could use a NBL to install it on more than one machine.
- Start the Coveo Search API service.
- Refresh the Diagnostic Page.