Gravatar for dante.ciambella@gmserv.com

Question by danteciambella, Nov 16, 2016 6:40 AM

The remote server returned an error: (404) Not Found.

I have the following error tring to call rthe url: http://xxxxxxxxxxxxxxx/sitecore%20modules/Web/Coveo/Admin/CoveoDiagnosticPage.aspx The remote server returned an error: (404) Not Found. (in red)

I have done the following checks:

https://localhost:52810/7.0/CoveoSearchService?wsdl is working (attention is configured in https) http://localhost:8080/rest/search?q=test coveo search API is working --> return a Json http://localhost:8080/coveo/rest it return the following:

Requesting "GET /coveo/rest" on servlet "" but only have:

•DELETE /:page
•GET /
•GET /*/lib/69F7FB52CFF1A92A6C5A6B2DE9719937/interface-editor/*
•GET /*/lib/69F7FB52CFF1A92A6C5A6B2DE9719937/jsui/*
•GET /*/lib/interface-editor/*
•GET /*/lib/jsui/*
•GET /:page
•GET /:page/edit
•GET /:page/load
•GET /:page/zip
•GET /favicon.ico
•GET /lib/*
•GET /lib/69F7FB52CFF1A92A6C5A6B2DE9719937/interface-editor/*
•GET /lib/69F7FB52CFF1A92A6C5A6B2DE9719937/jsui/*
•GET /lib/interface-editor/*
•GET /lib/jsui/*
•GET /util/isSearchPageDesigner
•GET /util/repositories
•POST /:page/save
•PUT /:page

is it correct? May be the url need to return a Json? The following is the Coveo.SearchProvider.Rest.config file content:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <pipelines>
      <!-- Pipeline used to customize the JSON response of the search REST endpoint. -->
      <coveoProcessRestJsonResponse>
        <processor type="Coveo.SearchProvider.Rest.Processors.CoveoProcessRestJsonResponse.ParseJsonRestSearchResponseProcessor, Coveo.SearchProvider.Rest" />
      </coveoProcessRestJsonResponse>
      <!-- Pipeline used to customize the information returned by the REST endpoint. -->
      <coveoProcessParsedRestResponse>
        <!-- This processor resolves the REST results clickUri field in the context of the current site using the Sitecore LinkManager. -->
        <processor type="Coveo.SearchProvider.Rest.Processors.CoveoProcessParsedRestResponse.ResolveResultClickableUriProcessor, Coveo.SearchProvider.Rest" />
      </coveoProcessParsedRestResponse>
      <getSearchUserIdentities>
        <!-- This processor adds the virtual groups to the search identities when the active user is a virtual user. -->
        <processor type="Coveo.SearchProvider.Rest.Processors.GetSearchUserIdentities.AddVirtualGroups, Coveo.SearchProvider.Rest" />
        <!-- This processor adds the expanded user mappings to the search identities. -->
        <!--
        <processor type="Coveo.SearchProvider.Rest.Processors.GetSearchUserIdentities.AddUserMappings, Coveo.SearchProvider.Rest" />
        -->
        <!-- This processor maps Sitecore users to Active Directory users by following a domain mapping. -->
        <!--
        <processor type="Coveo.SearchProvider.Rest.Processors.GetSearchUserIdentities.AddActiveDirectoryIdentity, Coveo.SearchProvider.Rest">
          <domainMappings hint="raw:AddDomainMapping">
            <domainMapping sitecoreDomain="ad" adDomain="acme.corp.com" />
          </domainMappings>
        </processor>
        -->
      </getSearchUserIdentities>
      <getUserMappings>
        <!-- This processor uses the e-mail address from the user profile to expand to an e-mail user identity. -->
        <processor type="Coveo.SearchProvider.Rest.Processors.GetUserMappings.AddSitecoreUserEmailIdentity, Coveo.SearchProvider.Rest" />
      </getUserMappings>
      <!-- The "getUserMembers" is exposed by Sitecore2's web service. Therefore, the "getUserMappings" pipeline
           should be used instead to control to which identities a Sitecore user identity is expanded. -->
      <getUserMembers>
        <!-- This processor invokes the "getUserMappings" pipeline in order to expand a Sitecore user identity.
             Invoking the "getUserMappings" pipeline from here ensures a consistent user expansion between on-premises and Cloud deployments. -->
        <processor type="Coveo.SearchProvider.Rest.Processors.Sitecore2.GetUserMembers.InvokeGetUserMappingsPipeline, Coveo.SearchProvider.Rest" />
      </getUserMembers>
      <httpRequestBegin>
        <!-- This processor is required to ensure that requests targeting the REST endpoint are not handled by Sitecore. -->
        <processor patch:before="processor[@type = 'Sitecore.Pipelines.HttpRequest.ItemResolver, Sitecore.Kernel']" type="Coveo.SearchProvider.Rest.Processors.HttpRequestBegin.TransferCoveoRestSearchRequest, Coveo.SearchProvider.Rest" />
      </httpRequestBegin>
      <httpRetry.SearchExceptionsHandler>
        <processor name="CoveoWaitAndRetryCleanUpCall" type="Coveo.Framework.Utils.Rest.HttpWaitAndRetry, Coveo.Framework">
          <retryGroups hint="list:AddGroup">
            <retryGroup name="SecurityProviderNotRegistered" type="Coveo.Framework.Utils.Rest.HttpWaitAndRetryGroup, Coveo.Framework">
              <retryStrategy type="Coveo.Framework.Utils.Rest.ConstantIntervalRetryStrategy">
                <numberOfRetry>20</numberOfRetry>
                <interval>00:00:30</interval>
              </retryStrategy>
              <conditions hint="raw:AddCondition">
                <condition statusCodes="400" responseMatch="SecurityProviderNotRegistered" />
              </conditions>
            </retryGroup>
            <group name="ThrottlingAndTimeout" ref="coveo/retryGroups/throttlingAndTimeout" />
          </retryGroups>
        </processor>
      </httpRetry.SearchExceptionsHandler>
    </pipelines>
    <coveo>
      <!-- Coveo Rest endpoint search settings -->
      <restEndpointConfiguration type="Coveo.Framework.Configuration.RestEndpointConfiguration, Coveo.Framework">
        <!-- The secret key must be configured in the search api service as well. This way, the search api service can trust the application. -->
        <applicationSecret>removed but filled correctly</applicationSecret>
        <!-- The timeout period for requests going through the search api proxy.-->
        <requestTimeout>00:00:30</requestTimeout>
        <!-- Defines the location of the REST endpoint in the website. -->
        <restEndpointPath>/coveo/rest</restEndpointPath>
        <!-- The period during which the search token is valid. -->
        <searchTokenExpiration>01:00:00</searchTokenExpiration>
        <!-- The URI to connect to the search api service. -->
        <searchApiUri>http://localhost:8080/</searchApiUri>
      </restEndpointConfiguration>
    </coveo>
  </sitecore>
</configuration>

When I try to rebuild the index no error is promted inside the log files but it remain in a endless state and I need to close the rebuild in dex pop up. Thanks in advance.

Gravatar for flguillemette@coveo.com

Comment by François Lachance-Guillemette, Nov 16, 2016 7:57 AM

Which section of Diagnostic Package is returning The remote server returned an error: (404) Not Found. ?

Also, what Coveo for Sitecore version are you using? (Full version number)

Gravatar for dante.ciambella@gmserv.com

Comment by danteciambella, Nov 16, 2016 8:51 AM

The section is returning the error is: Coveo Search REST Endpoint I'm using the following components setup:

Coveo for Sitecore 82 4.0 (450) Coveo Enterprise Search 7.0 x64 (8541) for Sitecore Coveo Search API 8.0.1130

Thanks

Gravatar for flguillemette@coveo.com

Comment by François Lachance-Guillemette, Nov 16, 2016 9:44 AM

I just noticed you tested /coveo/rest on localhost:8080 when it should be http://YOUR_SITECORE_INSTANCE/coveo/rest instead. What happens if you try this endpoint?

You should also check the content of your Coveo.SearchProvider.Rest.Custom.config file, as it might contain different values.

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Nov 16, 2016 9:45 AM

You should check in your ShowConfig.aspx for the final configuration.

1 Reply
Gravatar for jflheureux@coveo.com

Answer by Jean-François L'Heureux, Nov 16, 2016 9:45 AM

Hi,

You said:

  • http://localhost:8080/rest/search?q=test coveo search API is working --> return a Json
  • http://localhost:8080/coveo/rest it doesn't return the expected result.

It's normal to have this.

/coveo/rest only exists in your Sitecore website, not on the Coveo Search API service.

The URL to test for the Coveo for Sitecore REST endpoint is http://YourSitecoreInstanceHostName/coveo/rest

With the correct URL, you will be able to troubleshoot why it returns a 404 error.

I hope this helps

Jeff

Gravatar for dante.ciambella@gmserv.com

Comment by danteciambella, Nov 16, 2016 10:26 AM

Ok Jeff tanks.

Now:

  • http://mysitecoreinstance/coveo/rest --> ok executed from my client return json
  • http://localhost:8080/rest/search --> ok executed from the server browser where coveo stuff are installed works fine.

My showconfig.aspx return the following:

<restEndpointConfiguration type="Coveo.Framework.Configuration.RestEndpointConfiguration, Coveo.Framework" patch:source="Coveo.SearchProvider.Rest.config">
  <!-- The secret key must be configured in the search api service as well. This way, the search api service can trust the application. -->
  <applicationSecret>Yjk1e66wQFr6S3esLhnn0u98coeeLvhyevJ5Z5ySzyCsIUQSYmAZ78DDlnXZ12Uuy42xskCQSEYL3PysHvpz6sBg2fTMhI3HOh4O</applicationSecret>
  <!-- The timeout period for requests going through the search api proxy.-->
  <requestTimeout>00:00:30</requestTimeout>
  <!-- Defines the location of the REST endpoint in the website. -->
  <restEndpointPath>/coveo/rest</restEndpointPath>
  <!-- The period during which the search token is valid. -->
  <searchTokenExpiration>01:00:00</searchTokenExpiration>
  <!-- The URI to connect to the search api service. -->
  <searchApiUri>http://localhost:8080/</searchApiUri>
  <apiKey patch:source="Coveo.SearchProvider.Rest.Custom.config" ref="coveo/cloudPlatformConfiguration/apiKey"/>
  <organizationId patch:source="Coveo.SearchProvider.Rest.Custom.config" ref="coveo/cloudPlatformConfiguration/organizationId"/>
  <analyticsUri patch:source="Coveo.SearchProvider.Rest.Custom.config">https://usageanalytics.coveo.com</analyticsUri>
</restEndpointConfiguration>

The problem is still there.

The remote server returned an error: (404) Not Found on Coveo Search Rest EndPoint

What I need to check now please?

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Nov 16, 2016 10:36 AM

Your last comment says "from the server browser where coveo stuff are installed". Did you install the Coveo Search API on a separate server? If so, your <searchApiUri> element value should point to that server, not localhost. I think that's your problem.

Gravatar for dante.ciambella@gmserv.com

Comment by danteciambella, Nov 18, 2016 6:24 AM

Ok thanks I solved the problem.

I added a UrlRewrite rule. The diagnostic page was tring to call: http://mysitecoreinstance/pysicalfolder/coveo/rest

I added the following and now everything is green!!

<rule name="sc8_coveo" stopProcessing="true">
  <match url="^coveo/(.*)$" />
  <action type="None" />      
</rule>
Ask a question