Gravatar for u.bannimatti@gmail.com

Question by Umesh Bannimatti, Mar 4, 2016 12:29 AM

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

Hi Team,

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" : [ ] }

Please help me to resolve the same.

Regards, Umesh

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Mar 4, 2016 7:09 AM

Did you rebuild the Coveo indexes from the Sitecore Indexing Manager after installing Coveo for Sitecore? This is required to initially configure the Coveo Enterprise Search index.

Gravatar for u.bannimatti@gmail.com

Comment by Umesh Bannimatti, Mar 4, 2016 8:29 AM

Hi Jeff,

Yes, I have rebuilded both Coveomasterindex and Coveowebindex. When I open Administraton Tool, I can able to see both indexes, but still getting the issues.

Regards, Umesh

1 Reply
Gravatar for jflheureux@coveo.com

Answer by Jean-François L'Heureux, Mar 4, 2016 9:50 AM

The "No user has been provided for the search request" exception usually happens when either:

  • No user is provided. But this is never the case with Coveo for Sitecore.
  • The provided user is considered invalid by CES. It is then removed from the list of users of the search request, leaving an empty list of users. This can happen when the security provider is not yet created by Coveo for Sitecore or when the Sitecore securities cannot be synchronized.

In your case, it seems the Sitecore securities are not synchronized to your Coveo Enterprise Search index while indexing.

  1. In your Coveo Enterprise Search Administration Tool, do you see a "Sitecore Security Provider for [MachineName]-[SitecoreInstanceName]" security provider in the Configuration > Security > Security Providers?
  2. Does this security provider "Sitecore Server Url" property value is accessible from the CES server? CES needs to be able to send HTTP requests to your Sitecore server. Firewall ports may need to be opened. If the URL is not accessible, you need to fix that and rebuild your indexes from the Sitecore Indexing Manager.

The Security Service error "The remote server returned an error: (401) Unauthorized." says that the Sitecore credentials set in the Coveo for Sitecore configuration seems to be invalid. By default, Coveo for Sitecore installs with credentials for sitecore\admin and "b" for the password. If your sitecore\admin Sitecore user password is not "b" or if this user doesn't exist anymore in your instance, you need to update the Sitecore credentials used by Coveo for Sitecore (see Configuring the Sitecore Credentials) and rebuild your indexes from the Sitecore Indexing Manager. Coveo for Sitecore creates a user identity in CES with those credentials. They are used by the security provider to expand Sitecore users and roles.

I hope this helps,

Jeff

Gravatar for u.bannimatti@gmail.com

Comment by Umesh Bannimatti, Mar 4, 2016 10:57 AM

Hi Jeff,

I can see a "Sitecore Security Provider for [MachineName]-[SitecoreInstanceName]" and this security provider "Sitecore Server Url" property value is accessible from the CES server.

Even after updating the Sitecore credentials used by Coveo for Sitecore, with couple of valid sitecore credentials I was not able to resolve that issue.

Now for the Coveo Search Web Service, I am getting different error

Exception Name:FailedToImpersonateUsersException, What:There was no certificate provided by the client while trying to impersonate users. Either provide a trusted client certificate with impersonation rights or login with requested credentials.

For both Coveo Search REST Endpoint () and Coveo Security Service, getting the same error which i have mentioned previously

Note: After every changes I rebuilded the indexes and checked the status in the CoveoDiagnosticPage.

Regards, Umesh

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Mar 4, 2016 12:07 PM

Did you copy the CES index "cert-iis.p12" over to your Sitecore server and set the right path in your Coveo.SearchProvider.config file? Check the step 1 and 2 of https://developers.coveo.com/display/SitecoreV3/Setting+Up+Coveo+for+Sitecore+in+a+Remote+Server+Configuration

In fact, did you follow all this guide?

Gravatar for u.bannimatti@gmail.com

Comment by Umesh Bannimatti, Mar 7, 2016 1:44 AM

Hi Jeff,

Yes, I have verified all those steps. All looks good.

  • I have copied "cert-iis.p12" to the sitecore server and set the right path in the Coveo.SearchProvider.config.
  • SearchServiceUri, AdminServiceUri, QueueUri, SearchCertificatePath, ServerUrl All of these have valid values configured.

No improvement in the Coveo Diagnostics tool.

The error for the component "Coveo Search Web Service", is keep on changing. Today I am getting something like - "Could not establish trust relationship for the SSL/TLS secure channel with authority 'XYZ-XYZ-XYZXY:52810'." Other 2 errors remains same.

Regards, Umesh

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Mar 7, 2016 9:32 AM

At this point, I have no other quick checks for you to try. I suggest you open a support ticket. The support team will be able to help you further. They will probably ask for your configuration files, ShowConfig.aspx, logs and maybe for a live meeting to troubleshoot. Please include a like to this discussion in your ticket description for context.

Thank you

Ask a question