Gravatar for alex.gonsales@rbnz.govt.nz

Question by alexg, Jun 3, 2015 4:45 PM

Coveo Search REST Endpoint () - The remote server returned an error: (401) Unauthorized.

I got Coveo Enterprise installed, the Coveo Search API, and the Coveo package for Sitecore 8, everything seems to be in place but when I open Sitecore and go to Control Panel and select the option "Diagnostic Page" under Coveo Search, it list all components working and configure except this one: Coveo Search REST Endpoint ()

When I click to expand the details it gives me the following information:

The remote server returned an error: (401) Unauthorized. (Hide details)
System.Net.WebException: The remote server returned an error: (401) Unauthorized.
   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)
Gravatar for u.bannimatti@gmail.com

Comment by Umesh Bannimatti, Mar 3, 2016 2:08 PM

Hi Jeff,

Even I am facing the similar issue.

In the CoveoDiagnosticPage, I am getting the following errors.

Coveo Search REST Endpoint ():

The remote server returned an error: (401) Unauthorized

Coveo Search Web Service:

Exception Name:class CES::SearchServerException, What:class CES::SearchServerException: No user has been provided for the search request.

Coveo Security Service:

The remote server returned an error: (401) Unauthorized.


More Details:

  • We have a different server for the Coveo.
  • We have NOT enabled the Secure Admin Service.
  • We have checked the "This installation is part of a Sitecore Integration" check box while installing the Coveo Search API
  • We are able to start the Coveo Search API service.
  • Application Secret is same in both config.yml and Coveo.SearchProvider.Rest.config file.
  • Response for http://OurInstanceName/Coveo/rest: {"totalCount":0,"totalCountFiltered":0,"duration":798,"indexDuration":10,"requestDuration":641,"searchUid":"d5c5f078-4b05-429f-a9a2-16b9a3d18b10","pipeline":"default","apiVersion":2,"triggers":[],"termsToHighlight":{},"phrasesToHighlight":{},"queryCorrections":[],"groupByResults":[],"results":[]}
  • Response for http://YourCoveoSearchApiHost:8080/rest/search { "totalCount" : 0, "totalCountFiltered" : 0, "duration" : 188, "indexDuration" : 10, "requestDuration" : 188, "searchUid" : "fd6c26ab-b43c-4952-97af-2a5a887dde9d", "pipeline" : "default", "apiVersion" : 2, "triggers" : [ ], "termsToHighlight" : { }, "phrasesToHighlight" : { }, "queryCorrections" : [ ], "groupByResults" : [ ], "results" : [ ] }

Regards, Umesh

1 Reply
Gravatar for jflheureux@coveo.com

Answer by Jean-François L'Heureux, Jun 3, 2015 6:02 PM

Did you rebuild your Coveo indexes at least once after installing the Coveo for Sitecore package in Sitecore 8? At the first indexing operation, Coveo for Sitecore will automatically configure the Coveo Search API.

Also, did you check the "This installation is part of a Sitecore Integration" check box while installing the Coveo Search API? This check box must be checked to configure the Coveo Search API in a particular way to work well with Coveo for Sitecore. If you forgot to check it, you may uninstall and reinstall it.

Gravatar for alex.gonsales@rbnz.govt.nz

Comment by alexg, Jun 3, 2015 6:33 PM

Thanks for the suggestion and the insight on the installation! And yeah, I've done the installation the right way, when I got this installed, I made the checkbox for " "This installation is part of a Sitecore Integration" and later rebuild the indexes and troubleshooted all sorts of things, including the review of the confug.yml.

Just now I went for a second shot and tried to uninstall and repeat the installation, again same results

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Jun 4, 2015 9:33 AM

Then, you can try these 2 URLs in a browser:

  • http://yourInstanceName/coveo/rest
  • http://YourCoveoSearchApiHost:8080/rest/search

The first one is called by the search page and redirects the queries to the second. The errors on those pages would give you more information about the problem. Which one of these URLs gives you the HTTP 401 error?

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Jun 4, 2015 5:40 PM

Alex and I troubleshooted the problem.

Problems:

  • The default Coveo Search API port (8080) was used by another application. The service wasn't able to start.
  • The application secret was not synchronized between the Coveo Search API config.yml and the Coveo for Sitecore Coveo.SearchProvider.Rest.config files.

Solution:

  • Change the port in both files and start the Coveo Search API service.
  • Copy the config.yml application secret in the Coveo.SearchProvider.Rest.config file.
Ask a question