SSL/TLS error while rebuilding xDB index

Avatar de Vinicius

During a troubleshoot session with Sitecore, I was asked to rebuild the xDB index and I thought “I should connect to Sitecore and be able to rebuild it, easy peasy”.

Woah Bro Not so Fast Blog Vinicius Deschamps

Sitecore support provided me with the link, and there are some steps there in how to Rebuild the core

You cannot trigger an index rebuild from a user interface or via the xConnect Client API. You must explicitly trigger the rebuild process in one of the following ways:

To invoke the rebuild request command:

  1. Go to the server where the xConnect Search Indexer is running and open command line.
  2. Navigate to the folder that contains the service – for example: C:\inetpub\wwwroot\<xConnect Collection Search service root>\App_Data\jobs\continuous\IndexWorker.
  3. Run XConnectSearchIndexer -rr (alternatively XConnectSearchIndexer -requestrebuild). The command registers a small document in the live core signaling that the rebuild should be started. The xConnect Search Indexer will notice the document and start the rebuild process.

As my environment is running on Azure, here is how I complete the above steps

1. Navigate to App Services, and clicked on xConnect Collection Search App

Azure Portal App Services xConnect Search Blog Vinicius Deschamps

2. A new blade shows up, and I typed at the search field Advanced tools, clicked on it and then click Go

Azure App Service xConnect Search Advanced Tools Kudu Blog Vinicius Deschamps

3. Advanced Tools (aka Kudu) opens in a new tab, then click Debug console, and Powershell

Azure Kudu Debug Console Powershell Blog Vinicius Deschamps
Azure Kudu Powershell Blog Vinicius Deschamps

4. Now, you can navigate throught the files & folders structures, so go to the following path site\wwwroot\App_data\jobs\continuous\IndexWorker

Azure Kudu xConnect Search App Data Jobs Continuous IndexWorker Blog Vinicius Deschamps

5. In order to rebuild your index, type the following command and hit enter

XConnectSearchIndexer.exe -rr

Azure Kudu xConnectsearchindexe.exe -rr Powershell Blog Vinicius Deschamps

THE ERROR

An error occurred while sending the request. —> System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.

Azure Kudu xConnect Search SSL/TLS Error Blog Vinicius Deschamps

As this rebuild process calls the SOLR, and for my surprise SOLR opened and without SSL errors, valid certificate at the address bar

Solr HTTPS Enabled Blog Vinicius Deschamps

Now, my challenge was to figure out where XConnectSearchIndexer is getting an invalid connection.

While navigating at the XConnect Collection Search via KUDU, I noticed a folder named App_Config at the App_Data\jobs\continuous\IndexWorker and decided to check what’s inside of it, and for my surprise there is a ConnectionStrings.config

Azure Kudu xConnect Search App Data Jobs Continuous IndexWorker App Config Blog Vinicius Deschamps

Let’s look inside of it

Sitecore xConnect Search ConnectionStrings Config Blog Vinicius Deschamps

As you can see, the entry solrCore is using HTTPS but it calls the domain eastus.cloudapp.azure.com which was the initial address Solr had in my configuration, and as I don’t have the proper certificate for it, when I try to access it from the browser

Solr using invalid hostname and invalid Certificate Blog Vinicius Deschamps

Fair enough, Solr is throwing an SSL error, so let’s change the ConnectionStrings.config at App_Data\jobs\continuous\IndexWorker to the working SOLR URL

Sitecore xConnect Search ConnectionStrings Fixed Blog Vinicius Deschamps

Now, let’s execute the XConnectSearchIndexer.exe -rr again

Azure Kudu xConnectSearchIndexer.exe -rr Powershell Complete Successfully Blog Vinicius Deschamps

Rebuild is complete!

I hope you liked it, and I’ll see you on my next post!

Credits

Photo by Sarah Kilian on Unsplash

Tagged in :

Avatar de Vinicius

Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *